给你个程序和说明:
proc reg data=jobprof;
model y=x1 x2 x3 x4/selection = adjrsq cp aic sbc;
run;
A few notes:
(1) depending on which option is specified first on the right hand side of the equation “selection=”, SAS will use that option as the selection method and will report values for all other options specified after the first option. For example, selection=adjrsq cp aic sbc means selecting best subset model using adjusted R square as criterion, report values in order for cp, aic and sbc.
(2) In SAS 9.1 version that we are currently using, SAS doesn’t use AIC and SBC for selecting best subset model. Therefore, we can not put “aic” or “sbc” as first option for “selection=”. If we want to use AIC or SBC as selection method, we can specify slection=adjrsq aic sbc to get AIC and SBC value and then conduct selection by ourselves.