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 ordinalBayes fitted object.

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 "average" (default) is used, the mean coefficient values over the MCMC chain are used to estimate fitted probabilities; when "median" is used, the median coefficient values over the MCMC chain are used to estimate fitted probabilities; when "max.predicted.class" is used, each step in the chain is used to calculate fitted probabilities and the class. The predicted class is that attaining the maximum fitted probability.

...

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)


[Package ordinalbayes version 0.1.1 Index]