predict.glmpathcr: Predicted Class and Fitted Probabilities from glmpathcr...

predict.glmpathcrR Documentation

Predicted Class and Fitted Probabilities from glmpathcr Object

Description

Returns either the predicted class or the fitted probabilities from the penalized continuation ratio model from a glmpathcr object.

Usage

## S3 method for class 'glmpathcr'
predict(object, newx = NULL, which = "BIC", type = "class", ...)
## S3 method for class 'glmpathcr'
fitted(object, newx = NULL, which = "BIC", type = "class", ...)

Arguments

object

a glmpathcr object

newx

a data matrix containing the predictor variables, if NULL, the original training data is used for getting model predictions

which

used for model selection, either the default which="BIC" or which="AIC"

type

used for selecting desired output, either the default type="class" or type="probes" for the fitted probabilities

...

additional optional arguments

Value

Either a vector of the predicted class labels or a matrix containing the fitted probabilities is returned.

Author(s)

Kellie J. Archer, archer.43@osu.edu

References

Archer K.J., Williams A.A.A. (2012) L1 penalized continuation ratio models for ordinal response prediction using high-dimensional datasets. Statistics in Medicine, 31(14), 1464-74.

See Also

See also as glmpathcr, coef.glmpathcr.

Examples

data(diabetes)
x <- diabetes[, 2:dim(diabetes)[2]]
y <- diabetes$y
fit <- glmpathcr(x, y)
pred <- predict(fit)
table(pred, y)
pred <- predict(fit, which="AIC", type="probs")

glmpathcr documentation built on July 9, 2023, 6:57 p.m.