Possible Duplicate:
short formula call for many variables when building a model
I have a biggish data frame (112 variables) that I'd like to do a stepwise logistic regression on using R. I know how to setup the glm
model and the stepAIC
model, but I'd rather not type in all the headings to input the independent variables. Is there a fast way to give the glm
model an entire data frame as independent variables such that it will recognize each column as an x variable to be included in the model? I tried:
ft<-glm(MFDUdep~MFDUind, family=binomial)
But it didn't work (wrong data types). MFDUdep and MFDUind are both data frames, with MFDUind
containing 111 'x' variables and MFDUdep
containing a single 'y'.