BookmarkSubscribeRSS Feed
FriedrichW
Calcite | Level 5
Multiple linear regression: Can SAS calculate 1024 different subsets from 14 IVs of which 4 are forced into the model? -
- I am trying to do a multiple regression analysis with 1 dependent variable (DV) and 14 independent variables (IVs).
I would like to let SAS calculate every possible subset of variables and select the final model based on the Akaike Information Criteria. I read that SAS can calculate every possible subset of variables for up to 10 IVs (i.e. 1024 subsets). Among my IVs are 4 confounders which I want to force into the model (from the beginning). This I can do with the option “/include=4”. If I now add 6 IVs (X5-X10) to the 4 confounders (X1-X4), SAS will calculate 64 (2 to the power of 6) different subsets (see my SAS code below). But if I add 7 IVs to the 4 confounders i get only 112 (instead of 128), if I add 8 I get 133 (instead of 256) and if I add 9 or 10 IVs I get 157 and 183 instead of 512 and 1024, respectively.
I would rather base my choice of the final model on more than 64 subsets. How does SAS get to the number of 183 subsets instead of 1024? Would it be statistically correct to choose the final model from the 183, should I limit myself to 64 or is there even a possibility to let SAS calculate all 1024 subsets?
Can SAS calculate 1024 different subsets from 14 IVs of which 4 are forced into the model?
proc reg data=BRI outest=EST;
model Y = X1 X2 X3 X4 /* 4 confounders + 6 = 10 IVs */
X5 X6 X7 X8 X9 X10
/ include=4 selection=adjrsq aic sbc;
run; quit;

Thank you very much for your time.
1 REPLY 1
data_null__
Jade | Level 19
I think best option is what you need.

[pre]
data reg;
array v
  • y x1-x14;
    do i = 1 to 100;
    do j = 1 to dim(v);
    v=ranuni(1234);
    end;
    output;
    end;
    run;
    proc reg outest=est;
    model Y = X1-X4 /* 4 confounders */
    X5-x14
    / include=4 best=1024 selection=adjrsq aic sbc;

    run;
    quit;
    proc print n;
    run;
    [/pre]
  • sas-innovate-2024.png

    Don't miss out on SAS Innovate - Register now for the FREE Livestream!

    Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

     

    Register now!

    What is Bayesian Analysis?

    Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

    Find more tutorials on the SAS Users YouTube channel.

    Click image to register for webinarClick image to register for webinar

    Classroom Training Available!

    Select SAS Training centers are offering in-person courses. View upcoming courses for:

    View all other training opportunities.

    Discussion stats
    • 1 reply
    • 890 views
    • 0 likes
    • 2 in conversation