count <- c(53,414,11,37,0,16,4,139) V <- factor(rep(c("w","b"),c(4,4))) D <- factor(rep(c("w","w","b","b"),2)) P <- factor(rep(c("y","n"),4)) P <- relevel(P,"n") death.DV.DP.PV <- glm(count ~ D*V + D*P + P*V, family=poisson()) summary(death.DV.DP.PV) fits <- fitted(death.DV.DP.PV) round(cbind(count,fits),2) # Fitting the simpler model for part (c) death.DV.PV <- glm(count ~ D*V + P*V, family=poisson()) summary(death.DV.PV) resids <- residuals(death.DV.PV,type="pearson") h <- lm.influence(death.DV.PV)$hat adjresids <- resids/sqrt(1-h) round(cbind(count,fits,adjresids),2)