easyRasch2

CRAN Version Downloads Downloads Status R-CMD-check Codecov test coverage Buy Me A Coffee

easyRasch2 is an R package for Rasch measurement theory analysis workflows. It is the successor to easyRasch, offering a lightweight and consistent structure with proper namespacing and minimal dependencies.

A central design choice is simulation-based critical values for various fit statistics. Rather than relying on rule-of-thumb cutoffs, most diagnostics are paired with a parametric-bootstrap function that generates an empirical null distribution from the fitted Rasch / PCM model and the observed sample.

The Get Started link above contains a short introduction. For broader Rasch-analysis tutorials, see the vignette for the archived sibling package easyRasch.

Statement of need

A complete Rasch analysis requires many separate procedures — item fit, local dependence, dimensionality, differential item functioning, reliability, targeting, and more. In R these are spread across packages with differing data formats, argument conventions, and output objects, which raises the barrier to entry and can make analyses hard to reproduce. A further problem is that fit statistics (item fit MSQ, Yen’s \(Q_3\) residuals, the first residual-PCA contrast, CFA fit indices) are usually judged against fixed rule-of-thumb cutoffs that are known to depend on sample size, number of items and other factors such as targeting, and the number of response categories.

easyRasch2 targets applied researchers and students validating rating scales and tests in health, education, and psychology using modern psychometric methods. It provides a single, consistently named interface across the whole workflow with publication-ready output, and — as its distinguishing feature — replaces rule-of-thumb cutoffs with sample-specific critical values obtained by parametric bootstrap from the fitted Rasch/PCM model (Johansson, 2025). Several methods, including the polytomous Martin-Löf test with Monte Carlo p-values (Christensen & Kreiner, 2007) and the bootstrap item-restscore test, are not available in other R packages.

Installation

Install from CRAN:

install.packages("easyRasch2")

Install the development version from GitHub:

# install.packages("remotes") # if needed
remotes::install_github("pgmj/easyRasch2")

Key design principles

Functions by domain

Item fit

Local dependence

Dimensionality / unidimensionality

Differential item functioning

Item category threshold ordering

Reliability, targeting, score conversion

Item & person parameters

Person fit

Data visualization

Example

library(easyRasch2)
data("pcmdat2", package = "eRm")
options(mc.cores = 4)
set.seed(42)

# Conditional item infit with simulation-based cutoffs
simfit <- RMitemInfitCutoff(pcmdat2, iterations = 250)
RMitemInfit(pcmdat2, cutoff = simfit)

# Test of unidimensionality via posterior-predictive ordinal CFA
cfa_sim <- RMdimCFACutoff(pcmdat2, iterations = 250)   # simulated reference
tabs <- RMdimCFA(pcmdat2, cutoff = cfa_sim)            # observed vs expected
tabs$fit                                                # fit-index table
tabs$loadings                                           # per-item loading table
plots <- RMdimCFAPlot(cfa_sim, data = pcmdat2)          # list of 2 ggplots
plots$loadings                                          # observed vs expected loadings
plots$fit                                               # fit-index distributions

# DIF analysis via Andersen's LR test
grp <- factor(sample(c("A", "B"), nrow(pcmdat2), replace = TRUE))
RMdifLR(pcmdat2, dif_var = grp)

# Rasch-tree DIF with effect-size classification on continuous +
# categorical covariates simultaneously
covs <- data.frame(
  group = grp,
  band  = sample(c("low", "high"), nrow(pcmdat2), replace = TRUE)
)
RMdifTree(pcmdat2, covariates = covs)

References

Credits

As mentioned earlier, this is based on my easyRasch package, and I am using Claude Opus/Fable to rewrite functions to this more properly formatted package. While it uses my earlier code, most of the code in this package is produced by the LLM and tested and bug fixed by me.

RMdifTree() adapts MIT-licensed code from Mirka Henninger and Jan Radek’s raschtreeMH and effecttree packages for the effect-size and ETS-classification algorithms.

Magnus Johansson is a licensed psychologist with a PhD in behavior analysis. He works as a research specialist focused on psychometrics and statistics at Karolinska Institutet, Department of Clinical Neuroscience, Center for Psychiatry Research.

License

GPL (>= 3)