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)NAs are allowed.NAs 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.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 estimation of the missing values can be performed
by the reconstitution of the data matrix using the nipals function. Otherwise, missing
values are handled by casewise deletion in the spls function without having to
delete the rows with missing data.pls, summary,
plotIndiv, plotVar,
plot3dIndiv, plot3dVar,
cim, network.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