predict.ordinalbayes {ordinalbayes} | R Documentation |
Predicted Probabilities and Class for an Ordinal Bayes Fit.
Description
Predicted Probabilities and Class for an Ordinal Bayes Fit.
Usage
## S3 method for class 'ordinalbayes'
predict(
object,
neww = NULL,
newdata,
newx = NULL,
model.select = "average",
...
)
Arguments
object |
an |
neww |
an optional formula that includes the unpenalized variables to use for predicting the response. If omitted, the training data are used. |
newdata |
an optional data.frame that minimally includes the unpenalized variables to use for predicting the response. If omitted, the training data are used. |
newx |
an optional matrix of penalized variables to use for predicting the response. If omitted, the training data are used. |
model.select |
when |
... |
other arguments. |
Value
predicted |
a matrix of predicted probabilities from the fitted model. |
class |
a vector containing the predicted class taken as that class having the largest predicted probability. |
See Also
ordinalbayes
, coef.ordinalbayes
, summary.ordinalbayes
, print.ordinalbayes
Examples
data("cesc")
fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45],,
model="regressvi", gamma.ind="fixed", pi.fixed=0.99,
adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000,
thinSteps=2, seed=26)
phat<-predict(fit)
table(phat$class, cesc$Stage)