/* Lesson 11-1 */ /* File Name = les1101fix.sas 06/26/03 */ options linesize=79 pagesize=20; data air; infile 'usair2fix.prn'; input id $ 1-20 y x1 x2 x3 x4 x5 x6; /* label id='Cities in US' y='SO2 of air in micrograms per cubic metre' x1='Average annual temperature in F' x2='Number of manufacturing enterprises employing 20 or more workers' x3='Population size (1970 census); in thousands' x4='Average annual wind speed in miles per hour' x5='Average annual precipitation in inches' x6='Average number of days with precipitation per year' ; */ proc print data=air(obs=10); run; proc corr data=air; run; proc reg data=air; model y=x1 x2 x3 x4 x5 x6; output out=outreg1 predicted=pred1 residual=resid1; run; proc print data=outreg1(obs=15); run; proc plot data=outreg1; plot resid1*pred1 /vref=0; plot resid1*x1 /vref=0; plot resid1*x2 /vref=0; plot resid1*x3 /vref=0; plot resid1*x4 /vref=0; plot resid1*x5 /vref=0; plot resid1*x6 /vref=0; plot resid1*y /vref=0; run; proc univariate data=outreg1 plot normal; var resid1; run; proc reg data=air; model y=x1--x6 / selection=stepwise; output out=outreg2 predicted=pred2 residual=resid2; run; proc print data=outreg2(obs=15); run; proc plot data=outreg2; plot resid2*pred2 /vref=0; /* plot resid2*(x1 x2 x3 x4 x5 x6) /vref=0; */ plot resid2*(x1--x6) /vref=0; plot resid2*y /vref=0; run; proc univariate data=outreg2 plot normal; var resid2; run; proc reg data=air; model y=x1--x6 / selection=rsquare; run;