[R] add1() alternative
brunosm
brunosm87 at gmail.com
Fri Nov 2 10:49:09 CET 2012
Hi,
I'm trying to build a hierarchical logistic regression model with lme4
package, but I have a problem on selecting the variables to include in this
model.
In a simple logistic regression, using Forward selection, i use a likelihood
ratio test to check which variables i should include in the model, using the
function add1().
The problem is that this function doesn't work with the hierarchical model
that i'm trying to achieve.
Example:
model<- glmer(y ~ (1 | group)+x+sex+age, family = binomial("logit"), data =
db)
add1(model, db, test="Chisq")
Error: $ operator not defined for this S4 class
I know that the drop1() function works fine to do a backward selection, but
the problem is that i have 40 variables, and which time i use drop1() i have
to wait a loooooong time to get a result...
Is there any alternative to add1()? I mean, i don't want to use
anova(model1,model2) because i would have to do all the models by hand...
Thanks a lot guys,
Bruno
--
View this message in context: http://r.789695.n4.nabble.com/add1-alternative-tp4648215.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list