predict {integrOmics}R Documentation

Predict Method for PLS Regression and Sparse PLS

Description

Predicted values based on PLS regression or sparse PLS models. New responses and variates are predicted using a fitted model and a new matrix of observations.

Usage

## S3 method for class 'pls':
predict(object, newdata, ...)

## S3 method for class 'spls':
predict(object, newdata, ...)

Arguments

object object of class inheriting from "pls" or "spls".
newdata data matrix in which to look for for explanatory variables to be used for prediction.
... not used currently.

Details

predict produces predicted values, obtained by evaluating the PLS model returned by pls or spls in the frame newdata. Variates for newdata are also returned.

Value

predict produces a list with the following components:

predict a three dimensional array of predicted response values. The dimensions correspond to the observations, the response variables and the model dimension, respectively.
variates matrix of predicted variates.
B.hat matrix of regression coefficients (without the intercept).

Author(s)

Sébastien Déjean, Ignacio González and Kim-Anh Lê Cao

References

Tenenhaus, M. (1998). La régression PLS: théorie et pratique. Paris: Editions Technic.

See Also

pls, spls.

Examples

data(linnerud)
X <- linnerud$exercise
Y <- linnerud$physiological
linn.pls <- pls(X, Y, ncomp = 2, mode = "classic")

indiv1 <- c(200, 40, 60)
indiv2 <- c(190, 45, 45)
newdata <- rbind(indiv1, indiv2)
colnames(newdata) <- colnames(X)
newdata

pred <- predict(linn.pls, newdata)

plotIndiv(linn.pls, 1, 2, rep.space = "X-variate")
points(pred$variates[, 1], pred$variates[, 2], pch = 19, cex = 1.2)
text(pred$variates[, 1], pred$variates[, 2], 
     c("new ind.1", "new ind.2"), pos = 3)

[Package integrOmics version 2.5 Index]