Learn R Programming

Morpho (version 2.1)

pls2B: Two-Block partial least square regression.

Description

Performs a Two-Block PLS on two sets of data and assesses the significance of each score by permutation testing

Usage

pls2B(x, y, tol = 1e-12, same.config = FALSE, rounds = 0,
  mc.cores = parallel::detectCores())

Arguments

x
array containing superimposed landmark data second block.Matrices are also allowed but the option 'same.config' will not work.
y
array containing superimposed landmark data of the first block. Matrices are also allowed but the option 'same.config' will not work.
tol
threshold for discarding singular values.
same.config
logical: if TRUE each permutation includes new superimposition of permuted landmarks. This is necessary if both blocks originate from landmarks that are superimposed together.
rounds
rounds of permutation testing.
mc.cores
integer: determines how many cores to use for the computation. The default is autodetect. But in case, it doesn't work as expected cores can be set manually. Parallel processing is disabled on Windows due to occasional errors.

Value

  • svdsingular value decomposition (see svd) of the 'common' covariance block
  • XscoresPLS-scores of x
  • YscoresPLS-scores of y
  • CoVarDataframe containing singular values, explained covariation, correlation coeffictient between PLS-scores and p-values

Details

The Two-Block PLS tries to find those linear combinations in each block maximising the covariance between blocks. The significance of each linear combination is assessed by comparing the singular value to those obtained from permuted blocks. If both blocks contain landmarks superimposed TOGETHER, the option same.config=TRUE requests superimposition of the permuted configurations (i.e. where the the landmarks of block x are replaced by corresponding landmarks of other specimen.

References

Rohlf FJ, Corti M. 2000. Use of two-block partial least-squares to study covariation in shape. Systematic Biology 49:740-753.

See Also

svd

Examples

Run this code
library(shapes)
### very arbitrary test:
### check if first 4 landmarks covaries with the second 4
proc <- procSym(gorf.dat)
## we do only 50 rounds to minimize computation time
#same.config takes too long for CRAN check
pls1 <- pls2B(proc$rotated[1:4,,],proc$rotated[5:8,,],
              same.config=TRUE,rounds=50,mc.cores=2)
pls1 <- pls2B(proc$rotated[1:4,,],proc$rotated[5:8,,],
              same.config=FALSE,rounds=50,mc.cores=1)
pls1$CoVar
layout(matrix(1:4,2,2,byrow=TRUE))
for(i in 1:4)
 plot(pls1$Xscores[,i]~pls1$Yscores[,i])

Run the code above in your browser using DataLab