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")
Run the code above in your browser using DataLab