plot.irt_results: Plot IRT Simulation Results

View source: R/plot_irt_results.R

plot.irt_resultsR Documentation

Plot IRT Simulation Results

Description

Visualize performance criteria across sample sizes from an irt_simulate() result. Calls summary.irt_results() internally, then plots the requested criterion by sample size.

Usage

## S3 method for class 'irt_results'
plot(x, criterion = "rmse", param = NULL, item = NULL, threshold = NULL, ...)

Arguments

x

An irt_results object from irt_simulate().

criterion

Character string. Which criterion to plot. Default "rmse". Valid values: "bias", "empirical_se", "mse", "rmse", "coverage", "mcse_bias", "mcse_mse".

param

Optional character vector. Filter to specific parameter types (e.g., "a", "b", "b1").

item

Optional integer vector. Filter to specific item numbers.

threshold

Optional numeric. If provided, draws a horizontal reference line at this value.

...

Additional arguments passed to summary.irt_results().

Value

A ggplot2::ggplot object, returned invisibly.

See Also

summary.irt_results() for the underlying criteria, recommended_n() for sample-size recommendations.

Examples


design <- irt_design(
  model = "1PL", n_items = 5,
  item_params = list(b = seq(-2, 2, length.out = 5))
)
study <- irt_study(design, sample_sizes = c(200, 500))
results <- irt_simulate(study, iterations = 10, seed = 42)
plot(results)
plot(results, criterion = "bias", threshold = 0.05, param = "b")



irtsim documentation built on April 24, 2026, 1:07 a.m.