Performs a constraint sPLS on the first PLS-components and a sPLS on the last components
spls.hybrid(X,
Y,
ncomp = 2,
mode = c("regression", "canonical", "invariant", "classic"),
max.iter = 500,
tol = 1e-06,
keepX.constraint,
keepY.constraint,
keepX,
keepY,
near.zero.var = FALSE)
numeric matrix of predictors. NA
s are allowed.
numeric vector or matrix of responses (for multi-response models).
NA
s are allowed.
the number of components to include in the model (see Details). Default is 2.
character string. What type of algorithm to use.
one of "regression"
, "canonical"
, "invariant"
or "classic"
. See Details.
integer, the maximum number of iterations.
a positive real, the tolerance used in the iterative algorithm.
A list containing which variables of X are to be kept on each of the first PLS-components.
A list containing which variables of Y are to be kept on each of the first PLS-components.
number of \(X\) variables kept in the model on the last components.
number of \(Y\) variables kept in the model on the last components.
boolean, see the internal nearZeroVar
function (should be set to TRUE in particular for data with many zero values). Setting this argument to FALSE (when appropriate) will speed up the computations.
A 'spls.hybrid' object is returned. The object is a list that contains the following components:
the centered and standardized original predictor matrix.
the centered and standardized original response vector or matrix.
the number of components included in the model.
the algorithm used to fit the model.
A list of length ncomp
containing which variables of X are to be kept on each component.
A list of length ncomp
containing which variables of Y are to be kept on each component.
matrix of coefficients to be used internally by predict
.
list containing the variates.
list containing the estimated loadings for the \(X\) and \(Y\) variates.
list containing the names to be used for individuals and variables.
list containing the zero- or near-zero predictors information, for X
and Y
.
A list of means.X, sigma.X, means.Y and sigma.Y. Means and variances for the variables of X
and the columns of Y.mat
.
The spls.hybrid
function allows you to compute a constraint spls on the first components and a spls on the last components. Note that the only condition on keepX.constraint
and keepX
is that the sum of both length is ncomp; likewise for the ones relative to Y.
Rohart et al. (2016). A Molecular Classification of Human Mesenchymal Stromal Cells. PeerJ, DOI 10.7717/peerj.1845
# NOT RUN {
data(MSC)
X=MSC$X
Y=MSC$Y
Y.mat=unmap(Y)
n=nrow(X)
p=ncol(X)
keepX.constraint=list(sample(1:p,7),sample(1:p,15))
fit=spls.hybrid(X,Y=Y.mat,ncomp=4,keepX.constraint=keepX.constraint,keepX=c(5,10))
plotIndiv(fit,ind.names=FALSE)
# }
Run the code above in your browser using DataLab