Learn R Programming

mvabund (version 3.9.1)

mvabund-package: Statistical methods for analysing multivariate abundance data

Description

This package provides tools for a model-based approach to the analysis of multivariate abundance data in ecology (Warton (2011)). 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 check the appropriateness of a fitted model (Wang et. al (2012)). Future versions of this function will extend it to regression analysis using additive functions, and model-based cluster analysis.

Arguments

Details

The key functions available in this package are the following. For graphical display of the data: [object Object],[object Object],[object Object],[object Object] For estimating and displaying Linear Models: [object Object],[object Object],[object Object],[object Object] For estimating and displaying Generalized Linear Models: [object Object],[object Object],[object Object],[object Object] For providing a data structure: [object Object],[object Object] Example datasets: [object Object],[object Object],[object Object],[object Object] For more details, see the documentation for any of the individual functions listed above.

References

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. (2008a). Raw data graphing: an informative but under-utilized tool for the analysis of multivariate abundances. Austral Ecology 33(3), 290-300. Warton D.I. (2008b). 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. (in press April 2010). Compositional analysis of overdispersed counts using generalized estimating equations. Environmental and Ecological Statistics. Warton D.I. (2011). Regularized sandwich estimators for analysis of high dimensional data using generalized estimating equations. Biometrics, 67(1), 116-123. Warton D. I., Wright S., and Wang, Y. (2012). Distance-based multivariate analyses confound location and dispersion effects. Methods in Ecology and Evolution, 3(1), 89-101. Wang Y., Neuman U., Wright S. and Warton D. I. (2012). mvabund: an R package for model-based analysis of multivariate abundance data. Methods in Ecology and Evolution. online 21 Feb 2012.

See Also

mvabund, mvformula, plot.mvabund, boxplot.mvabund, meanvar.plot, plotMvaFactor, manylm, summary.manylm, anova.manylm, plot.manylm,

Examples

Run this code
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)

Run the code above in your browser using DataLab