| plot_displacement | R Documentation |
Plot displacement diagnostics using base R
plot_displacement(
x,
diagnostics = NULL,
anchored_only = FALSE,
facets = NULL,
plot_type = c("lollipop", "hist"),
top_n = 40,
preset = c("standard", "publication", "compact"),
draw = TRUE,
...
)
x |
Output from |
diagnostics |
Optional output from |
anchored_only |
Keep only anchored/group-anchored levels. |
facets |
Optional subset of facets. |
plot_type |
|
top_n |
Maximum levels shown in |
preset |
Visual preset ( |
draw |
If |
... |
Additional arguments passed to |
Displacement quantifies how much a single element's calibration would shift the overall model if it were allowed to move freely. It is computed as:
\mathrm{Displacement}_j = \frac{\sum_i (X_{ij} - E_{ij})}
{\sum_i \mathrm{Var}_{ij}}
where the sums run over all observations involving element j.
The standard error is 1 / \sqrt{\sum_i \mathrm{Var}_{ij}}, and
a t-statistic t = \mathrm{Displacement} / \mathrm{SE} flags
elements whose observed residual pattern is inconsistent with the
current anchor structure.
Displacement is most informative after anchoring: large values suggest that anchored values may be drifting from the current sample. For non-anchored analyses, displacement reflects residual calibration tension.
A plotting-data object of class mfrm_plot_data.
"lollipop" (default)Dot-and-line chart of displacement values.
X-axis: displacement (logits). Y-axis: element labels. Points
colored red when flagged (default: |\mathrm{Disp.}| > 0.5
logits). Dashed lines at \pm threshold. Ordered by
absolute displacement.
"hist"Histogram of displacement values with Freedman-Diaconis
breaks. Dashed reference lines at \pm threshold. Use for
inspecting the overall distribution shape.
Lollipop: top absolute displacement levels; flagged points indicate larger movement from anchor expectations.
Histogram: overall displacement distribution and threshold lines. A symmetric distribution centred near zero indicates good anchor stability; heavy tails or skew suggest systematic drift.
Use anchored_only = TRUE when your main question is anchor robustness.
Run with plot_type = "lollipop" and anchored_only = TRUE.
Inspect distribution with plot_type = "hist".
Drill into flagged rows via displacement_table().
For a plot-selection guide and a longer walkthrough, see
mfrmr_visual_diagnostics and
vignette("mfrmr-visual-diagnostics", package = "mfrmr").
displacement_table(), plot_unexpected(), plot_fair_average(),
plot_qc_dashboard(), mfrmr_visual_diagnostics
toy <- load_mfrmr_data("example_core")
fit <- fit_mfrm(toy, "Person", c("Rater", "Criterion"), "Score", method = "JML", maxit = 25)
p <- plot_displacement(fit, anchored_only = FALSE, draw = FALSE)
if (interactive()) {
plot_displacement(
fit,
anchored_only = FALSE,
plot_type = "lollipop",
preset = "publication"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.