Skip to content
Prev 206097 / 398506 Next

List arguments from data frame columns in formula

Hi!
I'm trying to run logistic regression on a dataset which is contained in
dataframe "data" ("y" is in the first col, and 28 parameters for the model).
How can I write formula for function `glm` without listing explicitly all 28
paramaters?
`glm(data[,1]~data[,2]+data[,3]+data[,4]+...,family=binomial)`

As an option I can use `glm.fit(data[,-1],data[,1],family =
binomial(link=logit))`. But the obtained object cannot be used in function
`predict.glm`.

Thanks,
Natalia