/* Lesson 17-1 */ /* File Name = les1701.sas 10/18/01 */ options linesize=79 pagesize=20; data air; infile 'usair2.prn'; input id $ 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 plot data=outreg1; plot resid1*pred1; plot resid1*x1; plot resid1*x2; plot resid1*x3; plot resid1*x4; plot resid1*x5; plot resid1*x6; plot resid1*y; 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; plot resid2*(x1 x2 x3 x4 x5 x6); plot resid2*(x1-x6); plot resid2*y; run; proc reg data=air; model y=x1-x6 / selection=rsquare; run;