predict.plsRmultiModel: Predict method for experimental plsRmulti models

View source: R/predict.plsRmultiModel.R

predict.plsRmultiModelR Documentation

Predict method for experimental plsRmulti models

Description

Prediction method for "plsRmultiModel" objects.

Usage

## S3 method for class 'plsRmultiModel'
predict(
  object,
  newdata,
  comps = object$computed_nt,
  type = c("response", "scores"),
  verbose = TRUE,
  ...
)

Arguments

object

An object of class "plsRmultiModel".

newdata

Optional predictor matrix or data frame. For formula-fitted models, a data frame with the predictor variables used at fit time.

comps

Number of extracted components to use.

type

Either "response" or "scores".

verbose

Should informational messages be displayed?

...

Not used.

Value

If type = "response", a matrix of predicted responses. If type = "scores", a matrix of latent score coordinates.

See Also

plsRmulti

Examples

set.seed(123)
X <- matrix(rnorm(40 * 3), ncol = 3)
Y <- cbind(
  y1 = X[, 1] + rnorm(40, sd = 0.1),
  y2 = X[, 2] - X[, 3] + rnorm(40, sd = 0.1)
)
fit <- plsRmulti(Y, X, nt = 2, verbose = FALSE)

predict(fit, type = "response")
predict(fit, type = "scores")

plsRglm documentation built on June 17, 2026, 5:06 p.m.