View source: R/predict.plsRmultiModel.R
| predict.plsRmultiModel | R Documentation |
Prediction method for "plsRmultiModel" objects.
## S3 method for class 'plsRmultiModel'
predict(
object,
newdata,
comps = object$computed_nt,
type = c("response", "scores"),
verbose = TRUE,
...
)
object |
An object of class |
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 |
verbose |
Should informational messages be displayed? |
... |
Not used. |
If type = "response", a matrix of predicted responses. If
type = "scores", a matrix of latent score coordinates.
plsRmulti
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.