| unexpected_response_table | R Documentation |
Build an unexpected-response screening report
unexpected_response_table(
fit,
diagnostics = NULL,
abs_z_min = 2,
prob_max = 0.3,
top_n = 100,
rule = c("either", "both")
)
fit |
Output from |
diagnostics |
Optional output from |
abs_z_min |
Absolute standardized-residual cutoff. |
prob_max |
Maximum observed-category probability cutoff. |
top_n |
Maximum number of rows to return. |
rule |
Flagging rule: |
A response is flagged as unexpected when:
rule = "either": |StdResidual| >= abs_z_min OR ObsProb <= prob_max
rule = "both": both conditions must be met.
The table includes row-level observed/expected values, residuals, observed-category probability, most-likely category, and a composite severity score for sorting.
A named list with:
table: flagged response rows
summary: one-row overview
thresholds: applied thresholds
summary: prevalence of unexpected responses under current thresholds.
table: ranked row-level diagnostics for case review.
thresholds: active cutoffs and flagging rule.
Compare results across rule = "either" and rule = "both" to assess how
conservative your screening should be.
Start with rule = "either" for broad screening.
Re-run with rule = "both" for strict subset.
Inspect top rows and visualize with plot_unexpected().
For a plot-selection guide and a longer walkthrough, see
mfrmr_visual_diagnostics and
vignette("mfrmr-visual-diagnostics", package = "mfrmr").
The table data.frame contains:
Original row index in the prepared data.
Person identifier (plus one column per facet).
Observed score category.
Observed and model-expected score values.
Raw and standardized residuals.
Probability of the observed category under the model.
Most probable category and its probability.
Composite severity index (higher = more unexpected).
"Higher than expected" or "Lower than expected".
Logical flags for each criterion.
The summary data.frame contains:
Total observations analyzed.
Count and share of flagged rows.
Applied cutoff values.
"either" or "both".
diagnose_mfrm(), displacement_table(), fair_average_table(),
mfrmr_visual_diagnostics
toy_full <- load_mfrmr_data("example_core")
toy_people <- unique(toy_full$Person)[1:12]
toy <- toy_full[toy_full$Person %in% toy_people, , drop = FALSE]
fit <- suppressWarnings(
fit_mfrm(toy, "Person", c("Rater", "Criterion"), "Score", method = "JML", maxit = 10)
)
t4 <- unexpected_response_table(fit, abs_z_min = 1.5, prob_max = 0.4, top_n = 5)
summary(t4)
p_t4 <- plot(t4, draw = FALSE)
class(p_t4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.