[R] Error running MuMIn dredge function using glmer models

Ben Bolker bbolker at gmail.com
Fri Nov 8 00:10:20 CET 2013

Martin Turcotte <mart.turcotte <at> gmail.com> writes:

> Dear list, 
> I am trying to use MuMIn to compare all possible mixed models 
> using the dredge function on binomial data but I
> am getting an error message that I cannot decode. This error 
> only occurs when I use glmer. When I use an lmer
> analysis on a different response variable every works great. 
> Example using a simplified glmer model
> global model: 
> mod<- glmer(cbind(st$X2.REP.LIVE, st$X2.REP.DEAD) ~ 
> na.action=na.omit , family=binomial) 
> The response variables are the number of survival and dead insects
> (successes and failures)
> DOMESTICATION is a 2 level factor.
> GLUC is a continuous variable.
> PAIR is coded as a factor or character (both ways fail).
> This model functions correctly but when I try it with dredge()
> I get an error. 
> g<- dredge(mod, beta=F, evaluate=F, rank='AIC')
> Error in sprintf(gettext(fmt, domain = domain), ...) : 
>   invalid type of argument[1]: 'symbol'
> When I try with another rank the same thing happens:
> chat<- deviance(mod)/58
> g<- dredge(mod, beta=F, evaluate=F, rank='QAIC', chat=chat)
> Error in sprintf(gettext(fmt, domain = domain), ...) : 
>   invalid type of argument[1]: 'symbol'
> Any suggestions would be greatly appreciated
> thanks
> Martin Turcotte, Ph. D.
> mart.turcotte <at> gmail.com

* Please send follow-ups to r-sig-mixed-models at r-project.org
* I think we need a reproducible example: it works OK for the
first two binomial GLMMs I tried:

gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
                   data = cbpp, family = binomial)

gm2 <- glmer(use ~ urban+age+livch+(1|district), Contraception, binomial)

* It might be worth removing the 'st$' from  your response variable,

mod<- glmer(cbind(X2.REP.LIVE, X2.REP.DEAD) ~  DOMESTICATION*GLUC + (1|PAIR),

* What are the results of traceback()?  sessionInfo() ?

More information about the R-help mailing list