| predict.clmstan | R Documentation |
Generates predictions from a fitted cumulative link model.
## S3 method for class 'clmstan'
predict(
object,
newdata = NULL,
type = c("class", "probs"),
summary = TRUE,
robust = FALSE,
probs = c(0.025, 0.975),
ndraws = NULL,
...
)
object |
A |
newdata |
Optional data frame for prediction. If |
type |
Type of prediction:
|
summary |
Logical. If |
robust |
Logical. If |
probs |
Numeric vector of probabilities for quantiles.
Default is |
ndraws |
Number of posterior draws to use. If |
... |
Additional arguments (currently ignored). |
Depending on type and summary:
type = "class", summary = TRUE: A data frame with columns
Estimate (mean/median predicted class), Est.Error (SD),
quantile columns, and Class (modal predicted category).
type = "class", summary = FALSE: An S x N integer matrix
of predicted categories (1 to K), where S is the number of
posterior draws and N is the number of observations.
type = "probs", summary = TRUE: A data frame with columns
for each category probability (P[Y=1], P[Y=2], etc.).
type = "probs", summary = FALSE: An S x N x K array of
predicted probabilities.
fitted.clmstan() for expected probabilities,
posterior_predict.clmstan() for posterior predictive samples.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.