[R] List arguments from data frame columns in formula

npobedina npobedina at gmail.com
Tue Jan 12 15:45:26 CET 2010


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
-- 
View this message in context: http://n4.nabble.com/List-arguments-from-data-frame-columns-in-formula-tp1012146p1012146.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list