
WEIGHTED CORRELATION
Name:

GROUPED CORRELATION  =  Compute the correlation coefficient based on bivariate frequency data. 
WEIGHED COSINE DISTANCE  =  Compute the weighted cosine distance. 
CORRELATION  =  Compute the correlation of two variables. 
COVARIANCE  =  Compute the covariance of two variables. 
. Step 1: Read the data . skip 25 read berger1.dat y x batch . . Step 2: Compute both the unweighted and weighted correlations . . Weights from eHandbook case study of Alaska pipeline data . let wt = 1/(x**(1.5)) let corr = correlation y x let wtcorr = weighted correlation y x wt let cov = covariance y x let wtcov = weighted covariance y x wt . set write decimals 3 print "Unweighted correlation: ^corr" print "Weighted correlation: ^wtcorr" print "Unweighted covariance: ^cov" print "Weighted covariance: ^wtcov"The following output is returned
Unweighted correlation: 0.945581893216 Weighted correlation: 0.983560277814 Unweighted covariance: 423.101490037 Weighted covariance: 500.3662749985
Privacy
Policy/Security Notice
Disclaimer 
FOIA
NIST is an agency of the U.S. Commerce Department.
Date created: 11/08/2018
Last updated: 08/10/2020
Please email comments on this WWW page to
alan.heckert@nist.gov.