/* x4_3_1.sas */ /* Purpose: */ title1 'Section 4.3.1.'; data a; input y x1 x2 x3; cards; 4.9 0 0 2 3.0 1 0 1 0.2 1 1 0 2.9 1 2 2 6.4 2 1 2 ; proc print data=a; title2 'List of data'; proc reg data=a; model y=x1 x2 x3 /selection=rsquare mse; title2 'All possible regressions.'; proc reg data=a; model y=x1 x2 x3 /selection=backward slstay=0.05 details; title2 'Backward elimination. p-value to stay is 0.05.'; proc reg data=a; model y=x1 x2 x3 /selection=forward slentry=0.10 details; title2 'Forward selection. p-value to enter is 0.10.'; proc reg data=a; model y=x1 x2 x3 /selection=stepwise slentry=0.50 slstay=0.40 details; title2 'Stepwise regression. p-in is 0.50, p-out is 0.40.'; run;