predict.mvdareg: Model Predictions From a plsFit Model

View source: R/predict.mvdareg.R

predict.mvdaregR Documentation

Model Predictions From a plsFit Model

Description

predict provides predictions from the results of a pls model.

Usage

## S3 method for class 'mvdareg'
predict(object, newdata, ncomp = object$ncomp,
            na.action = na.pass, ...)

Arguments

object

A plsFit model.

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 NA.

...

additional arguments. Currently ignored.

Details

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.

Value

predict.mvdareg produces a vector of predictions or a matrix of predictions

Author(s)

Nelson Lee Afanador (nelson.afanador@mvdalab.com)

References

NOTE: This function is adapted from mvr in package pls with extensive modifications by Nelson Lee Afanador.

See Also

coef, coefficients.boots, coefficients, loadings, loadings.boots, weights, weight.boots

Examples

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)

mvdalab documentation built on Oct. 6, 2022, 1:05 a.m.