Learn R Programming

bestglm (version 0.37.3)

predict.pcreg: Predict Method for Pcreg.

Description

Prediction for models fit using pcreg().

Usage

# S3 method for pcreg
predict(object, newdata, ...)

Arguments

object

the S3 class object produced as output from the function pcreg()

newdata

dataframe with new data and with same column names as used in the original argument to pcreg.

additional arguments

Value

the predicted values

Details

The prediction method, predict.mvr(), which is available in the pls package is used. We take advantage of this since it avoids fussing with scaling issues since it is automatically handled for us by predict.mvr()

See Also

predict.pcreg, summary.pcreg, plot.pcreg, fitted.pcreg, residuals.pcreg

Examples

Run this code
# NOT RUN {
XyList <- trainTestPartition(mcdonald)
XyTr <- XyList$XyTr
XyTe <- XyList$XyTe
ans <- pcreg(XyTr, scale=TRUE)
predict(ans, newdata=XyTe)
# }

Run the code above in your browser using DataLab