Learn R Programming

MVLM (version 0.0.1)

predict.mvlm: mvlm Model Predictions

Description

predict method for class mvlm. To predict using new data, the predictor data frame passed to newdata must have the same number of columns as the data used to fit the model, and the names of each variable must match the names of the original data.

Usage

"predict"(object, newdata, ...)

Arguments

object
Output from mvlm
newdata
Data frame of observations on the predictors used to fit the model.
...
Further arguments passed to or from other methods.

Value

A data frame of predicted values

Examples

Run this code
data(mvlmdata)
Y.train <- as.matrix(Y.mvlm[1:150,])
X.train <- X.mvlm[1:150,]

mvlm.res <- mvlm(Y.train ~ ., data = X.train)

X.test <- X.mvlm[151:200,]
Y.predict <- predict(mvlm.res, newdata = X.test)

Run the code above in your browser using DataLab