View source: R/api-plotting-anchor-qc.R
| plot_anchor_drift | R Documentation |
Creates base-R plots for inspecting anchor drift across calibration waves or visualising the cumulative offset in a screened linking chain.
plot_anchor_drift(
x,
type = c("drift", "chain", "heatmap"),
facet = NULL,
preset = c("standard", "publication", "compact"),
draw = TRUE,
...
)
x |
An |
type |
Plot type: |
facet |
Optional character vector to filter drift plots to specific facets. |
preset |
Visual preset ( |
draw |
If |
... |
Additional graphical parameters passed to base plotting functions. |
Three plot types are supported:
"drift" (for mfrm_anchor_drift objects): A dot plot of each
element's drift value, grouped by facet. Horizontal reference lines
mark the drift threshold. Red points indicate flagged elements.
"heatmap" (for mfrm_anchor_drift objects): A wave-by-element
heat matrix showing drift magnitude. Darker cells represent larger
absolute drift. Useful for spotting systematic patterns (e.g., all
criteria shifting in the same direction).
"chain" (for mfrm_equating_chain objects): A line plot of
cumulative offsets across the screened linking chain. A flatter line
indicates smaller between-wave shifts; steep segments suggest larger
link offsets that deserve review.
A plotting-data object of class mfrm_plot_data. With
draw = FALSE, result$data$table contains the filtered drift or chain
table, result$data$matrix contains the heatmap matrix when requested,
and the payload includes package-native title, subtitle, legend,
and reference_lines.
Use type = "drift" with an mfrm_anchor_drift object to review flagged
elements directly.
Use type = "heatmap" with an mfrm_anchor_drift object to spot
wave-by-element patterns.
Use type = "chain" with an mfrm_equating_chain object after
build_equating_chain() to inspect cumulative offsets across waves.
Drift is the change in an element's estimated measure between calibration waves, after accounting for the screened common-element link offset. An element is flagged when its absolute drift exceeds a threshold (typically 0.5 logits) and the drift-to-SE ratio exceeds a secondary criterion (typically 2.0), ensuring that only practically noticeable and relatively precise shifts are flagged.
In drift and heatmap plots, red or dark-shaded elements exceed both thresholds. Common causes include rater drift over time, item exposure effects, or curriculum changes.
In chain plots, uneven spacing between waves suggests differential
shifts in the screened linking offsets. The y-axis shows cumulative
logit-scale offsets; flatter segments indicate more stable adjacent links.
Steep segments should be checked alongside LinkSupportAdequate and the
retained common-element counts before making longitudinal claims.
For drift objects, it is usually best to read summary(x) first
and then use the plot to see where the flagged values sit.
Build a drift or screened-linking object with detect_anchor_drift() or
build_equating_chain().
Start with draw = FALSE if you want the plotting data for custom
reporting.
Use the base-R plot for quick screening and then inspect the underlying tables for exact values.
For a plot-selection guide and a longer walkthrough, see
mfrmr_visual_diagnostics and
vignette("mfrmr-visual-diagnostics", package = "mfrmr").
detect_anchor_drift(), build_equating_chain(),
plot_dif_heatmap(), plot_bubble(), mfrmr_visual_diagnostics
toy <- load_mfrmr_data("example_core")
people <- unique(toy$Person)
d1 <- toy[toy$Person %in% people[1:12], , drop = FALSE]
d2 <- toy[toy$Person %in% people[13:24], , drop = FALSE]
fit1 <- fit_mfrm(d1, "Person", c("Rater", "Criterion"), "Score",
method = "JML", maxit = 10)
fit2 <- fit_mfrm(d2, "Person", c("Rater", "Criterion"), "Score",
method = "JML", maxit = 10)
drift <- detect_anchor_drift(list(W1 = fit1, W2 = fit2))
drift_plot <- plot_anchor_drift(drift, type = "drift", draw = FALSE)
class(drift_plot)
names(drift_plot$data)
chain <- build_equating_chain(list(F1 = fit1, F2 = fit2))
chain_plot <- plot_anchor_drift(chain, type = "chain", draw = FALSE)
head(chain_plot$data$table)
if (interactive()) {
plot_anchor_drift(drift, type = "heatmap", preset = "publication")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.