Differential Item Functioning for AI-Scored Assessments
Overview
Detects and quantifies differential item functioning (DIF) in AI-scored educational and psychological assessments. Provides a fully self-contained robust DIF engine (M-estimation via iteratively re-weighted least squares with the bi-square loss), cross-checked against the reference implementation in 'robustDIF', alongside the Differential AI Scoring Bias (DASB) test, which detects item-level scoring shifts that differ across subgroups when comparing human and AI scoring conditions. Supports independent and paired scoring designs, including a bootstrap estimator of the cross-condition covariance that paired designs require, a one-call workflow from raw item scores through 'mirt' calibration, robust linking of the cross-condition contrast, bootstrap standard errors, multiplicity control, simulation of paired human and AI item scores, anchor weight diagnostics, and an AI-effect classification framework. Methods follow Halpin (2024) doi:10.1007/s11336-024-09957-6.
New features
fit_aidif_responses()runs the whole analysis from raw item scores: it calibrates both scoring conditions in 'mirt' (item parameters free in both groups), converts the fits withas_aidif(), estimates the cross-condition covariance for paired designs, and callsfit_aidif(). Dichotomous (2PL) and polytomous (graded) items are supported.paired_cross_cov()estimates the cross-condition covariance thatdesign = "paired"requires, by resampling examinees within group and refitting both calibrations on each resample. In 0.2.0 the paired design accepted this matrix but offered no way to obtain it, so it was usable only by analysts who could derive it themselves. The default estimator rescales the bootstrap correlation by the model-based standard errors, which guarantees a non-negative paired variance. Bootstrap replicates can run in parallel on all platforms viacores.
Show all changes in 0.3.0Hide the rest of the changes in 0.3.0
fit_aidif_responses()defaults tometric = "linked". When the AI engine changes item slopes and the groups differ in mean trait, raw DASB is shifted on every item; in simulation (AI slopes 0.8 times human, impact 0.5 SD, no true DASB) the raw test rejected about 16% of the time at a nominal 5%, while the linked metric held 5%.fit_aidif()keeps its 0.2.0 default ("common") for backward compatibility.fit_aidif_responses(se = "bootstrap")reports bootstrap standard errors for DASB. Undermetric = "linked"the item-common offset is re-estimated in each replicate, so these standard errors include the variability of the bi-square weights that the analytic linked-metric variance ignores.simulate_aidif_responses()generates paired human and AI item scores from a logistic graded response model with known DIF, DASB, AI drift, AI slope change, and human-AI agreement (Gaussian copula). Unlikesimulate_aidif_data(), which draws parameter estimates directly, it produces response data that go through real calibration, so it supports Type I error, power, and coverage studies of the full workflow.compare_robustdif()runs aiDIF's robust scaling engine and 'robustDIF' on the same estimates for each scaling convention and reports the difference. The two agree to machine precision.
Bug fixes
print()for DASB tables dropped the item labels and printed row numbers instead. Fixed.
Other changes
- 'robustDIF' added to Suggests; 'parallel' added to Imports.
- Package URL moved to <https://github.com/subirhait/aiDIF>.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK8 OK2026-04-22
Documentation
- Help pages
- 30 (13 internal)
- Examples that run
- 85%11 run in a plain check (2 of them under a condition) · 2 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 92%
- Documented parameters
- 93%
- Return-value docs
- 100%
- Help pages citing references
- 7%
Downloads
Repository
- github.com/causalfragility-lab/aidif · last recorded on 2026-10-22
Repository github.com/subirhait/aidif is linked, but repository-practices checks have not run for it yet.
Dependencies
Installing aiDIF adds no packages beyond those that come with R.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.3.0Latest2026-10-22 · current release · diff ↗ ··
added 4 exports
compare_robustdif, fit_aidif_responses, paired_cross_cov, simulate_aidif_responses26 hours in CRAN's queue
Listed in CRAN's incoming queue from 2026-10-21 19:49 to 2026-10-22 21:24 UTC, in 7 readings. - 0.2.0
- RR 4.6.0 released · 2026-04-24
- 0.1.02026-04-21
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2026-04-21
- Total releases
- 3 / 1 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 3.5.0
- Download size
- 102 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("aiDIF")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.