Whereas a Procrustes ANOVA will tell the user the
extent to which a variable X can be predicted by one or more variables
Y-n, pairwise comparisons allow the user to quantify the statistical
difference among different groupings of variables. To do this, we can
use the RRPP function pairwise. This function allows the
user to perform pairwise comparisons of group means of a linear model
fit generated from a Procrustes ANOVA.
Note that RRPP is a companion package which houses the underlying statistical permutational analytics for geomorph’s statistical procedures. It is installed and loaded simultaneously with geomorph.
pairwise()
procD.lmFor the purposes of this example, generating a model fit using the
procD.lm function will be taken as-read. If you are not
familiar with the procD.lm function please see the ANOVA/Regression tutorial before proceeding here.
In addition to generating the fit, we will be adding material to our
original geomorph data frame. Using the base R function
interaction, we can create a factor with levels
representing each pairwise permutation of our independent variables. In
this case of this example, these are the “species,” (Jord, Teyah) and
“site,” (Allo, Symp) variables.
fit <- procD.lm(lmks ~ spec * site,
data = data, iter = 999, turbo = TRUE,
RRPP = TRUE, print.progress = FALSE)
data$Group <- interaction(data$site, data$spec)
After this preparation, we are ready to run the pairwise analysis:
pairs <- pairwise(fit, groups = data$Group)
Like the procD.lm function, results of the
pairwise function can be summarized like this:
summary(pairs)
##
## Pairwise comparisons
##
## Groups: Allo.Jord Symp.Jord Allo.Teyah Symp.Teyah
##
## RRPP: 1000 permutations
##
## LS means:
## Vectors hidden (use show.vectors = TRUE to view)
##
## Pairwise distances between means, plus statistics
## d UCL (95%) Z Pr > d
## Allo.Jord:Symp.Jord 0.09566672 0.09226464 2.2305051 0.015
## Allo.Jord:Allo.Teyah 0.02432519 0.07774489 -3.1495859 1.000
## Allo.Jord:Symp.Teyah 0.10136696 0.11812556 -0.1921641 0.568
## Symp.Jord:Allo.Teyah 0.09193082 0.10897149 -0.3111746 0.628
## Symp.Jord:Symp.Teyah 0.10694324 0.07639056 3.9866153 0.001
## Allo.Teyah:Symp.Teyah 0.09949800 0.09314049 2.6760941 0.003
Finally, the function generates an object of class “pairwise,” which is a list containing the following:
pairwise Output
Important Note! To see usage of this function incorporated with a full workflow, please see the Group Comparisons tutorial.