Hello everyone,
I need to write a program (either in SAS or R) that generates all
possible regression models WITH all possible combinations of
interactions (essentially the All Possible Regressions variable
selection method for OLS extended to binary logistic regression and
also extended to include all possible comibnations of interactions).
If the input explanatory variable list was:
VAR = GENDER ETHNICITY COUNTRY
then I want a SAS data set or R data frame generated that looks the
table below. (BTW, these are all possible HIERARCHICAL models, there
are additional non-hierarchical combinations possible. Ideally the
program would be able to generate ALL possible combinations, but have
a macro parameter or function argument (e.g., hierarchical = TRUE)
which would identify and remove the non-hierarchical models from the
results).
Model Number RHS
1 GENDER
2 ETHNICITY
3 COUNTRY
4 GENDER ETHNICITY
5 GENDER COUNTRY
6 ETHNICITY COUNTRY
7 GENDER ETHNICITY GENDER*ETHNICITY
8 GENDER COUNTRY GENDER*COUNTRY
9 ETHNICITY COUNTRY ETHNICITY*COUNTRY
10 GENDER ETHNICITY COUNTRY
11 GENDER ETHNICITY COUNTRY GENDER*ETHNICITY
12 GENDER ETHNICITY COUNTRY GENDER*COUNTRY
13 GENDER ETHNICITY COUNTRY ETHNICITY*COUNTRY
14 GENDER ETHNICITY COUNTRY GENDER*ETHNICITY GENDER*COUNTRY
15 GENDER ETHNICITY COUNTRY GENDER*ETHNICITY ETHNICITY*COUNTRY
16 GENDER ETHNICITY COUNTRY GENDER*COUNTRY GENDER*COUNTRY
17 GENDER ETHNICITY COUNTRY GENDER*ETHNICITY GENDER*COUNTRY ETHNICITY*COUNTRY
18 GENDER ETHNICITY COUNTRY GENDER*ETHNICITY GENDER*COUNTRY
ETHNICITY*COUNTRY GENDER*ETHNICITY*COUNTRY
Any ideas?
Thanks!
Dan
You may leave the list at any time by sending the command
SIGNOFF allstat
to [log in to unmask], leaving the subject line blank.
|