PLSDA | R Documentation |
This function estimates latent dimensions from the explanatory matrix
X
. The latent dimensions are maximally associated with the outcome
matrix Y
. It is a built-in function of PLSDA_batch
.
PLSDA(X, Y, ncomp, keepX = rep(ncol(X), ncomp), tol = 1e-06, max.iter = 500)
X |
A numeric matrix that is centered and scaled as an explanatory
matrix. |
Y |
A dummy matrix that is centered and scaled as an outcome matrix. |
ncomp |
Integer, the number of dimensions to include in the model. |
keepX |
A numeric vector of length |
tol |
Numeric, convergence stopping value. |
max.iter |
Integer, the maximum number of iterations. |
PLSDA
returns a list that contains the following components:
original_data |
The original explanatory matrix |
defl_data |
The centered and scaled deflated matrices ( |
latent_comp |
The latent components calculated with estimated latent dimensions. |
loadings |
The estimated latent dimensions. |
iters |
Number of iterations of the algorthm for each component. |
exp_var |
The amount of data variance explained per component (note
that contrary to |
Yiwen Wang, Kim-Anh LĂȘ Cao
barker2003partialPLSDAbatch
# A built-in function of PLSDA_batch, not separately used.
# Not run
data('AD_data')
library(mixOmics)
library(TreeSummarizedExperiment)
X <- assays(AD_data$EgData)$Clr_value
Y.trt <- rowData(AD_data$EgData)$Y.trt
names(Y.trt) <- rownames(AD_data$EgData)
X.scale <- scale(X, center = TRUE, scale = TRUE)
# convert Y.trt to be a dummy matrix
Y.trt.mat <- unmap(as.numeric(Y.trt))
Y.trt.scale <- scale(Y.trt.mat, center = TRUE, scale = TRUE)
ad_plsda.trt <- PLSDA(X.scale, Y.trt.scale, ncomp = 1)
# the latent components associated with Y.trt:
X.compnt <- ad_plsda.trt$latent_comp$t
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.