/* OpenIntro LAB 7 */ *Read in the data from the CSV file located on the OpenIntro website; filename mlb11 url 'http://www.openintro.org/stat/data/mlb11.csv'; proc import datafile=mlb11 out=mlb11 dbms=csv replace; getnames=yes; run; *Calculate correlation between runs and at_bats; proc corr data=mlb11; var runs at_bats; run; *Plot regression line for runs and at_bats; proc sgplot data=mlb11; reg x=at_bats y=runs; run; *Estimate the intercept and slope of the regression line; proc reg data=mlb11; model runs=at_bats; run; quit; *Plot regression line for runs and at_bats; proc sgplot data=mlb11; reg x=at_bats y=runs; run; *Re-run regression with each graph output separately; proc reg data=mlb11 plots=diagnostics(unpack); model runs=at_bats; run; quit;