Learn R Programming

BiodiversityR (version 1.5)

CAPdiscrim: Canonical Analysis of Principal Coordinates based on Discriminant Analysis

Description

This function provides a method for CAP as described by the authors of the ordination method. The CAP method implemented in vegan through capscale conforms more to distance-based Redundancy Analysis (Legendre & Anderson, 1999) than to the original description for CAP (Anderson & Willis, 2003 ).

Usage

CAPdiscrim(formula,data,dist="bray",axes=4,m=0,permutations=0)

Arguments

formula
Formula with a community data frame (with sites as rows, species as columns and species abundance as cell values) or distance matrix on the left-hand side and a categorical variable on the right-hand side (only the first explanatory variable will be used)
data
Environmental data set.
dist
Method for calculating ecological distance with function vegdist: partial match to "manhattan", "euclidean", "canberra", "bray", "kulczynski", "jaccard", "gower", "morisita", "horn" or "mountford". Thi
axes
Number of PCoA axes (cmdscale) to provide in the result.
m
Number of PCoA axes to be investigated by discriminant analysis (lda). If m=0 then the number of axes that provides the best distinction between the groups is calculated (following the method of Anderson an
permutations
The number of permutations for significance testing.

Value

  • The function returns an object with information on CAP based on discriminant analysis. The object contains following elements:
  • PCoAthe positions of the sites as fitted by PCoA
  • mthe number of axes analysed by discriminant analysis
  • totthe total variance (sum of all eigenvalues of PCoA)
  • varmthe variance of the m axes that were investigated
  • groupthe original group of the sites
  • CVthe predicted group for the sites by discriminant analysis
  • percentthe percentage of correct predictions
  • xthe positions of the sites provided by the discriminant analysis
  • Fthe squares of the singulare values of the discriminant analysis
  • manovathe results for MANOVA with the same grouping variable
  • signithe significance of the percentage of correct predictions
  • manovaa summary of the observed randomised prediction percentages
  • The object can be plotted with ordiplot, and species scores can be added by add.spec.scores .

Details

This function provides a method of Constrained Analysis of Principal Coordinates (CAP) that conforms to the description of the method by the developers of the method, Anderson and Willis. The method investigates the results of a Principal Coordinates Analysis (function cmdscale) with linear discriminant analysis (lda). Anderson and Willis advocate to use the number of principal coordinate axes that result in the best prediction of group identities of the sites. For permutations > 0, the analysis is repeated by randomising the observations of the environmental data set. The significance is estimated by dividing the number of times the randomisation generated a larger percentage of correct predictions.

References

Legendre, P. & Anderson, M.J. (1999). Distance-based redundancy analysis: testing multispecies responses in multifactorial ecological experiments. Ecological Monographs 69: 1-24. Anderson, M.J. & Willis, T.J. (2003). Canonical analysis of principal coordinates: a useful method of constrained ordination for ecology. Ecology 84: 511-525. Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies. http://www.worldagroforestry.org/resources/databases/tree-diversity-analysis

Examples

Run this code
library(vegan)
library(MASS)
data(dune)
data(dune.env)
Ordination.model1 <- CAPdiscrim(dune~Management, data=dune.env,
    dist="bray",axes=2,m=0)
Ordination.model1
plot1 <- ordiplot(Ordination.model1)
ordisymbol(plot1,dune.env,"Management",legend=FALSE)
## CLICK IN THE GRAPH TO INDICATE THE POSITION FOR THE LEGEND
## IN CASE THAT THE OPTION WAS LEGEND=TRUE.

Run the code above in your browser using DataLab