Bayesian Differential Item Functioning (Bayesian DIF)

Statistics
Introduced by
H. Swaminathan & H. J. Rogers (classical DIF); Bayesian extensions developed through Markov chain Monte Carlo IRT methods in the 1990s–2000s
Year
1990s–2000s
Type
Item bias detection / Bayesian inference
Family
Scale / measurement

What does it do?

Bayesian differential item functioning (Bayesian DIF) analysis tests whether a test item functions differently for groups of examinees who have the same underlying ability or trait, such as males and females.

It estimates item parameters separately for each group within a Bayesian IRT framework and assesses group differences with posterior distributions, usually summarised by credibility intervals, rather than the p-values of classical DIF tests. The approach is applied to binary or ordinal item responses.

The intuition behind the method

An item shows differential item functioning when examinees at the same trait level have different probabilities of answering it correctly because of their group membership. The Bayesian version treats each item parameter in each group as uncertain and describes it with a posterior distribution, rather than a single point estimate. The between-group difference in difficulty or discrimination then has its own posterior distribution. An item is flagged when the 95% highest-density credibility interval for that difference excludes zero and the posterior mean difference is large enough to matter on a practical threshold fixed before the analysis. Priors encode what is expected before the data are seen. A prior centred at zero for the group difference expresses the expectation of no DIF, which the data must overcome. Because priors pull estimates from small samples toward plausible values, the posterior can be more stable than an unregularised estimate, but the result then depends on the prior that was chosen.

History

Classical DIF procedures were developed before the Bayesian approach, and Mantel-Haenszel and logistic regression procedures are the standard comparators. Swaminathan and Rogers (1990) presented a logistic regression procedure for DIF that distinguishes uniform from non-uniform DIF. Bolt (2002) compared parametric GRM-based and nonparametric polytomous DIF procedures in a simulation study. Bayesian DIF applies Bayesian estimation to IRT models of the kind used in these procedures. Bayesian estimation of IRT models became practical as MCMC methods became available.

When to use it

Use Bayesian DIF when you are building or validating a test or scale and need to check that items function equivalently across groups such as gender, language background or clinical diagnosis. It is a reasonable choice when the focal group is small, because priors regularise estimates and classical tests can be unstable with few focal-group examinees, provided the priors are justified. With small focal groups, however, a prior centred at zero can shrink genuine DIF toward zero and produce false negatives. Run a prior sensitivity analysis (for example, a weaker and a stronger prior) and check whether the flagged items change before relying on the result. The approach also suits analyses where substantive prior knowledge about item parameters exists and can be encoded explicitly. Do not use it to establish why an item shows DIF, because the analysis identifies statistical imbalance and content review is still needed. Do not use it when computation is prohibitive, such as a very large item bank with a short deadline, and a simpler Mantel-Haenszel or logistic regression screen answers the question adequately. Avoid it when the IRT model is clearly misspecified for the data, because the posterior inherits that misfit.

Limitations and considerations

  • MCMC or variational estimation is computationally heavier than Mantel-Haenszel or logistic regression screens and requires convergence checks before the posteriors can be interpreted.
  • Conclusions depend on prior specification. When the focal group is small, a poorly chosen prior can mask or exaggerate DIF.
  • The model needs an identification choice, such as a set of anchor items assumed to be DIF-free. This is an assumption that affects every contrast in the analysis.
  • Ready-made tools for Bayesian IRT-DIF are less standardised than tools for classical DIF, so analysts often need to write or adapt custom models.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Gives a full posterior distribution for each between-group difference in item difficulty or discrimination, so the uncertainty about each DIF contrast is reported directly rather than as a single p-value.
  • Priors shrink small-sample estimates toward plausible values, which can stabilise contrasts when the focal group is small. The size of this effect depends on the prior chosen.
  • Prior knowledge about expected parameter differences can be encoded explicitly, with a prior centred at zero expressing the expectation of no DIF.
  • Extends to polytomous items within the same estimation framework: DIF contrasts can be computed for category threshold parameters, showing where along the response scale an item differs across groups.
  • Uses the same posterior machinery for difficulty (uniform) and discrimination (non-uniform) contrasts, so both kinds of DIF can be examined in one model.

Applications

  • Large-scale educational assessments examining whether test items are equally fair to students from different linguistic or cultural backgrounds.
  • Clinical scale validation checking that items in a depression or anxiety scale function equivalently across diagnostic subgroups or genders.
  • Credentialing and licensure examinations where regulatory standards require documented DIF screening across racial and gender groups.
  • Cross-national survey research verifying that attitudinal items carry the same meaning and difficulty across translated versions.
  • Adaptive testing item bank development, where items flagged for DIF must be revised or stratified before deployment.

How it works

How it works

1

Each item is modelled with an IRT model, most commonly the 2PL or, when a pseudo-guessing parameter c is included, the 3PL. The formula in the model step is the 3PL; the 2PL is the special case in which c_i = 0. In these models the probability of a correct response depends on the examinee's latent ability theta, the item discrimination a, the difficulty b and, for the 3PL, c. Item parameters are estimated for the focal and reference groups, and the DIF contrast is the difference between them. Because the parameters are estimated jointly, the model still needs an identification choice, such as a set of anchor items assumed to be free of DIF or an equivalent constraint on the latent scale. That choice must be stated, since it shapes every contrast.

Formula
P(X_{ij}=1|\theta_j, a_i, b_i, c_i) = c_i + \frac{1-c_i}{1+e^{-a_i(\theta_j - b_i)}}
2

Before the data are observed, prior distributions are placed on the item and person parameters. Normal priors on log-discrimination and difficulty are a common choice, and the prior can be informative or weakly informative depending on the strength of prior knowledge. For the DIF contrast, a prior is placed on the between-group difference in each parameter and centred at zero, which expresses the expectation of no DIF. The data must then provide enough evidence to move the posterior away from zero.

3

The posterior distribution of all item and person parameters, given the observed responses X, is proportional to the likelihood of the data multiplied by the priors. MCMC sampling, most often by Gibbs sampling or Hamiltonian Monte Carlo, draws from this joint posterior. The result is a full posterior distribution for each item parameter in each group, not a single estimate.

Formula
p(\boldsymbol{\delta}|\mathbf{X}) \propto p(\mathbf{X}|\boldsymbol{\delta})\, p(\boldsymbol{\delta})
4

The DIF contrast for item i is the posterior distribution of the difference in difficulty (or discrimination) between the focal and reference groups. It is summarised by its posterior mean (the expected size of the DIF), its standard deviation (the uncertainty), and a 95% highest-density credibility interval. An item is flagged as showing DIF only when this interval excludes zero and the posterior mean meets a practical threshold fixed in advance. An interval excluding zero alone establishes that a difference is unlikely to be zero under the model and prior; it does not establish that the difference is large.

5

Flagged items can be grouped by the size of the posterior mean difference into negligible, moderate and large categories. No single logit-scale threshold is standard for Bayesian DIF, so the cut-offs must be pre-specified on the scale of the fitted model and justified for the application. Benchmark categories developed for classical procedures such as Mantel-Haenszel are not defined on the logit scale and should not be applied to posterior means without a justified conversion. Because many items are usually tested in one analysis, some flags will arise by chance; report the number of items tested together with the criterion used. Items with large DIF and a plausible content explanation are reviewed by subject-matter experts, who decide whether to remove, revise or retain them with caution.

Common pitfalls

  • Using diffuse, flat priors on item parameters in small focal groups. Flat priors give no regularisation, so the posteriors can be wide and uninformative, reproducing the instability the Bayesian approach was meant to reduce.
  • Neglecting anchor item selection. If the anchor items themselves show DIF, the comparisons for the other items are contaminated and the detection becomes circular.
  • Treating a credibility interval that barely excludes zero as evidence of important DIF without also checking the posterior mean. Statistical support and practical size should both be evaluated.
  • Conflating DIF with item invalidity. An item may show DIF because of genuine group differences in a content facet, so content review is needed before the item is removed.
  • Checking only difficulty contrasts and ignoring discrimination (non-uniform) DIF. The distinction between uniform and non-uniform DIF is central to the logistic regression framework of Swaminathan and Rogers (1990), and it matters here too.

Frequently asked questions

How does Bayesian DIF differ from the classical Mantel-Haenszel DIF test?

The Mantel-Haenszel test produces a single chi-square or odds-ratio statistic with a p-value. Bayesian DIF instead estimates a full posterior distribution for the between-group difference in item difficulty, yielding credibility intervals and posterior probabilities. This gives richer information about uncertainty and can behave better when the focal group is small, although the result depends on the prior.

What counts as a meaningful DIF effect size in Bayesian analysis?

No single threshold is standard for Bayesian DIF. The posterior mean difference should be judged on the scale of the fitted model against a practical criterion fixed before the analysis. Benchmark categories developed for classical procedures such as Mantel-Haenszel are not defined on the logit scale and should not be applied to posterior means without a justified conversion. A credibility interval that excludes zero indicates that a difference is unlikely to be zero under the model and prior, but it says nothing about how large the difference is.

Do I need a large focal-group sample for Bayesian DIF?

Bayesian DIF can be preferred when focal-group samples are small, because the priors regularise parameter estimates. Priors do not create information, however. With very few examinees the posterior remains largely driven by the prior, so the prior must be justified and the sensitivity of the results to it should be checked.

What software can perform Bayesian DIF analysis?

Custom Bayesian IRT-DIF models are usually written in general-purpose MCMC software, such as Stan or JAGS, which can often be called from R or Python. Classical DIF procedures, such as Mantel-Haenszel and logistic regression, are available in standard psychometric software and serve as frequentist comparators. Software for Bayesian IRT-DIF changes over time, so check the current documentation to confirm that a package implements the Bayesian IRT-DIF model you need.

Can Bayesian DIF be applied to polytomous items such as Likert scales?

Yes. Polytomous IRT models, such as the graded response model or the partial credit model, can be estimated within the same Bayesian MCMC framework. DIF contrasts are then computed for each category threshold parameter rather than for a single difficulty parameter, which shows where along the response scale an item behaves differently across groups. Parametric polytomous DIF procedures can be sensitive to model misfit: in a simulation study, the graded-response-model likelihood-ratio procedure showed large Type I error inflation when the generating model was not the graded response model (Bolt, 2002), so model fit should be checked before the contrasts are interpreted.

Related methods

Sources

  1. Swaminathan, H., & Rogers, H. J. (1990). Detecting differential item functioning using logistic regression procedures. Journal of Educational Measurement, 27(4), 361–370.

    Open DOI reference
  2. Bolt, D. M. (2002). A Monte Carlo comparison of parametric and nonparametric polytomous DIF detection methods. Applied Measurement in Education, 15(2), 113–141.

    Open DOI reference