Principal Coordinate Analysis using R programming

Principal Coordinate Analysis (PCoA) is a method to represent on a 2 or 3 dimensional chart objects described by a square matrix containing resemblance indices between these objects.

This method is due to Gower (1966). It is sometimes called metric MDS (MDS: Mutidimensional scaling) as opposed to the MDS (or non-metric MDS). Both methods have the same objective and produce similar results if the similarity matrix of square distances are metric and if the dimensionality is sufficient.

PCoA works roughly like this, see following example:

  • you start with a distance matrix D
  • you transform D into A using  A = (-1⁄2)*D².
  • you scale matrix a resulting in Matrix Delta, so that delta[j,i]=A[j,i]−mean(j)−mean(i)+mean(A)
  • mean(j) is rowMean.
  • mean(i) is column mean.
  • You calculate eigenvectors and eigenvalues of Delta (results in n eigenvectors with n being the number of samples)
  • The Eigenvectors are scaled using their corresponding eigenvalues.
  • $NewVector <- Eigenvector*sqrt(Eigenvalue)
  • When the scaled eigenvectors are written as columns, the rows of the resulting table are the coordinates of the objects in PCoA space.
  • In other words the columns given by for example cmdscale are the eigenvectors.

Here is the R code

If a PCoA axis has a negative eigenvalue associated with it, imaginary numbers are generated during the analysis and prevent Euclidean representation. Such eigenvalues may arise when using certain (dis)similarity measures that are either semi- or non-metric or those that exhibit other forms of non-Euclideanarity.

To correct for these, transformations of the original data are needed which aim at making small dissimilarities larger relative to large dissimilarities. Taking the square root of dissimilarities or adding a constant to all dissimilarities sufficient to remove negative eigenvalues are viable options (Legendre and Legendre 1998).
Objects that have variable values that introduce large amounts of variation to the overall data set may strongly influence the ordination, making patterns of other objects less visible. It may be instructive to examine a PCoA solution that excludes such objects.

The values of the objects along a PCoA axis of interest may be correlated (using an appropriate measure) with those of environmental variables to assess association. However, PCoA is a form of indirect gradient analysis; therefore, other methods, such as distance-based redundancy analysis (db-RDA)[will explain in next tutorial], are likely to offer more utility in assessing the influence of environmental variables.

You might also like More from author