# NOT RUN {
##modified example from ?glmer
# }
# NOT RUN {
if(require(lme4)){
##create proportion of incidence
cbpp$prop <- cbpp$incidence/cbpp$size
gm1 <- glmer(prop ~ period + (1 | herd), family = binomial,
weights = size, data = cbpp)
fam.link.mer(gm1)
gm2 <- glmer(prop ~ period + (1 | herd),
family = binomial(link = "cloglog"), weights = size,
data = cbpp)
fam.link.mer(gm2)
}
# }
# NOT RUN {
##example with linear mixed model with Orthodont data from
##Pinheiro and Bates (2000)
# }
# NOT RUN {
data(Orthodont, package = "nlme")
m1 <- lmer(distance ~ Sex + (1 | Subject), data = Orthodont,
REML = FALSE)
fam.link.mer(m1)
m2 <- glmer(distance ~ Sex + (1 | Subject),
family = gaussian(link = "log"), data = Orthodont,
REML = FALSE)
fam.link.mer(m2)
detach(package:lme4)
# }
Run the code above in your browser using DataLab