# NOT RUN {
data(beall.webworms)
dat <- beall.webworms
# Match Beall table 1
with(dat, table(y,trt))
# histogram(~y|trt, data=dat, layout=c(1,4), as.table=TRUE)
# Visualize Beall tble 6. Block effects may exist, but barely.
desplot(y ~ col*row, data=dat, out1=block, out2=trt, num=trt, flip=TRUE,
main="beall.webworms (count of worms)",
col.regions=colorRampPalette(c("white","black"))(9))
# Following plot suggests interaction is needed
# with(dat, interaction.plot(spray, lead, y))
# Just a simple model here...
m1 <- glm(y ~ block+spray*lead, data=dat, family="poisson")
summary(m1)
# }
Run the code above in your browser using DataLab