| plot_marginal_fit | R Documentation |
Plot strict marginal-fit follow-up cells using base R
plot_marginal_fit(
x,
diagnostics = NULL,
plot_type = c("std_residual", "prop_diff"),
top_n = 20,
facet = NULL,
main = NULL,
palette = NULL,
label_angle = 45,
preset = c("standard", "publication", "compact", "monochrome"),
draw = TRUE
)
x |
Output from |
diagnostics |
Optional output from |
plot_type |
|
top_n |
Maximum cells shown. |
facet |
Optional facet name used to keep only matching facet-level rows.
When |
main |
Optional custom plot title. |
palette |
Optional named color overrides. Recognized names:
|
label_angle |
X-axis label angle. |
preset |
Visual preset ( |
draw |
If |
This helper visualizes the largest first-order strict marginal-fit cells from
diagnose_mfrm(..., diagnostic_mode = "both") or
diagnostic_mode = "marginal_fit".
The "std_residual" view ranks cells by the absolute standardized residual
from posterior-integrated expected category counts. The "prop_diff" view
ranks the same cells by the signed observed-minus-expected proportion gap.
Use this plot after summary(diagnostics) indicates strict marginal flags.
The display is exploratory: it highlights which facet/category cells deserve
follow-up, but it is not a standalone inferential test.
A plotting-data object of class mfrm_plot_data.
Positive bars mean the observed category usage exceeded the posterior- expected marginal usage for that cell.
Negative bars mean the observed usage fell below the posterior-expected marginal usage.
Red bars indicate the current strict marginal warning rule was triggered by
|StdResidual| >= abs_z_warn.
Fit with fit_mfrm() using method = "MML" for RSM / PCM.
Run diagnose_mfrm() with diagnostic_mode = "both".
Use plot_marginal_fit() to inspect the largest strict marginal cells.
Follow up with rating_scale_table() or substantive design review.
For a plot-selection guide and a longer walkthrough, see
mfrmr_visual_diagnostics and
vignette("mfrmr-visual-diagnostics", package = "mfrmr").
diagnose_mfrm(), rating_scale_table(), plot_marginal_pairwise(),
mfrmr_visual_diagnostics
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_fit(diag, draw = FALSE, preset = "publication")
p$data$preset
if (interactive()) {
plot_marginal_fit(
diag,
plot_type = "prop_diff",
draw = TRUE,
preset = "publication"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.