library(predictmeans)
Oats$nitro <- factor(Oats$nitro)
(fm <- lmer(yield ~ nitro*Variety+(1|Block/Variety), data=Oats))
R2_glmm(fm)
(gm <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
data = cbpp, family = binomial))
R2_glmm(gm)
Run the code above in your browser using DataLab