| dif_interaction_table | R Documentation |
Produces a cell-level interaction table showing Obs-Exp differences, standardized residuals, and screening statistics for each facet-level x group-value cell.
dif_interaction_table(
fit,
diagnostics,
facet,
group,
data = NULL,
min_obs = 10,
p_adjust = "holm",
abs_t_warn = 2,
abs_bias_warn = 0.5
)
fit |
Output from |
diagnostics |
Output from |
facet |
Character scalar naming the facet. |
group |
Character scalar naming the grouping column. |
data |
Optional data frame with the group column. If |
min_obs |
Minimum observations per cell. Cells with fewer than
this many observations are flagged as sparse and their test
statistics set to |
p_adjust |
P-value adjustment method, passed to
|
abs_t_warn |
Threshold for flagging cells by absolute t-value.
Default |
abs_bias_warn |
Threshold for flagging cells by absolute
Obs-Exp average (in logits). Default |
This function uses the fitted model's observation-level residuals
(from the internal compute_obs_table() function) rather than
re-estimating the model. For each facet-level x group-value cell,
it computes:
N: number of observations in the cell
ObsScore: sum of observed scores
ExpScore: sum of expected scores
ObsExpAvg: mean observed-minus-expected difference
Var_sum: sum of model variances
StdResidual: (ObsScore - ExpScore) / sqrt(Var_sum)
t: approximate t-statistic (equal to StdResidual)
df: N - 1
p_value: two-tailed p-value from the t-distribution
Object of class mfrm_dif_interaction with:
table: tibble with per-cell statistics and flags.
summary: tibble summarizing flagged and sparse cell counts.
config: list of analysis parameters.
Use dif_interaction_table() when you want cell-level screening for a
single facet-by-group table. Use analyze_dff() when you want group-pair
contrasts summarized into differential-functioning effect sizes and
method-appropriate classifications.
For plot selection and follow-up diagnostics, see mfrmr_visual_diagnostics.
$table: the full interaction table with one row per cell.
$summary: overview counts of flagged and sparse cells.
$config: analysis configuration parameters.
Cells with |t| > abs_t_warn or |ObsExpAvg| > abs_bias_warn
are flagged in the flag_t and flag_bias columns.
Sparse cells (N < min_obs) have sparse = TRUE and NA statistics.
Fit a model with fit_mfrm().
Run dif_interaction_table(fit, diag, facet = "Rater", group = "Gender", data = df).
Inspect $table for flagged cells.
Visualize with plot_dif_heatmap().
analyze_dff(), analyze_dif(), plot_dif_heatmap(), dif_report(),
estimate_bias()
toy <- load_mfrmr_data("example_bias")
fit <- fit_mfrm(toy, "Person", c("Rater", "Criterion"), "Score",
method = "JML", model = "RSM", maxit = 25)
diag <- diagnose_mfrm(fit, residual_pca = "none")
int <- dif_interaction_table(fit, diag, facet = "Rater",
group = "Group", data = toy, min_obs = 2)
int$summary
head(int$table[, c("Level", "GroupValue", "ObsExpAvg", "flag_bias")])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.