# NOT RUN {
require(graphics)
data(spider)
abund <- mvabund(spider$abund)
X <- as.matrix(spider$x)
## Plot the diagnostics for a log-linear model assuming counts are poisson:
spidPois <- manyany(abund ~ X, "glm", family=poisson())
plot(spidPois,pch=19,cex=0.2)
## Fan-shape means trouble for our Poisson assumption.
## Try a negative binomial instead...
require(MASS) # this package is needed for its negative binomial family function
spidNB <- manyany(abund ~ X, "manyglm", family="negative.binomial")
plot(spidNB,pch=19,cex=0.2,xlim=c(-15,6))
## That's looking a lot better...
# }
Run the code above in your browser using DataLab