counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
d.AD <- data.frame(treatment, outcome, counts)
glm.D93 <- glm(counts ~ outcome + treatment, family = poisson())
Сохранить объект модели
saveRDS(glm.D93, file="glm.rds")
rm(glm.D93)
Получить объект модели
glm.D93 <- readRDS("glm.rds")
anova(glm.D93)
# Analysis of Deviance Table
# Model: poisson, link: log
# Response: counts
# Terms added sequentially (first to last)
# Df Deviance Resid. Df Resid. Dev
# NULL 8 10.5814
# outcome 2 5.4523 6 5.1291
# treatment 2 0.0000 4 5.1291