predict.glmpathcr | R Documentation |
Returns either the predicted class or the fitted probabilities from the penalized continuation ratio model from a glmpathcr
object.
## 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", ...)
object |
a |
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 |
type |
used for selecting desired output, either the default |
... |
additional optional arguments |
Either a vector of the predicted class labels or a matrix containing the fitted probabilities is returned.
Kellie J. Archer, archer.43@osu.edu
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 as glmpathcr
, coef.glmpathcr
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.