| RMscoreSE | R Documentation |
For a given set of items, returns the score-to-theta lookup that maps each possible raw sum score to a person-location estimate (in logits) and its standard error. Useful when reporting a scale's measurement properties or converting raw totals to interval-scaled scores for downstream analysis.
RMscoreSE(
data,
method = "WLE",
output = "kable",
ci_multiplier = 1.96,
point_size = 3,
error_width = 0.5,
theta_range = c(-10, 10)
)
data |
A data.frame or matrix of item responses. Items must be scored
starting at 0 (non-negative integers). Missing values ( |
method |
Character string. Either |
output |
Character string controlling the return value: |
ci_multiplier |
Numeric. Multiplier applied to the standard error to
draw error bars on the figure. Default |
point_size |
Numeric. Point size for the figure. Default |
error_width |
Numeric. Cap width for error bars on the figure.
Default |
theta_range |
Numeric length 2. Theta search range used for boundary
raw scores under WLE estimation. Default |
The function automatically detects whether the data is dichotomous (max score 1) or polytomous (max score > 1) and selects the appropriate Rasch / Partial Credit model.
method = "WLE" fits the model by CML with psychotools::pcmodel(),
centres the item thresholds to grand-mean-zero, and solves Warm's
weighted-likelihood equation for each raw score with the same engine used
by RMpersonParameters(); the two functions therefore report identical
locations and standard errors. Warm's bias correction yields finite
locations even at the minimum and maximum scores (only a root outside
theta_range is clamped to the boundary with NA SE). The reported
logit_se is the information-based standard error 1 / sqrt(I(theta)),
matching catR, TAM and most Rasch software.
method = "EAP" fits the model with mirt::mirt(..., itemtype = "Rasch") (MML) and obtains sum-score-based EAP estimates and posterior
SDs via mirt::fscores(method = "EAPsum", full.scores = FALSE, full.scores.SE = TRUE). EAP estimates are finite at all score boundaries
(the prior shrinks them inward), but they depend on the assumed normal
prior on theta. Item parameters from MML differ slightly from the CML
values used by the WLE path; for well-behaved data the difference is small.
If output = "kable": a knitr_kable object with columns "Ordinal sum
score", "Logit score", and "Logit std.error", and a caption noting the
estimation method.
If output = "dataframe": a data.frame with columns raw_score,
logit_score, and logit_se (one row per possible raw sum score from 0
to the theoretical maximum).
If output = "ggplot": a ggplot object — points at each
(logit_score, raw_score) with horizontal error bars at
± ci_multiplier × logit_se.
Warm, T. A. (1989). Weighted likelihood estimation of ability in item response theory. Psychometrika, 54(3), 427-450. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/BF02294627")}
Bock, R. D., & Mislevy, R. J. (1982). Adaptive EAP estimation of ability in a microcomputer environment. Applied Psychological Measurement, 6(4), 431-444. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/014662168200600405")}
set.seed(42)
sim_data <- as.data.frame(
matrix(sample(0:3, 200 * 6, replace = TRUE), nrow = 200, ncol = 6)
)
colnames(sim_data) <- paste0("Item", 1:6)
# Default kable output, WLE
RMscoreSE(sim_data)
# Underlying data.frame
RMscoreSE(sim_data, output = "dataframe")
# ggplot figure
if (requireNamespace("ggplot2", quietly = TRUE)) {
RMscoreSE(sim_data, output = "ggplot")
}
# EAP via mirt
RMscoreSE(sim_data, method = "EAP")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.