Plot a DPMirt fit object
plot.dpmirt_fit.RdProduces visualizations for fitted IRT models. Supports 12 plot types with automatic selection between base R and ggplot2 backends.
Arguments
- x
A
dpmirt_fitobject.- type
Character. Plot type. One of:
"density"Kernel density of posterior mean theta.
"items"Item difficulty estimates with error bars.
"trace"Log-likelihood MCMC trace.
"clusters"Cluster count trace and histogram (DPM only).
"dp_density"DP mixture density with credible band (DPM only; see
dpmirt_dp_densityfor the transformed-scale caveat)."icc"Item Characteristic Curves.
"wright_map"Person-Item map (Wright map).
"parameter_trace"Individual parameter MCMC traces.
"caterpillar"Sorted estimates with credible intervals.
"density_compare"Posterior density vs reference overlay.
"info"Test Information Function.
"pp_check"Posterior predictive check.
- engine
Character. Plotting backend:
"auto"(default) uses ggplot2 if available,"base"forces base R,"ggplot2"requires ggplot2.- ...
Additional arguments passed to the specific plotting function.
Value
Invisibly returns a ggplot object when the ggplot2 backend is used;
invisibly returns NULL when the base R backend is used.
Details
For type = "dp_density", Rasch/location-shift settings are
the most directly interpretable. For transformed-scale 2PL/3PL IRT and SI
fits, use the plot as a diagnostic summary because full scale/Jacobian
density adjustment is not yet implemented.
See also
dpmirt_plot_density, dpmirt_plot_items,
dpmirt_plot_trace, dpmirt_plot_icc
Other visualization:
dpmirt_plot_caterpillar(),
dpmirt_plot_clusters(),
dpmirt_plot_density(),
dpmirt_plot_density_compare(),
dpmirt_plot_dp_density(),
dpmirt_plot_icc(),
dpmirt_plot_info(),
dpmirt_plot_items(),
dpmirt_plot_parameter_trace(),
dpmirt_plot_pp_check(),
dpmirt_plot_trace(),
dpmirt_plot_wright_map(),
plot.dpmirt_estimates(),
plot.dpmirt_sim()
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)
# Theta density
plot(fit, type = "density")
# Item difficulty estimates
plot(fit, type = "items")
# MCMC trace
plot(fit, type = "trace")
# Force base R backend
plot(fit, type = "density", engine = "base")
} # }