View source: R/predict.mvdareg.R
| predict.mvdareg | R Documentation |
predict provides predictions from the results of a pls model.
## S3 method for class 'mvdareg'
predict(object, newdata, ncomp = object$ncomp,
na.action = na.pass, ...)
object |
A |
newdata |
An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used. |
ncomp |
the number of components to include in the model (see below). |
na.action |
function determining what should be done with missing values in newdata. The default is to predict |
... |
additional arguments. Currently ignored. |
predict.mvdareg produces predicted values, obtained by evaluating the regression function in the frame newdata (which defaults to model.frame(object). If newdata is omitted the predictions are based on the data used for the fit.
If comps is missing (or is NULL), predictions of the number of latent variables is provided. Otherwise, if comps is given parameters for a model with only the requested components is returned. The generic function residuals return the model residuals for all the components specified for the model. If the model was fitted with na.action = na.exclude (or after setting the default na.action to na.exclude with options), the residuals corresponding to excluded observations are returned as NA; otherwise, they are omitted.
predict.mvdareg produces a vector of predictions or a matrix of predictions
Nelson Lee Afanador (nelson.afanador@mvdalab.com)
NOTE: This function is adapted from mvr in package pls with extensive modifications by Nelson Lee Afanador.
coef, coefficients.boots, coefficients,
loadings, loadings.boots, weights,
weight.boots
data(Penta)
mod1 <- plsFit(log.RAI ~., scale = TRUE, data = Penta[, -1],
ncomp = 2, validation = "loo")
predict.mvdareg(mod1)
## Not run:
residuals(mod1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.