[R-sig-ME] gls for generalized linear model
Ben Bolker
bbolker at gmail.com
Mon Sep 16 15:35:59 CEST 2013
ChenChun <talischen at ...> writes:
>
[snip]
>
> 2013/9/16 ChenChun <talischen at ...>
>
> Dear R users,
>
> I am fitting a GLMM model on survival:
>
> fit1 <- lmer(alive ~ treatment + (1 | expID),
> family = binomial, data = Data, REML = TRUE)
>
> I would like to test whether the random effect is significant.
> Normally for a linear model, I could test it
> against a model without random effect using gls, for instance
> gld(response ~ variable, data=...,
> method="REML"). However, it seems that gls does
> not support the generalized
> linear model (family =
> binomial). May I ask how I can test the random effect in this case?
As I recall, in the current CRAN version of lme4 (<1.0), the deviances
from glmer() are not commensurate with glm(), but in the new version (>=1.0)
they are, so you could compare the deviances of
fit1 <- glmer(alive ~ treatment + (1|expID), family=binomial, data=Data)
and
fit0 <- glm(alive ~treatment, family=binomial)
(at the moment there is no automatic anova() method that can handle
this, although this could be added).
One comment and one question:
* REML does nothing in glmer()
* are you sure it makes sense to test the statistical significance of
the random effect?
More information about the R-sig-mixed-models
mailing list