data(fungi)
# Binomial fit
model1 <- glm(cbind(y, m-y) ~ lconc*species,
family=binomial, data=fungi)
anova(model1, test="Chisq")
sum(resid(model1, ty="pearson")^2)
1 - pchisq(sum(resid(model1, ty="pearson")^2), 20)
hnp(model1)
# Quasi-binomial fit
model2 <- glm(cbind(y, m-y) ~ lconc*species,
family=quasibinomial, data=fungi)
anova(model2, test="F")
hnp(model2)
if (FALSE) {
# Logistic-normal fit
require(lme4)
fungi$ind <- factor(1:nrow(fungi))
model3 <- glmer(cbind(y, m-y) ~ lconc*species + (1|ind),
family=binomial, data=fungi)
summary(model3)
hnp(model3)
}
## for discussion on the analysis of this data set,
## see Demetrio et al. (2014)
Run the code above in your browser using DataLab