Skip to content

Instantly share code, notes, and snippets.

@sckott
Created March 19, 2012 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sckott/2112141 to your computer and use it in GitHub Desktop.
Save sckott/2112141 to your computer and use it in GitHub Desktop.
playing with mvabund
#### mvabund play
# install mvabund from CRAN pkg repository
install.packages("mvabund")
require(mvabund)
# plot abundance by copepod species
data(Tasmania)
attach(Tasmania)
tasmvabund <- mvabund(Tasmania$copepods)
plot(tasmvabund ~ treatment, col = as.numeric(block))
# fit negative binomial model for each species and plot residuals vs. fitted
tas.nb <- manyglm(copepods ~ block*treatment, family="negative.binomial")
plot(tas.nb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment