Shiny-DIFT is an interactive web application for detecting Differential Item Functioning (DIF) and Differential Step Functioning (DSF) in polytomous items using tree-based item response theory (IRT) models.
The application is implemented in R/Shiny and uses the psychotree and effecttree packages for model-based recursive partitioning.
Live app: https://smhtpz.shinyapps.io/Shiny_DIFT/
- Data Upload — CSV import with configurable separator, quote, decimal, and header options; automatic missing data detection
- IRT Model Comparison — Fits Partial Credit Model (PCM) and Rating Scale Model (RSM) via
mirt; reports log-likelihood, AIC, BIC, and likelihood ratio test; automatically syncs the better-fitting model to the Analysis tab - Tree-Based DIF/DSF Analysis — Runs
pctreeorrstreewith user-selected items and grouping variables; supports iterative purification and p-value adjustment (Bonferroni, FDR); displays partial gamma effect sizes (A = negligible, B = moderate, C = large) with color coding - Visualization — Regions plot and profile plot with downloadable PNG output
- Parameter Tables — Item and threshold parameter tables with DIF magnitude highlighting; CSV and Excel export
- HTML Report — Automated report generation with plots, tables, and interpretations
| Model | Function | Description |
|---|---|---|
| Partial Credit Model | pctree() |
Item-specific threshold parameters |
| Rating Scale Model | rstree() |
Common threshold structure across items |
# Install required packages
install.packages(c("shiny", "shinythemes", "shinyjs", "mirt", "DT",
"psychotree", "partykit", "ggplot2",
"knitr", "kableExtra", "jsonlite", "pandoc", "rmarkdown"))
# Install effecttree from GitHub
remotes::install_github("mirka-henninger/effecttree")shiny::runApp("path/to/deploy")A built-in example dataset is included (dsf_example_data.csv): N = 500 respondents, 10 polytomous items (scored 0–4), and two continuous covariates (var1, var2). The data were simulated under the Partial Credit Model with DIF introduced at items I02, I07 (driven by var1) and I04, I09 (driven by var2).
- Semih Topuz — Başkent University
- Aybüke Doğaç — Hacettepe University
- Sinem Tekin — Hacettepe University
Komboz, B., Zeileis, A., & Strobl, C. (2018). Tree-based global model tests for polytomous Rasch models. Educational and Psychological Measurement, 78(1), 128–166. https://doi.org/10.1177/0013164416664394
Strobl, C., Henninger, M., & Radek, J. (2025). Detecting differential item and step functioning with Rasch trees and rating scale trees. Behaviormetrika, 52(1), 31–59. https://doi.org/10.1007/s41237-024-00252-3
Chalmers, R. P. (2012). mirt: A multidimensional item response theory package for the R environment. Journal of Statistical Software, 48(6), 1–29. https://doi.org/10.18637/jss.v048.i06
Build 1.1.0