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)

Arguments

object

A fitted lpls-model as returned from lplsReg

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

Value

pred

The predicted response values.

beta0

The estimated intercept in the lpls-regression model

beta1

The estimated vector of regression coefficients for the p predictor variables in X2.

Examples

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