Plot strict pairwise local-dependence follow-up using base R
Source:R/api-plotting.R
plot_marginal_pairwise.RdPlot strict pairwise local-dependence follow-up using base R
Arguments
- x
Output from
fit_mfrm()ordiagnose_mfrm().- diagnostics
Optional output from
diagnose_mfrm()whenxismfrm_fit.- metric
"exact"or"adjacent".- top_n
Maximum level pairs shown.
- facet
Optional facet name used to keep only matching pairwise rows.
- main
Optional custom plot title.
- palette
Optional named color overrides. Recognized names:
ok,flag.- label_angle
X-axis label angle.
- preset
Visual preset (
"standard","publication","compact", or"monochrome").- draw
If
TRUE, draw with base graphics.
Details
This helper visualizes the strict pairwise local-dependence follow-up derived from posterior-integrated expected exact and adjacent agreement.
The "exact" view ranks level pairs by the absolute exact-agreement
standardized residual. The "adjacent" view uses the adjacent-agreement
standardized residual instead. Both are exploratory corroboration screens for
strict marginal-fit flags.
Interpreting output
Positive bars mean the observed agreement exceeded the posterior-expected agreement for that level pair.
Negative bars mean the observed agreement fell below the posterior-expected agreement.
Red bars indicate the pair exceeded the current strict-warning threshold.
Typical workflow
Fit with
fit_mfrm()usingmethod = "MML"forRSM/PCM.Run
diagnose_mfrm()withdiagnostic_mode = "both".Use
plot_marginal_pairwise()to inspect level pairs behind pairwise local-dependence flags.Corroborate with legacy diagnostics, design review, and substantive interpretation before making claims.
Further guidance
For a plot-selection guide and a longer walkthrough, see
mfrmr_visual_diagnostics and
vignette("mfrmr-visual-diagnostics", package = "mfrmr").
Examples
if (FALSE) { # \dontrun{
toy <- load_mfrmr_data("example_core")
fit <- fit_mfrm(
toy,
"Person",
c("Rater", "Criterion"),
"Score",
method = "MML",
quad_points = 7,
maxit = 30
)
diag <- diagnose_mfrm(fit, residual_pca = "none", diagnostic_mode = "both")
p <- plot_marginal_pairwise(diag, draw = FALSE, preset = "publication")
p$data$preset
if (interactive()) {
plot_marginal_pairwise(
diag,
metric = "adjacent",
draw = TRUE,
preset = "publication"
)
}
} # }