View source: R/item_hierarchy.R
| RMitemHierarchy | R Documentation |
Visualises item and threshold locations on the logit scale for a Partial Credit Model. Items are sorted by their (mean-threshold) location; each item shows its location as a black diamond and its individual thresholds as coloured dots with confidence-interval error bars.
RMitemHierarchy(
data,
show_numbers = TRUE,
sem_multiplier = 1.405,
item_labels = NULL,
output = c("ggplot", "dataframe")
)
data |
A data.frame or matrix of polytomous item responses (non-negative integers, 0-based, max value > 1). One column per item, one row per person. |
show_numbers |
Logical. When |
sem_multiplier |
Numeric multiplier for the threshold SE used to
draw the error bars. Default |
item_labels |
Optional character vector of length |
output |
One of |
Threshold locations are centred at the grand mean of all thresholds across items, so the dashed reference line at 0 represents the mean threshold location across the scale.
Confidence intervals around thresholds are 84% by default
(sem_multiplier = 1.405), following Payton, Greenstone, & Schenker
(2003) – non-overlap of 84% intervals approximately corresponds to a
two-sample significance test at \alpha = 0.05. Use
sem_multiplier = 1.96 for 95% intervals.
Polytomous only. Dichotomous items have a single threshold
that coincides with the item location; the hierarchy plot is
visually degenerate in that case. For dichotomous data use
RMtargeting() or RMscoreSE() instead.
Centring convention. The CML PCM thresholds (estimated via
psychotools::pcmodel()) are shifted so that their grand mean is zero;
each item's location is then the mean of its centred thresholds.
The dashed horizontal reference line on the plot marks this zero –
i.e., the average threshold across all items.
Either a ggplot (default) or a data.frame with columns
Item, ItemLabel, Threshold, ThresholdLocation,
ThresholdSE, and ItemLocation (the per-item mean of the centred
thresholds).
Payton, M. E., Greenstone, M. H., & Schenker, N. (2003). Overlapping confidence intervals or standard error intervals: What do they mean in terms of statistical significance? Journal of Insect Science, 3(34), 1-6. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/jis/3.1.34")}
RMtargeting(), RMscoreSE(), RMitemICCPlot()
if (requireNamespace("eRm", quietly = TRUE)) {
data("pcmdat2", package = "eRm")
RMitemHierarchy(pcmdat2)
# 95% CI instead of 84%
RMitemHierarchy(pcmdat2, sem_multiplier = 1.96)
# Underlying data.frame
RMitemHierarchy(pcmdat2, output = "dataframe")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.