Skip to contents

Compares posterior predictive replicated statistics with fitted expected proportions or scores computed from posterior mean parameters. DPMirt does not currently store the original response matrix in dpmirt_fit, so this is a fitted-proportion check rather than a direct observed-data PPC. Requires ggplot2.

Usage

dpmirt_plot_pp_check(
  fit,
  stat = c("prop_correct", "total_score"),
  n_rep = 50,
  ...
)

Arguments

fit

A dpmirt_fit object from dpmirt.

stat

Character. Summary statistic for comparison: "prop_correct" (default) or "total_score".

n_rep

Integer. Number of replicated datasets. Default 50.

...

Currently unused.

Value

A ggplot object.

Examples

if (FALSE) { # \dontrun{
sim <- dpmirt_simulate(200, 20, model = "rasch", seed = 42)
fit <- dpmirt(sim$response, model = "rasch", prior = "normal",
              niter = 5000, nburnin = 1000, seed = 123)
dpmirt_plot_pp_check(fit)
} # }