******************************************************************************* * This program indicates how to construct a bivariate scatterplot with an * * overlay of the least squares regression line. * * * * This program also provides an example for calculating point and * * interval estimates of the Pearson, Spearman, and Kendall correlation * * coefficients. * *******************************************************************************; data bodyfat; input subject age bodyfat_perc; cards; 01 23 9.5 02 23 27.9 03 27 7.8 04 27 17.8 05 39 31.4 06 41 25.9 07 45 27.4 08 49 25.2 09 50 31.1 10 53 34.7 11 53 42.0 12 54 29.1 13 56 32.5 14 57 30.3 15 58 33.0 16 58 33.8 17 60 41.1 18 61 34.5 ; run; proc gplot data=bodyfat; plot bodyfat_perc*age/vaxis=axis1 haxis=axis2 nolegend frame; axis1 label=(a=90 '% Body Fat') minor=none; axis2 label=('Age') minor=none; symbol1 value=star color=black interpol=r; title "Scatterplot"; run; proc corr data=bodyfat Pearson Spearman Kendall Fisher(biasadj=no); var age; with bodyfat_perc; title "Correlation Coefficients"; run;