predict.lplsReg: Function for lpls prediction.

Description Usage Arguments Value Author(s) Examples

Description

The function predicts new responses based on a fitted lpls-model and a set of new predictor data.

Usage

1
2
3
## S3 method for class '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.

Author(s)

Solve Sæbø

Examples

1
2
3
4
data(BCdata)
fit  <- lplsReg(BCdata$Y, BCdata$X, BCdata$Z, npc = 10)
pred <- predict(fit, 5, X2new = BCdata$X[1:10,])
pred$pred

therimalaya/lplsReg documentation built on May 14, 2019, 8:36 a.m.