spls(X, Y, ncomp = 2, mode = c("regression", "canonical"),
max.iter = 500, tol = 1e-06, keepX = c(rep(ncol(X), ncomp)),
keepY = c(rep(ncol(Y), ncomp)), scaleY = TRUE)
NA
s are allowed.NA
s are allowed.X
."regression"
or "canonical"
. See Details.ncomp
, the number of variables
to keep in $X$-loadings. By default all variables are kept in the model.ncomp
, the number of variables
to keep in $Y$-loadings. By default all variables are kept in the model.FALSE
.spls
returns an object of class "spls"
, a list
that contains the following components:predict
.X
and
Y
variates.spls
function fit sPLS models with $1, \ldots ,$ncomp
components.
Multi-response models are fully supported. The X
and Y
datasets
can contain missing values.
The type of algorithm to use is specified with the mode
argument. Two sPLS
algorithms are available: sPLS regression ("regression")
and sPLS canonical analysis
("canonical")
(see References).
The number of components to fit is specified with the argument ncomp
.
It this is not supplied, the rank of X
is used. The rank is compute by
using the mat.rank
function.pls
, summary
, mat.rank
,
plotIndiv
, plotVar
.data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic
toxicity.spls <- spls(X, Y, ncomp = 3, keepX = c(50, 50, 50),
keepY = c(10, 10, 10))
Run the code above in your browser using DataLab