Chapter Contents

Previous

Next
The CORR Procedure

Example 1: Computing Pearson Correlations and Other Measures of Association


Procedure features:
PROC CORR statement options:
HOEFFDING
PEARSON
SPEARMAN
VAR statement

This example


Program

options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
data fitness;
   input Age Weight Runtime Oxygen @@;
   datalines;
57 73.37 12.63 39.407   54 79.38 11.17 46.080
52 76.32 9.63  45.441   50 70.87 8.92    .
51 67.25 11.08 45.118   54 91.63 12.88 39.203
51 73.71 10.47 45.790   57 59.08 9.93  50.545
49 76.32  .    48.673   48 61.24 11.5  47.920
52 82.78 10.5  47.467   44 73.03 10.13 50.541
45 87.66 14.03 37.388   45 66.45 11.12 44.754
47 79.15 10.6  47.273   54 83.12 10.33 51.855
49 81.42 8.95  40.836   51 77.91 10.00 46.672
48 91.63 10.25 46.774   49 73.37 10.08 50.388
44 89.47 11.37 44.609   40 75.07 10.07 45.313
44 85.84 8.65  54.297   42 68.15 8.17  59.571
38 89.02 9.22  49.874   47 77.45 11.63 44.811
40 75.98 11.95 45.681   43 81.19 10.85 49.091
44 81.42 13.08 39.442   38 81.87 8.63  60.055
;
 Note about code
proc corr data=fitness pearson spearman hoeffding;
 Note about code
   var weight oxygen runtime;
 Note about code
   title 'Measures of Association for';
   title2 'a Physical Fitness Study';
run;


Output
The correlation report includes descriptive statistics, Pearson's rho, Spearman's rho, and Hoeffding's D. The report uses the median, instead of the sum, as a descriptive measure when PROC CORR computes nonparametric measures of association.

Because missing data are excluded pairwise, the number of observations PROC CORR uses to calculate the correlation coefficients varies.

[HTML Output]
 [Listing Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.