/*********************************************** SAS EXAMPLE -- REGRESSION SELECTION METHODS FILENAME: regression_select.sas ************************************************/ OPTIONS FORMCHAR="|----|+|---+=|-/\<>*"; options formdlim=" " pageno=1 nodate; title; libname labdata "d:\510\2007"; proc means data=labdata.werner3; run; data wernertemp; set labdata.werner3; wtkg = wt*.45; htm = (ht*2.54)/100; bmi = wtkg/htm**2; drop wtkg htm; run; title "Descriptives on New data set"; proc means data=wernertemp; run; TITLE "STEPWISE REGRESSION DEFAULT SETTINGS"; proc reg data=wernertemp; model chol = age bmi pilldum calc uric alb / selection =stepwise details; run; quit; TITLE "BACKWARD SELECTION"; proc reg data=wernertemp; model chol = age bmi pilldum calc uric alb / selection =backward details; run;quit; TITLE "ALL POSSIBLE REGRESSIONS"; proc reg data=wernertemp; model chol = age bmi pilldum calc uric alb / selection =rsquare best=5; run;quit; TITLE "ADJUSTED R-SQUARE SELECTION"; proc reg data=wernertemp; model chol = age bmi pilldum calc uric alb / selection =adjrsq ; run;quit; TITLE "MALLOW'S CP SELECTION"; proc reg data=wernertemp; model chol = age bmi pilldum calc uric alb/ selection =CP; run;quit; TITLE "Stepwise Selection: Force in Certain Variables"; proc reg data=wernertemp; model chol = pilldum age bmi calc uric alb / include=1 selection =stepwise sle=.05 sls=.10; run; quit;