id_post_pred,idealstan-method | R Documentation |
idealstan
objectsThis function will draw from the posterior distribution, whether in terms of the outcome (prediction) or to produce the log-likelihood values.
This function can also produce either distribution of the
outcomes (i.e., predictions) or the log-likelihood values of the posterior (set option
type
to 'log_lik'
.
For more information, see the package vignette How to Evaluate Models.
You can then use functions such as
id_plot_ppc()
to see how well the model does returning the correct number of categories
in the score/vote matrix.
Also see help("posterior_predict", package = "rstanarm")
## S4 method for signature 'idealstan'
id_post_pred(
object,
newdata = NULL,
draws = 100,
output = "observed",
type = "predict",
covar = "person",
sample_scores = NULL,
item_subset = NULL,
pred_outcome = NULL,
use_cores = 1,
use_chain = NULL,
...
)
object |
A fitted |
newdata |
Optional: pass a data frame that must have all of the predictors that were given to the id_make function. Used to generate predictions from person or item covariates on to items. |
draws |
The number of draws to use from the total number of posterior draws (default is 100). Set to "all" to use all draws in the chains. For reproducibility, you can also pass a vector of specific draws to use. |
output |
If the model has an unbounded outcome (Poisson, continuous, etc.), then
specify whether to show the |
type |
Whether to produce posterior predictive values ( |
covar |
What kind of covariates to include as part of the prediction – either "person" (the default) or "items" if you included predictors for item discriminations. |
sample_scores |
In addition to reducing the number of posterior draws used to calculate the posterior predictive distribution, which will reduce computational overhead. Only available for calculating predictive distributions, not log-likelihood values. |
item_subset |
Whether to calculate marginal effects for only a subset of
items. Should be item IDs that match the |
pred_outcome |
In the case of ordinal responses, the number of the category to predict. Defaults to top category. |
use_cores |
Number of cores to use for multicore parallel processing with
the base R |
use_chain |
ID of MCMC chain to use rather than all chains (the default). |
... |
Any other arguments passed on to posterior_predict (currently none available) |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.