MyNixOS website logo
Description

Bayesian Rasch Analysis Using 'brms'.

Reproduces classic Rasch psychometric analysis features using Bayesian item response theory models fitted with 'brms' following Bürkner (2021) <doi:10.18637/jss.v100.i05> and Bürkner (2020) <doi:10.3390/jintelligence8010005>. Supports both dichotomous and polytomous Rasch models. Features include posterior predictive item fit, conditional infit, item-restscore associations, person fit, differential item functioning, local dependence assessment via Q3 residual correlations, dimensionality assessment with residual principal components analysis, person-item targeting plots, item category probability curves, and reliability using relative measurement uncertainty following Bignardi et al. (2025) <doi:10.31234/osf.io/h54k8_v1>.

easyRaschBayes

CRAN Version Downloads Downloads Status Buy Me A Coffee

easyRaschBayes provides functions to reproduce classic Rasch analysis features using Bayesian item response theory (IRT) models fitted with brms. It supports both dichotomous Rasch models and polytomous partial credit models, and exposes the full posterior distribution for all output.

For more materials on Rasch analysis, see the vignette for my (frequentist) package easyRasch.

Installation

Install the stable version from CRAN:

install.packages("easyRaschBayes")

Or install the development version from GitHub:

install.packages("remotes") # if you don't have `remotes` installed
remotes::install_github("pgmj/easyRaschBayes")

Main functions

FunctionDescription
infit_statistic()Conditional infit (and outfit) statistics
infit_post()Post-processing and plotting of infit statistics
item_restscore_statistic()Item–rest score associations with Goodman & Kruskal's gamma
item_restscore_post()Post-processing and plotting of item-restscore statistics
plot_icc()Conditional item fit curves & DIF analysis
plot_residual_pca()Residual PCA contrast plot for dimensionality assessment
q3_statistic()Yen's Q3 residual correlations for local dependence evaluation
q3_post()Post-processing and plotting of Q3 statistics
plot_ipf()Item probability function curves
plot_icc()Item category characteristics curves
plot_targeting()Person-item map (Wright map)
dif_statistic()Differential Item Functioning (DIF) analysis
fit_statistic_pcm()Posterior predictive item/person fit for polytomous models
fit_statistic_rm()Posterior predictive item/person fit for dichotomous models
RMUreliability()Reliability via Relative Measurement Uncertainty (RMU)
person_parameters()EAP and WLE latent scores and ordinal sum score transformation table
item_parameters()Summarize item threshold locations
plot_tile()Plot response data, see also plot_bars() and plot_stackedbars()

Usage

library(brms)
library(easyRaschBayes)

# Fit a Bayesian Rasch model (dichotomous)
fit <- brm(
  response ~ 1 + (1 | item) + (1 | id),
  data   = my_data,
  family = bernoulli(),
  chains = 4, cores = 4
)

# Conditional item infit
infit <- infit_statistic(fit)
infit_post(infit)

# Local dependence with Yen's Q3
q3_results <- q3_statistic(fit)
q3_post(q3_results)

# Response category functioning
plot_ipf(fit)

# Person-item map
plot_targeting(fit)

References

Bürkner, P.-C. (2020). Analysing Standard Progressive Matrices (SPM-LS) with Bayesian Item Response Models. Journal of Intelligence, 8(1). doi:10.3390/jintelligence8010005

Bürkner, P.-C. (2021). Bayesian Item Response Modeling in R with brms and Stan. Journal of Statistical Software, 100, 1–54. https://doi.org/10.18637/jss.v100.i05

Credits

This started as a side project to update the code to assess item fit included in Bürkner (2020). With the help of Claude Opus 4.6 things expanded to try to reproduce core Rasch analysis steps. Most of the code in this package is produced by the LLM.

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

License

GPL (>= 3)

Metadata

Version

0.2.0.1

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows