mvabund-package {mvabund} | R Documentation |
This package provides tools for a model-based approach to the analysis of multivariate abundance data in ecology. This includes graphical methods for exploring the properties of data and the community-environment association, flexible regression methods for estimating and making robust inferences about the community-environment association, and diagnostic plots to chekc the appropriateness of a fitted model.
Future versions of this function will extend it to regression analysis using additive functions, and model-based cluster analysis.
The key functions available in this package are the following.
For graphical display of the data:
plot.mvabund
boxplot.mvabund
meanvar.plot
plotMvaFactor
For estimating and displaying Linear Models:
manylm
summary.manylm
anova.manylm
plot.manylm
For providing a data structure:
mvabund
mvformula
Example datasets:
solberg
spider
tikus
For more details, see the documentation for any of the individual functions listed above.
David Warton David.Warton@unsw.edu.au, Ulrike Naumann and Yi Wang.
Lawless, J. F. (1987) Negative binomial and mixed Poisson regression, Canadian Journal of Statistics 15, 209-225.
Liang, K.-Y. and Zeger, S. L (1986) Longitudinal Data Analysis Using Generalized Linear Models, Biometrika 73, No. 1, 13-22.
Warton D.I. (2008). Raw data graphing: an informative but under-utilized tool for the analysis of multivariate abundances. Austral Ecology 33(3), 290-300.
Warton D.I. (2008). Penalized normal likelihood and ridge regularization of correlation and covariance matrices. Journal of the American Statistical Association 103, 340-349.
Warton D.I. & Hudson H.M. (2004). A MANOVA statistic is just as powerful as distance-based statistics, for multivariate abundances. Ecology 85(3), 858-874.
Warton, D. I. and Guttorp, P. (2007) Compositional analysis of overdispersed counts using generalized estimating equations, Technical report. http://www.maths.unsw.edu.au/statistics/files/preprint-2007-02.pdf
mvabund
, mvformula
,
plot.mvabund
, boxplot.mvabund
, meanvar.plot
, plotMvaFactor
,
manylm
, summary.manylm
, anova.manylm
, plot.manylm
,
require(graphics) ## Load the spider dataset: data(spider) ## Create the mvabund object spiddat: spiddat <- mvabund(spider$abund) X <- spider$x ## Draw a plot of the spider data: plot(spiddat, col="gray1", n.vars=8, transformation="sqrt", xlab=c("Hunting Spider"), ylab="Spider Species", scale.lab="s",t.lab="t", shift=TRUE, fg= "lightblue", col.main="red", main="Spiders") ## A mean-variance plot, data organised by year, ## for 1981 and 1983 only, as in Figure 7a of Warton (2008): data(tikus) tikusdat <- mvabund(tikus$abund) year <- tikus$x[,1] is81or83 <- year==81 | year==83 meanvar.plot(tikusdat~year,legend=TRUE, subset=is81or83, col=c(1,10)) ## Create a formula for multivariate abundance data: foo <- mvformula( spiddat~X ) ## Create a List of Univariate Formulas: fooUni <- formulaUnimva(spiddat~X) fooUniInt <- formulaUnimva(spiddat~X, intercept=TRUE) ## Find the three variables that best explain the response: best.r.sq( foo, n.xvars= 3) ## Fit a multivariate linear model: foo <- mvformula( spiddat~X ) lm.spider <- manylm(foo) ## Plot Diagnostics for a multivariate linear model: plot(lm.spider,which=1:2,col.main="red",cex=3,overlay=FALSE) ## Obtain a summary of test statistics using residual resampling: summary(lm.spider, nBoot=500) ## Calculate a ANOVA Table: anova(lm.spider, nBoot=500)