Learn R Programming

asbio (version 0.2-1)

Shep.comp: Shepard plot type comparisons for PCoA

Description

Calculates raw $R^2$, Linear fit $R^2$ and non-metric $R^2$ for PCoA ordinations.

Usage

Shep.comp(dis, max.dim = 10)

Arguments

dis
A dissimilarity matrix. Any index from get.dist can be used.
max.dim
The maximum number of cmdscale dimensions for which correlations should be calculated.

Value

  • Returns a matrix with three columns containing $R^2$ for raw, linear, and non-metric $R^2$'s. } references{ Oksanen, J. (2008) emph{Multivariate analysis of ecological communities in R: vegan tutorial}. url{http://cc.oulu.fi/~jarioksa/opetus/metodi/vegantutor.pdf} } author{Ken Aho} seealso{code{get.dist}, code{cmdscale}} examples{ data(varespec) d<-get.dist(varespec,"steinhaus") Shep.comp(d,max.dim=10)} keyword{multivariate}

Details

The function Shep.comp in asbio creates calculates three sorts correlations coefficients across all specified PCoA dimensionalities. 1) Pearson's correlations of observed distances (in the distance matrix) and fitted distances (in a PCoA ordination); i.e. "raw fits." 2) Pearson's correlations between the monotonic fitted line and the observed distances "linear fits". 3) A correlation based on stress and calculated as 1 - $S^2$ (Oksanen 2008), where: $$S = \sqrt{\frac{\sum_{i \neq j}{\hat{d}_{ij}-d_{ij}^2}}{\sum_{i \neq j}{d_{ij}}^2,}}$$

where $\hat{d}_{ij}$ is the distance between rank order of distance between point i and j in the final configuration (i.e. the fitted monotonic stressplot line), and $d_{ij}$ is the distance between point i and j in the original distance matrix. The first type of correlation "raw fits" should probably not be used since the relationship between community dissimilarity and a configuration may be strong while being non-linear. The second correlation should be linear even if the relationship between observed dissimilarity and dissimilarities in the final configuration are non-linear, and is often referred to as the linear fit (Oksanen 2008). The final type of correlation has been called "non-metric" fit (Oksanen 2008).