The function predicts new responses based on a fitted lpls-model and a set of new predictor data.
# S3 method for lplsReg predict(object, ncomp = object$npc, X2new = NULL, silent = FALSE)
object | A fitted lpls-model as returned from |
---|---|
ncomp | The number of components to be used for prediction. |
X2new | A matrix of size (l x p) holding the predictor values of X2 for l new observations. |
silent | Suppress warning about components being large |
The predicted response values.
The estimated intercept in the lpls-regression model
The estimated vector of regression coefficients for the p predictor variables in X2.
data(BCdata) fit <- lplsReg(BCdata$Y, BCdata$X, BCdata$Z, npc = 10) pred <- predict(fit, 5, X2new = BCdata$X[1:10,]) pred$pred#> [,1] #> subject1 0.91710318 #> subject2 0.05601145 #> subject3 0.13350678 #> subject4 1.11558597 #> subject5 -0.13307560 #> subject6 0.84977600 #> subject7 0.26534603 #> subject8 0.63407511 #> subject9 0.34236238 #> subject10 1.21297985