# NOT RUN {
## NOTE: The values below MUST NOT be used in a real application;
## they are only used here to make the examples run quick!!!
example_mcmc_control <- list(n.burnin = 10, n.iteration = 100,
n.thin = 1)
library(mvabund) ## Load a dataset from the mvabund package
data(spider)
y <- spider$abun
spider.fit.p <- boral(y, family = "poisson", lv.control = list(num.lv = 2),
row.eff = "fixed", mcmc.control = example_mcmc_control)
par(mfrow = c(2,2))
plot(spider.fit.p)
## A distinct fan pattern is observed in the plot of residuals
## versus linear predictors plot.
spiderfit_nb <- boral(y, family = "negative.binomial", lv.control = list(num.lv = 2),
row.eff = "fixed", mcmc.control = example_mcmc_control)
par(mfrow = c(2,2))
plot(spiderfit_nb)
## The fan shape is not as clear now,
## and the normal quantile plot also suggests a better fit to the data
# }
Run the code above in your browser using DataLab