Created
March 19, 2012 13:29
-
-
Save sckott/2112141 to your computer and use it in GitHub Desktop.
playing with mvabund
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### 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