cda.calc {MorphoTools2}R Documentation

Canonical Discriminant Analysis

Description

This function performs canonical discriminant analysis.

Usage

cda.calc(object, passiveSamples = NULL)

Arguments

object

an object of class morphodata.

passiveSamples

taxa or populations, which will be only predicted, see Details.

Details

The cda.calc function performs canonical discriminant analysis using the candisc method from the candisc package. Canonical discriminant analysis finds linear combination of the quantitative variables that maximize the difference in the mean discriminant score between groups. This function allows exclude subset of samples (passiveSamples) from computing the discriminant function, and only passively predict them in multidimensional space. This approach is advantageous for testing the positions of “atypical” populations (e.g., putative hybrids) or for assessing positions of selected individuals (e.g., type herbarium specimens).

Value

an object of class cdadata with the following elements:

objects
ID IDs of each row of scores object.
Population population membership of each row of scores object.
Taxon taxon membership of each row of scores object.
scores ordination scores of cases (objects, OTUs).
eigenValues

eigenvalues, i.e., proportion of variation of the original dataset expressed by individual axes.

eigenvaluesAsPercent

eigenvalues as percent, percentage of their total sum.

cumulativePercentageOfEigenvalues

cumulative percentage of eigenvalues.

groupMeans

data.frame containing the means for the taxa.

rank

number of non-zero eigenvalues.

coeffs.raw

matrix containing the raw canonical coefficients.

coeffs.std

matrix containing the standardized canonical coefficients.

totalCanonicalStructure

matrix containing the total canonical structure coefficients, i.e., total-sample correlations between the original variables and the canonical variables.

canrsq

squared canonical correlations.

Examples

data(centaurea)
centaurea = naMeanSubst(centaurea)
centaurea = removePopulation(centaurea, populationName = c("LIP", "PREL"))

cdaRes = cda.calc(centaurea)

summary(cdaRes)

plotPoints(cdaRes, col = c("red", "green", "blue", "red"),
  pch = c(20, 17, 8, 21), pt.bg = "orange", legend = TRUE)

[Package MorphoTools2 version 1.0.1.1 Index]