error while using step() on linear mixed effect model

Dear R experts,

I built a linear mixed effect model with two independent regressors (x1,x2) and one repeated regressor (z) and tried to use step function to select a better model. Here is my code:
full.model=glmer(data=data,y~x1+x2+(1|z),family = binomial(link='logit'))
null.model=glmer(data=data,y~1+(1|z),family = binomial(link='logit'))
step(null.model , scope = list(lower=null.model,upper=full.model), direction='both', data = data, trace=0, test="Chisq", steps=10)
I encountered the following error
Error in $<-(*tmp*, formula, value = Terms) :
no method for assigning subsets of this S4 class

Cannot find any helpful information on the internet so far. Could you please help me out? Thanks.


I dont think step() supports glmer from lme4.
it would work with glm for example.

There might be an idea to look somewhere like the CRAN hosted cAIC4 package, that has functions for stepwise selection on lme4 glmer objects

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.