ods pdf file="H:\_ODS\SAS_ACT_07_Output.pdf" notoc; /* SAS Activity #7 */ /* Import animals.csv */ /* #1 Label Variables */ data bio.animals2; set bio.animals; label longevity = Longevity (years) gestation = Gestation (days); run; /* #2 PROC CONTENTS */ proc contents data=bio.animals2 varnum; run; /* #3 Scatterplot of X = longevity by Y = gestation */ proc sgplot data=bio.animals2; scatter x = longevity y = gestation; run; /* Not needed for students */ proc print data=bio.animals2; where longevity > 30; run; /* #4 Calculate correlation */ ods graphics on; proc corr data=bio.animals2; var longevity gestation; run; ods graphics off; /* #5 Create a new dataset and remove outlier */ data bio.animals3; set bio.animals2; if longevity = 40 then delete; run; /* #6 Scatterplot of X = longevity by Y = gestation */ proc sgplot data=bio.animals3; scatter x = longevity y = gestation; run; /* #7 Calculate correlation */ ods graphics on; proc corr data=bio.animals3; var longevity gestation; run; ods graphics off; ods pdf close;