pls2B | R Documentation |
Performs a Two-Block PLS on two sets of data and assesses the significance of each score by permutation testing
pls2B(
x,
y,
tol = 1e-12,
same.config = FALSE,
rounds = 0,
useCor = FALSE,
cv = FALSE,
cvlv = NULL,
mc.cores = parallel::detectCores(),
...
)
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 |
rounds |
rounds of permutation testing. |
useCor |
if TRUE, the correlation matrix instead of the covariance matrix is used. |
cv |
logical: if TRUE, a leave-one-out cross-validation is performed |
cvlv |
integer: number of latent variables to test |
mc.cores |
integer: determines how many cores to use for the |
... |
arguments passed to |
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.
svd |
singular value decomposition (see |
Xscores |
PLS-scores of x |
Yscores |
PLS-scores of y |
CoVar |
Dataframe containing singular values, explained covariation, correlation coeffictient between PLS-scores and p-values for singular values obtained from permutation testing |
xlm |
linear model: |
ylm |
linear model: |
predicted.x |
array containing matrices of cross-validated predictions for |
predicted.y |
array containing matrices of cross-validated predictions for |
rv |
RV-coefficient |
p.value.RV |
p-value for RV-coefficient determined by permutation testing |
Stefan Schlager
Rohlf FJ, Corti M. 2000. Use of two-block partial least-squares to study covariation in shape. Systematic Biology 49:740-753.
plsCoVar, getPLSfromScores, predictPLSfromScores, getPLSscores, predictPLSfromData,svd , plsCoVarCommonShape, getPLSCommonShape
if (require(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
## Not run: #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)
## End(Not run)
pls1 <- pls2B(proc$rotated[1:4,,],proc$rotated[5:8,,],
same.config=FALSE,rounds=50,mc.cores=1)
pls1
layout(matrix(1:4,2,2,byrow=TRUE))
for(i in 1:4)
plot(pls1$Xscores[,i]~pls1$Yscores[,i])
## predict first 4 landmarks from second 4 for first config
layout(1)
predPLS <- predictPLSfromData(pls1,y=proc$rotated[5:8,,1])
## show differences between prediction and original
deformGrid2d(predPLS,proc$rotated[1:4,,1],pch=19)
##plot the complete first config
points(proc$rotated[,,1])
##show effects of first latent variable
plsEffects <- plsCoVar(pls1,i=1)
deformGrid2d(plsEffects$x[,,1],plsEffects$x[,,2])##show on x
deformGrid2d(plsEffects$y[,,1],plsEffects$y[,,2],add=TRUE,pch=19)##show on y
##show effects of 2nd latent variable
plsEffects2 <- plsCoVar(pls1,i=2)
deformGrid2d(plsEffects2$x[,,1],plsEffects2$x[,,2])##show on x
deformGrid2d(plsEffects2$y[,,1],plsEffects2$y[,,2],add=TRUE,pch=19)##show on y
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.