procrustes {vegan} | R Documentation |
Description
Function procrustes
rotates a configuration to maximum similaritywith another configuration. Function protest
tests thenon-randomness (significance) between two configurations.
Usage
procrustes(X, Y, scale = TRUE, symmetric = FALSE, scores = "sites", ...)## S3 method for class 'procrustes'summary(object, digits = getOption("digits"), ...)## S3 method for class 'procrustes'plot(x, kind=1, choices=c(1,2), to.target = TRUE, type = "p", xlab, ylab, main, ar.col = "blue", length=0.05, cex = 0.7, ...)## S3 method for class 'procrustes'points(x, display = c("target", "rotated"), choices = c(1,2), truemean = FALSE, ...)## S3 method for class 'procrustes'text(x, display = c("target", "rotated"), choices = c(1,2), labels, truemean = FALSE, ...)## S3 method for class 'procrustes'lines(x, type = c("segments", "arrows"), choices = c(1, 2), truemean = FALSE, ...)## S3 method for class 'procrustes'residuals(object, ...)## S3 method for class 'procrustes'fitted(object, truemean = TRUE, ...)## S3 method for class 'procrustes'predict(object, newdata, truemean = TRUE, ...)protest(X, Y, scores = "sites", permutations = how(nperm = 999), ...)
Arguments
X | Target matrix |
Y | Matrix to be rotated. |
scale | Allow scaling of axes of |
symmetric | Use symmetric Procrustes statistic (the rotation willstill be non-symmetric). |
scores | Kind of scores used. This is the |
x , object | An object of class |
digits | Number of digits in the output. |
kind | For |
choices | Axes (dimensions) plotted. |
xlab , ylab | Axis labels, if defaults unacceptable. |
main | Plot title, if default unacceptable. |
display | Show only the |
to.target | Draw arrows to point to target. |
type | The type of plot drawn. In |
truemean | Use the original range of target matrix instead ofcentring the fitted values. Function |
newdata | Matrix of coordinates to be rotated and translated tothe target. |
permutations | a list of control values for the permutationsas returned by the function |
ar.col | Arrow colour. |
length | Width of the arrow head. |
labels | Character vector of text labels. Rownames of the result object are used as default. |
cex | Character expansion for points or text. |
... | Other parameters passed to functions. In |
Details
Procrustes rotation rotates a matrix to maximum similarity with atarget matrix minimizing sum of squared differences. Procrustesrotation is typically used in comparison of ordination results. It isparticularly useful in comparing alternative solutions inmultidimensional scaling. If scale=FALSE
, the function onlyrotates matrix Y
. If scale=TRUE
, it scales linearlyconfiguration Y
for maximum similarity. Since Y
is scaledto fit X
, the scaling is non-symmetric. However, withsymmetric=TRUE
, the configurations are scaled to equaldispersions and a symmetric version of the Procrustes statisticis computed.
Instead of matrix, X
and Y
can be results from anordination from which scores
can extract results.Function procrustes
passes extra arguments toscores
, scores.cca
etc. so that you canspecify arguments such as scaling
.
Function plot
plots a procrustes
object and returnsinvisibly an ordiplot
object so that functionidentify.ordiplot
can be used for identifyingpoints. The items in the ordiplot
object are calledheads
and points
with kind=1
(ordinationdiagram) and sites
with kind=2
(residuals). Inordination diagrams, the arrow heads point to the targetconfiguration if to.target = TRUE
, and to rotatedconfiguration if to.target = FALSE
. Target and originalrotated axes are shown as cross hairs in two-dimensional Procrustesanalysis, and with a higher number of dimensions, the rotated axesare projected onto plot with their scaled and centredrange. Function plot
passes parameters to underlying plottingfunctions. For full control of plots, you can draw the axes usingplot
with kind = 0
, and then add items withpoints
or lines
. These functions pass all parametersto the underlying functions so that you can select the plottingcharacters, their size, colours etc., or you can select the width,colour and type of line segments
or arrows, or you canselect the orientation and head width of arrows
.
Function residuals
returns the pointwiseresiduals, and fitted
the fitted values, either centred to zeromean (if truemean=FALSE
) or with the original scale (thesehardly make sense if symmetric = TRUE
). Inaddition, there are summary
and print
methods.
If matrix X
has a lower number of columns than matrixY
, then matrix X
will be filled with zero columns tomatch dimensions. This means that the function can be used to rotatean ordination configuration to an environmental variable (mostpractically extracting the result with the fitted
function). Function predict
can be used to add new rotatedcoordinates to the target. The predict
function will alwaystranslate coordinates to the original non-centred matrix. Thefunction cannot be used with newdata
for symmetric
analysis.
Function protest
performs symmetric Procrustes analysisrepeatedly to estimate the significance of the Procrustesstatistic. Function protest
uses a correlation-like statisticderived from the symmetric Procrustes sum of squares ss
asr =\sqrt{1-ss}
, and also prints the sum ofsquares of the symmetric analysis, sometimes calledm_{12}^2
. Function protest
has ownprint
method, but otherwise uses procrustes
methods. Thus plot
with a protest
object yields aProcrustean superimposition plot.
Value
Function procrustes
returns an object of classprocrustes
with items. Function protest
inherits fromprocrustes
, but amends that with some new items:
Yrot | Rotated matrix |
X | Target matrix. |
ss | Sum of squared differences between |
rotation | Orthogonal rotation matrix. |
translation | Translation of the origin. |
scale | Scaling factor. |
xmean | The centroid of the target. |
symmetric | Type of |
call | Function call. |
t0 | This and the following items are only in class |
t | Procrustes correlations from permutations. The distributionof these correlations can be inspected with |
signif | Significance of |
permutations | Number of permutations. |
control | A list of control values for the permutationsas returned by the function |
control | the list passed to argument |
Note
The function protest
follows Peres-Neto & Jackson (2001),but the implementation is still after Mardia et al.(1979).
Author(s)
Jari Oksanen
References
Mardia, K.V., Kent, J.T. and Bibby,J.M. (1979). Multivariate Analysis. Academic Press.
Peres-Neto, P.R. and Jackson, D.A. (2001). How well do multivariatedata sets match? The advantages of a Procrustean superimpositionapproach over the Mantel test. Oecologia 129: 169-178.
See Also
monoMDS
, for obtainingobjects for procrustes
, and mantel
for analternative to protest
without need of dimension reduction. Seehow
for details on specifying the type ofpermutation required.
Examples
## IGNORE_RDIFF_BEGINdata(varespec)vare.dist <- vegdist(wisconsin(varespec))mds.null <- monoMDS(vare.dist, y = cmdscale(vare.dist))mds.alt <- monoMDS(vare.dist)vare.proc <- procrustes(mds.alt, mds.null)vare.procsummary(vare.proc)plot(vare.proc)plot(vare.proc, kind=2)residuals(vare.proc)## IGNORE_RDIFF_END
[Package vegan version 2.6-6.1 Index]