Introduction

When one is performing integration research on sets of traits in different samples, it is often of interest to determine whether those integration values are significantly different from one another. The function compare.pls allows one to statistically compare effect sizes of two or more PLS analyses; in particular, one might wish to compare integration between two or more samples, each measuring integration between different modules. This analysis calculates effect sizes as standard deviates, z, and performs two-sample z-tests, using the pooled standard error from the sampling distributions of the PLS analyses (Adams & Collyer, 2016).

The input for this function must be of class “pls,” that is, an object resulting from the functions two.b.pls, integration.test, or phylo.integration. Any number of objects can be input.

compare.pls()
  • \(...\): saved analyses of class pls
  • \(two.tailed\): A logical value to indicate whether a two-tailed test (typical and default) should be performed.



Example of Analysis

By way of example, we present an analysis of the sexual dimorphism of integration between the head and tail of pupfish. These data are included with geomorph by default, as a single object. The data have been separated by type (head vs. tail) and sex for the purposes of this example. Please see the tutorials on Data Manipulation and R Data Basic for information on how to accomplish this.

Here, the object ‘group,’ refers to the factor used to partition the pupfish data.

levels(group)
## [1] "Marsh.F"    "Marsh.M"    "Sinkhole.F" "Sinkhole.M"



Now, we run our PLS analyses using the map function. This allows use to run the function on each of the partitioned sets of coordinates.

integ.tests <- Map(function(x,y) integration.test(x, y, iter=499, 
                                                  print.progress = FALSE), head.coords.gp, tail.coords.gp)

This returns a list object containing the results of our four integration tests. Remember that objects within a list can be accessed using the $ operator.

Finally, we perform the statistical comparison of our results.

group.Z <- compare.pls(integ.tests)
summary(group.Z)
## 
## Effect sizes
## 
##    Marsh.F    Marsh.M Sinkhole.F Sinkhole.M 
##  3.1410345  1.5130737  0.7429882  2.7156556 
## 
## Effect sizes for pairwise differences in PLS effect size
## 
##              Marsh.F   Marsh.M Sinkhole.F Sinkhole.M
## Marsh.F    0.0000000 0.6586628  1.9027247  0.7518767
## Marsh.M    0.6586628 0.0000000  0.8778808  1.1927859
## Sinkhole.F 1.9027247 0.8778808  0.0000000  2.0927712
## Sinkhole.M 0.7518767 1.1927859  2.0927712  0.0000000
## 
## P-values
## 
##               Marsh.F   Marsh.M Sinkhole.F Sinkhole.M
## Marsh.F    1.00000000 0.5101123 0.05707647 0.45212519
## Marsh.M    0.51011230 1.0000000 0.38000838 0.23295324
## Sinkhole.F 0.05707647 0.3800084 1.00000000 0.03636958
## Sinkhole.M 0.45212519 0.2329532 0.03636958 1.00000000

Summarizing these results, returns two tables of pairwise z-tests and p-values, as well as the effect sizes for each of the integration analyses.

This function returns an object of class “compare.pls”, which is a list containing the following:

compare.pls output
  • \(sample.z\): A vector of effect sizes for each sample.
  • \(sample.r.sd\): A vector of standard deviations for each sampling distribution (following Box-Cox transformation).
  • \(pairwise.z\): A matrix of pairwise, two-sample z scores between all pairs of effect sizes.
  • \(pairwise.p\): A matrix of corresponding P-values.