Hi


2013/9/16 ChenChun <talischen@hotmail.com>

> 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 instancegld(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?
>



fit1 <- lmer(alive ~ treatment + (1 | expID), family = binomial, data =
Data, REML = TRUE)

fit0 <- lmer(alive ~ treatment, family = binomial, data = Data, REML = TRUE)

anova(fit0, fit1)

This should work. The anova performs a Likelihood ratio test under 1df.

Julia



> Thanks
> Regards,
> tiantian
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]

