/* Lesson 12-4 */ /* File Name = les1204.sas 07/05/07 */ options linesize=72 pagesize=20; data air; infile 'usair2.prn'; input id $ y x1 x2 x3 x4 x5 x6; /* label 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 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 reg data=air; model y=x1-x6 / selection=stepwise; 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 x2 x3 x4 x5 x6) /vref=0; plot resid1*(x1-x6) /vref=0; plot resid1*y /vref=0; run; proc reg data=air; model y=x1-x6 / selection=rsquare; output out=outreg1 predicted=pred1 residual=resid1; run;