Skip to contents

Writes the summary, estimates, diagnostic tables, person measures, and model-specific results as CSV. Plots are written as PNG and, optionally, PDF, together with a plain-text analysis summary. For MFRM and EFRM fits, item estimates and response-cell diagnostics are saved separately. Computed tailored item shifts and externally weighted secondary person measures can be retained with the fitted-model output; the latter include their resolved weights. For keyed fits with repeated person IDs, the export records why distractor analysis is unavailable and retains the other model outputs.

Usage

save_outputs(
  fit,
  dir,
  formats = c("png", "pdf"),
  width = 9,
  height = 6,
  dpi = 300,
  item_plots = TRUE,
  dif = NULL,
  bootstrap = NULL,
  dif_bootstrap = NULL,
  dimensionality = NULL,
  invariance = NULL,
  subtest = NULL,
  tailored = NULL,
  person_weights = NULL
)

Arguments

fit

A fitted object from rasch.

dir

Output directory; created if absent. An existing directory must be empty; exports refuse to overwrite files from an earlier analysis.

formats

Plot formats, any of "png" and "pdf".

width, height

Plot size in inches.

dpi

PNG resolution.

item_plots

Also write the per-item plot set (one ICC, category curve, threshold curve, and frequency chart per item).

dif

Optional dif_anova result to export as computed — an application analysis carries the DIF model the analyst chose, which a default recomputation would silently replace. NULL computes the default when the fit carries person factors.

bootstrap

Optional fit_bootstrap result from this fit. Its item and person tables, or pair, object and judge tables for paired comparisons, join the export with the whole-test readings.

dif_bootstrap

Optional dif_bootstrap sensitivity analysis from this fit and DIF specification.

dimensionality

Optional computed plot_scree or btl_dimensionality result from this fit. Supplying it keeps the exported table and figure identical to the analysis already run.

invariance

Optional computed frame_invariance result from an EFRM fit.

subtest

Optional computed dimensionality_test result from this fit. Supplying it keeps the nominated item split and bootstrap calibration used in the analysis.

tailored

Optional computed tailored_analysis result from this ordinary dichotomous fit.

person_weights

Optional table returned by weighted_person_estimates. An explicit table takes precedence over a compatible result retained by the application.

Value

Invisibly, the vector of files written.

Examples

set.seed(1)
d <- seq(-1.5, 1.5, length.out = 4)
X <- matrix(rbinom(80 * 4, 1, plogis(outer(rnorm(80), d, "-"))), 80, 4)
colnames(X) <- paste0("I", 1:4)
out <- tempfile("rasch-out-")
save_outputs(rasch(X), out, formats = "png", item_plots = FALSE, dpi = 96)