predicted_probability | R Documentation |
Compute the predicted probabilities for discrete data, with the possibility of conditional predictive probabilities (i.e., at fixed values of other nodes)
predicted_probability(object, outcome, Y, ...)
object |
An object of class |
outcome |
Character string. Node for which the probabilities are computed. |
Y |
Matrix (or data frame) of dimensions n (observations) by p (variables). This must include the column names. |
... |
Compute conditional probabilities by specifying a column name in |
A list containing a matrix with the computed probabilities (a row for each predictive sample and a column for each category).
There are no checks that the conditional probability exists, i.e., suppose you wish to condition on, say, B3 = 2 and B4 = 1, yet there is no instance in which B3 is 2 AND B4 is 1. This will result in an uninformative error.
Y <- ptsd
fit <- estimate(as.matrix(Y), iter = 150, type = "mixed")
pred <- posterior_predict(fit, iter = 100)
prob <- predicted_probability(pred,
Y = Y,
outcome = "B3",
B4 = 0,
B5 = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.