| bias_count_table | R Documentation |
Build a bias-cell count report
bias_count_table(
bias_results,
min_count_warn = 10,
branch = c("original", "facets"),
fit = NULL
)
bias_results |
Output from |
min_count_warn |
Minimum count threshold for flagging sparse bias cells. |
branch |
Output branch:
|
fit |
Optional |
This helper summarizes how many observations contribute to each bias-cell estimate and flags sparse cells.
Branch behavior:
"facets": keeps legacy manual-aligned column labels (Sq,
Observd Count, Obs-Exp Average, Model S.E.) for side-by-side
comparison with external workflows.
"original": keeps compact field names (Count, BiasSize, SE) for
custom QC workflows and scripting.
A named list with:
table: cell-level counts with low-count flags
by_facet: named list of counts aggregated by each interaction facet
by_facet_a, by_facet_b: first two facet summaries (legacy compatibility)
summary: one-row summary
thresholds: applied thresholds
branch, style: output branch metadata
fit_overview: optional one-row fit metadata when fit is supplied
table: cell-level contribution counts and low-count flags.
by_facet: sparse-cell structure by each interaction facet.
summary: overall low-count prevalence.
fit_overview: optional run context (when fit is supplied).
Low-count cells should be interpreted cautiously because bias-size estimates can become unstable with sparse support.
Estimate bias with estimate_bias().
Build bias_count_table(...) in desired branch.
Review low-count flags before interpreting bias magnitudes.
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, in the legacy-compatible branch:
Interaction facet level identifiers; placeholder names for the two interaction facets.
Sequential row number.
Number of observations for this cell.
Observed minus expected average for this cell.
Standard error of the bias estimate.
Fit statistics for this cell.
Logical; TRUE when count < min_count_warn.
The summary data.frame contains:
Names of the interaction facets.
Number of cells and total observations.
Number and share of low-count cells.
estimate_bias(), unexpected_after_bias_table(), build_fixed_reports(),
mfrmr_visual_diagnostics
toy <- load_mfrmr_data("example_bias")
fit <- fit_mfrm(toy, "Person", c("Rater", "Criterion"), "Score", method = "JML", maxit = 25)
diag <- diagnose_mfrm(fit, residual_pca = "none")
bias <- estimate_bias(fit, diag, facet_a = "Rater", facet_b = "Criterion", max_iter = 2)
t11 <- bias_count_table(bias)
t11_facets <- bias_count_table(bias, branch = "facets", fit = fit)
summary(t11)
p <- plot(t11, draw = FALSE)
p2 <- plot(t11, type = "lowcount_by_facet", draw = FALSE)
if (interactive()) {
plot(
t11,
type = "cell_counts",
draw = TRUE,
main = "Bias Cell Counts (Customized)",
palette = c(count = "#2b8cbe", low = "#cb181d"),
label_angle = 45
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.