Learn R Programming

OrdLogReg (version 1.1)

predict.Ord.logreg: Prediction of Response Using Ord.logreg

Description

Computes predicted values for new data for an ordinal logic regression model fitted using Ord.logreg

Usage

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

Arguments

object
An object of class Ord.logreg.
newdata
A matrix or data frame containing new predictor values. If not given, predictions will be made for the original data used to construct the model.
...
Not currently used.

Value

predicted.category
A vector of predicted classes for each observation in the new data.
prediction.matrix
A matrix of indicators of whether or not a tree in the oridnal logic regression model made a positive prediction. The last column in the matrix represents the tree that predicts the highest class, the second to last column represents the tree that preditcts the second highest class, etc. A value of 1 indcates the tree predicted that the observation was of the tree-specific class.

See Also

Ord.logreg

Examples

Run this code
data(OLRmod)

#Prediction on original data used to fit the model
predict(OLRmod)

#prediction on new data
data(OLRtestdata)
predict(OLRmod, newdata=OLRtestdata[,1:50])

Run the code above in your browser using DataLab