Psychometrics and Measurement
Differential Item Functioning (DIF)
DIF checks whether an item favors one group at equal ability.
The Mantel-Haenszel DIF procedure takes right-or-wrong item answers from two groups and tests, item by item, whether people with the same total score have different odds of answering correctly.
Is any item on a reasoning test harder for non-native English speakers than for native speakers with the same overall score? Four hundred native and 400 non-native English speakers took a 10-item reasoning test, and each item was checked for differential item functioning, matching people on their total score. Item 7 is a word problem built around an English idiom.
- Tests
- Common odds ratio for one item between two groups, conditional on total score
- Observations
- Independent
- Parametric
- No
- Headline Statistic
- \Delta_{MH}
- Effect Size
- MH D-DIF (ETS Delta Scale)
- Groups
- 2
The Basics
When to Use It
Use it when two groups took the same test of right-or-wrong items, and you want to know whether any single item is harder for one group than for people in the other group with the same total score. Each item is tested in turn, and the groups can differ overall. For example:
- Is any item on a reasoning test harder for non-native English speakers than for native speakers with the same overall score?
- On a depression screener scored yes or no, are any symptom items endorsed more often by women than by men with the same total symptom count?
- Does any question on a statistics exam favor students who took the course online over in-person students with the same exam score?
A flagged item isn't automatically unfair. The analysis says which items to look at; content experts decide whether the extra difficulty comes from something the test isn't meant to measure.
Vocabulary You Need
Definition Differential Item Functioning (DIF)
An item shows DIF when test takers from two groups who are matched on the trait the test measures, usually by total score, still differ in how likely they are to answer it correctly (or endorse it). It's a property of one item, and it can point to something besides the trait, such as wording, content or background knowledge, though chance or an imperfect matching score can produce it too. DIF is uniform when one group's odds of a right answer are the same multiple of the other's at every score level, and nonuniform when that ratio changes with the score (for example, favoring one group among low scorers and the other among high scorers). DIF isn't the same as an overall difference between groups (impact), and it isn't proof of bias: it flags an item for experts to review. Glossary →
Definition Focal Group
In a DIF analysis, the group whose performance is of primary interest, usually a group that might be disadvantaged by some items (non-native speakers, a minority group, one gender). Each item asks whether members of the focal group do worse (or better) than members of the reference group with the same score. The reference group is the comparison. Glossary →
Definition Matching Criterion
The measure of the trait used to compare like with like in a DIF analysis, usually the total score on the test. People with the same score form one stratum, and the groups are compared only within strata, so an overall difference between groups doesn't count as DIF. For the Mantel-Haenszel procedure the total should include the item being studied. If some items have DIF, they contaminate the total, which is why items flagged in a first pass are often removed from the criterion and the analysis rerun (purification). Glossary →
Definition Mantel-Haenszel Common Odds Ratio (\alpha_{MH})
The Mantel-Haenszel (1959) procedure combines a series of 2 × 2 tables, one per stratum, into one odds ratio and one chi-square test. In a DIF analysis each stratum is a total-score level, and the common odds ratio αMH says how many times higher the reference group's odds of answering the item correctly are than the focal group's, among people with the same total. 1 means no DIF; above 1 the item favors the reference group, below 1 the focal group. It's a weighted average of the strata's own odds ratios, and it assumes the odds ratio is the same at every score level (uniform DIF). Glossary →
Assumptions
1. A Fair Matching Score The total score you match on measures the trait the item is meant to measure.
- What It Means
- The Mantel-Haenszel procedure compares groups only among people with the same total, so the total has to be a good, fair measure of the trait the studied item targets. That needs the test to measure one main trait, enough items for the total to sort people finely, and not too many DIF items of its own, since those tilt the total and can make clean items look biased. Matching on the total is exact only when every item discriminates equally well, as in the Rasch model; when items differ in discrimination and the groups differ overall, a clean item can show a small DIF signal, one more reason to send flags to content reviewers rather than act on them alone.
- Applies To
- Items
- How to Check
- Start from the test's content: do the items all target one trait? Check that one factor accounts for most of the item covariation. Then look at how many items the first pass flags, and in which direction: several items all favoring one group suggest the total itself is tilted.
- How Much It Matters
- A lot. If the total measures something else as well, or several items share DIF in the same direction, people with the same total aren't really matched, and clean items can be flagged (or DIF items missed). Matching on the total is also exact only when every item discriminates equally well (the Rasch model); when items differ in discrimination and the groups differ overall, a clean item can show a small DIF signal. The reasoning-test items were simulated with unequal discriminations, and item 7 also tilts the total slightly against non-native speakers. Either may help explain item 4's uncorrected p of .037 in the other direction, and so may chance. With item 7 removed from the matching total for the other items (purification), item 4's Δ falls from 0.88 to 0.71 and its p rises to .10, while item 7's result doesn't change.
If It's Violated
-
Correction
Rerun the analysis with flagged items removed from the total for every other item (the studied item stays in). In difR,
purify = TRUE. -
Design Change
Match on a set of items chosen in advance as DIF-free, such as items with a long clean record (difR's
anchorargument). - Alternative Test Item Response Theory (IRT). Compare item parameters across groups on a latent trait scale estimated from the model, rather than on the raw total.
2. DIF the Same at Every Score The groups' odds of getting the item right differ by about the same factor at every score level.
- What It Means
- The common odds ratio assumes that the groups' odds on the item differ by the same factor at every total score: uniform DIF. If the gap reverses or grows with the score (nonuniform DIF), the strata's odds ratios fall on both sides of 1 and can average out, so the procedure can miss it.
- Applies To
- Items
- How to Check
- Look at the odds ratio at each score level (or in a few score bands): odds ratios that fall on both sides of 1, or drift steadily across the range, suggest nonuniform DIF. If you plot each group's percentage correct instead, remember that percentage gaps naturally shrink near 0% and 100% even when the odds ratio is constant, so look for a gap that changes direction, not one that only changes size. A logistic regression with a score-by-group interaction tests it directly.
- How Much It Matters
- It decides what the test can see. The common odds ratio averages over score levels, so DIF that favors one group at low scores and the other at high scores can cancel out and go undetected. Here item 7's gap points the same way in every score band (see the Differential Item Functioning chart under Vocabulary You Need), and a logistic-regression test of the score-by-group interaction finds no evidence of nonuniform DIF for it, χ²(1) = 0.08, p = .77. The gap in percentage correct is still smaller at the lowest and highest bands (5 and 8 points, against 20 in the 7–8 band), because almost everyone there gets the item wrong, or right, not because the DIF changes.
If It's Violated
-
Alternative Test
Logistic Regression. Predict the item from total score, group and their interaction; the interaction tests nonuniform DIF (Swaminathan & Rogers, 1990). In difR,
difLogistic. - Proceed with Caveat Plot each group's percentage correct by score band, and say that the MH procedure tests for uniform DIF only. Percentage gaps naturally shrink near 0% and 100%, so look for a gap that changes direction, not one that only changes size.
3. Enough People in Each Group Each group is large enough to fill the score levels you match on.
- What It Means
- Every score level needs people from both groups for its 2 × 2 table to count, and small groups give unstable odds ratios and little power. ETS's working minimums, which Zwick (2012) reports, are at least 200 people in the smaller group and 500 in all for analyses when tests are assembled, and 300 and 700 for analyses run after a test is given but before scores are reported.
- Applies To
- Observations
- How to Check
- Count each group's size and look at the score distribution by group. Score levels where one group is missing drop out of the analysis; if many do, the groups barely overlap.
- How Much It Matters
- Moderate to large. Small groups leave many score levels with one group missing or nearly so, the odds ratio becomes unstable, and power to find real DIF drops. Our 400 per group is above ETS's working minimums.
If It's Violated
- Design Change Pool data from more administrations or sites before the DIF analysis, if the test and groups are the same.
- Correction Match on bands of adjacent scores (0–1, 2–3, …) so each table has people from both groups. Coarser matching lets some ability difference back in, so keep the bands narrow.
-
Robust Estimation
Compute p exactly rather than from the chi-square curve (difR's
exact = TRUE).
4. Independent Observations The people (or other units) in your study don't influence each other.
- What It Means
- Each person's data comes from a separate, unconnected source, so knowing one person's scores tells you nothing about anyone else's. In designs that measure people more than once, their own scores are meant to be related; it's different people who must be independent. Methods built for clustered data, such as multilevel models and GEE, also allow members of the same group to be related, as long as the analysis names the grouping; then it's the groups that must be independent.
- Applies To
- Observations
- How to Check
- By design, not by a test. Did each person contribute their own data, with no clusters such as roommates, couples, therapy groups or classrooms whose members influence each other? If there are clusters, does the analysis model every one of them?
- How Much It Matters
- Moderate. People tested in clusters (classrooms, schools) give correlated answers, so the standard errors come out too small and more items get flagged than should.
If It's Violated
- Alternative Test Multilevel Logistic Regression. Model item responses with random effects for the clusters, and group as a predictor.
- Design Change Recruit people independently, or from many small clusters rather than a few large ones.
Limitations
This Is Not Your Test If…
- You think the gap grows or reverses across scores (nonuniform DIF) Logistic Regression →
- Your items are rated on a scale, not scored right or wrong Ordinal Regression →
- You want to know whether the groups differ overall Independent-Samples t-Test →
- You're asking whether the whole scale measures the same construct in both groups Confirmatory Factor Analysis (CFA) →
- You want each item's difficulty and discrimination, not a group comparison Item Analysis (Classical Test Theory) →
What It Doesn't Tell You
- Why. The analysis shows item 7 is harder for non-native speakers with the same total, not what makes it harder. The idiom is a likely suspect, but that's a judgment for content reviewers.
- Whether it's unfair. DIF is a statistical flag. If the idiom were part of what the test is meant to measure, as on an English test, the same gap wouldn't be bias.
- Whether the groups differ in reasoning. The small overall gap in total scores (impact) is outside what DIF tests, and nothing here explains it. It could reflect the samples, schooling or the test as a whole.
- That an item has no DIF, if its p is above .05. After the Holm correction, the other nine items show no evidence of DIF, which isn't proof of none, especially for nonuniform DIF, which this procedure can miss.
Common Mistakes
-
Don'tCall an item biased because one group gets it right less often.
InsteadMatch on total score first. A raw gap is impact, which can come entirely from the groups' overall difference.
-
Don'tTreat a flagged item as proof that it's unfair.
InsteadSend it to content experts, who judge whether the extra difficulty is irrelevant to the trait (an idiom in a reasoning item) or part of it.
-
Don'tFlag items on p alone.
InsteadEither adjust p across items (Holm or Bonferroni) or use a rule that also demands a meaningful size, such as ETS's categories. ETS applies its categories at an unadjusted 5% level on purpose, because missing a DIF item costs more than reviewing a clean one (Zwick, 2012). Say which approach you used.
-
Don'tLeave the studied item out of the matching total.
InsteadInclude it, as Holland and Thayer (1988) showed the procedure needs, and consider purifying the total of other flagged items.
-
Don'tRead a non-significant MH test as proof that an item works the same for both groups.
InsteadCheck the interval for Δ and the score-level gaps. Small samples and nonuniform DIF both hide real differences.
-
Don'tClassify an item as C from the size of Δ alone.
InsteadAlso check that |Δ| is significantly larger than 1, as ETS's rule requires. Some software (difR's printout, for one) labels A, B and C by size alone.
-
Don'tRead a bigger χ² as a stronger effect.
InsteadReport an effect size suited to the design, such as Cramér's V, an odds ratio or a model's coefficients. χ² grows with sample size even when the effect doesn't.
-
Don'tRead a p-value as the chance that the null hypothesis is true.
InsteadRead it as: if the null were true, how often data at least this extreme would turn up.
Result Decoder
Significance and Effect Size Guidelines
Benchmarks Significance (p Value)
-
p < .001
Very strong evidence against the null hypothesis.
-
.001 ≤ p < .01
Strong evidence against the null hypothesis.
-
.01 ≤ p < .05
Statistically significant at α = .05. Moderate evidence against the null hypothesis.
-
.05 ≤ p < .10
Not significant. Weak evidence; sometimes called a “trend.” Treat it as inconclusive.
-
p ≥ .10
Not significant. Little evidence against the null, which is not the same as evidence of no effect.
These evidence labels are one common convention for describing p in graded language rather than as significant or not; the boundaries are rough guides, not rules, and other authors draw them differently. Muff et al. (2022) argue for this kind of language of evidence over a single cutoff. α is chosen before the analysis, and p never says how big or important an effect is.
Benchmarks Effect Size (MH D-DIF (ETS Delta Scale))
-
|\Delta| < 1, or \chi^2_{MH} not significant
A: Negligible
Negligible DIF, or too little evidence of any.
-
|\Delta| \ge 1 and \chi^2_{MH} significant, short of the rule below
B: Slight to Moderate
Some DIF, clearly present but not large.
-
|\Delta| \ge 1.5 and significantly larger than 1
C: Moderate to Large
The category ETS uses to send items to review committees, which may revise or drop them.
The categories are ETS's conventions for flagging items for review (Zwick, 2012), and they combine size with significance: an item counts as B or C only if its MH chi-square is also significant (B; roughly the same as Δ differing significantly from 0) or Δ is significantly larger than 1 in absolute value (C). A category says how large the gap is, not whether the item is unfair; that's a judgment for content experts. A minus sign (B−, C−) means the item favors the reference group; a plus sign, the focal group.
How It's Reported
Equation Form
αMH = 2.15, ΔMH = −1.80, 95% CI [−2.63, −0.97], χ²MH(1) = 17.68, p < .001, ETS category C
Table 1. Mantel-Haenszel DIF Statistics for the 10 Reasoning Items
| \alpha_{MH} | \Delta_{MH} | 95% CI for \Delta_{MH} | \chi^2_{MH} | p | p_{\text{Holm}} | ETS Category | |
|---|---|---|---|---|---|---|---|
| Item 1 (number series) | 0.98 | 0.04 | [−0.90, 0.98] | 0.00 | .990 | 1.000 | A |
| Item 2 (figure matrix) | 0.76 | 0.65 | [−0.16, 1.46] | 2.22 | .136 | 1.000 | A |
| Item 3 (number series) | 1.00 | −0.01 | [−0.85, 0.84] | 0.01 | .942 | 1.000 | A |
| Item 4 (figure analogy) | 0.69 | 0.88 | [0.09, 1.68] | 4.37 | .037 | .329 | A |
| Item 5 (figure matrix) | 1.24 | −0.50 | [−1.36, 0.35] | 1.12 | .291 | 1.000 | A |
| Item 6 (number series) | 1.08 | −0.18 | [−0.98, 0.62] | 0.13 | .717 | 1.000 | A |
| Item 7 (word problem) | 2.15 | −1.80 | [−2.63, −0.97] | 17.68 | < .001 | < .001 | C− |
| Item 8 (figure matrix) | 0.88 | 0.31 | [−0.48, 1.11] | 0.47 | .491 | 1.000 | A |
| Item 9 (logic puzzle) | 0.82 | 0.47 | [−0.36, 1.30] | 1.04 | .309 | 1.000 | A |
| Item 10 (figure matrix) | 0.97 | 0.06 | [−0.98, 1.11] | 0.00 | .994 | 1.000 | A |
Note. N = 800 (400 per group). Reference group: native English speakers; focal group: non-native speakers. Matching criterion: total score on all 10 items (0–10). αMH > 1 and ΔMH < 0 mean the item is harder for non-native speakers with the same total. χ²MH has 1 df and a continuity correction. Holm-adjusted p across the 10 items. ETS categories follow Zwick (2012) and use the unadjusted p, as ETS defines them; C− is moderate-to-large DIF favoring the reference group. Item 4's interval excludes 0 because its unadjusted p is below .05.
Full Text (APA Style)
Non-native English speakers scored slightly lower on the reasoning test overall (M = 4.7 vs. 5.1 of 10), but on item 7 the gap was much wider (33% vs. 50% correct). Matching test takers on total score, a Mantel-Haenszel analysis showed that item 7 was harder for non-native speakers than for native speakers with the same total, αMH = 2.15, ΔMH = −1.80, 95% CI [−2.63, −0.97], moderate-to-large DIF (ETS category C). The difference was statistically significant, χ²MH(1) = 17.68, p < .001, and remained so after a Holm correction across the 10 items (p < .001). No other item showed DIF after correction: item 4 (ΔMH = 0.88, p = .037 uncorrected) did not survive it (Holm p = .33) and was category A (Table 1). Item 7 was referred to content reviewers.
- Name the reference and focal groups and the matching criterion (here, the total score on all 10 items, the studied item included), and say whether you purified it.
- Report αMH or ΔMH with its interval for every item, not just the flagged ones; a table does this compactly, as Table 1 does.
- Say whether the chi-square used a continuity correction and how you handled testing many items at once (Holm, Bonferroni).
- Give the ETS category with its rule, and remember it flags items for review; it doesn't decide that an item is unfair.
Reading Each Piece
The equation form above, piece by piece, in this order: how big, how certain, then how surprising.
| αMH = 2.15 | Among test takers with the same total score, native speakers' odds of getting item 7 right were about 2.15 times non-native speakers' odds. 1 would mean no DIF. |
| ΔMH = −1.80 | Item 7 is 1.80 points harder on ETS's delta scale for non-native speakers than for native speakers with the same total. Negative means it favors the reference group. That's past the 1.5 that marks moderate-to-large DIF. Benchmarks ↑ |
| 95% CI [−2.63, −0.97] | The true difficulty gap for item 7 is plausibly anywhere from about 1 to 2.6 delta points against non-native speakers. The interval is well clear of 0, but its upper end, −0.97, falls just short of −1 in size, so this two-sided 95% interval doesn't clear the C threshold of 1, although the one-sided test the C rule uses does (z = 1.89 > 1.645). Item 7 is a C item more narrowly than its 1.80 suggests. |
| χ²MH(1) = 17.68 | Native speakers got about 24 more right answers on item 7 than they would have if it worked the same for both groups at every score. That gap, squared and scaled by its variance, is 17.68, far past 3.84, the 5% cutoff for a chi-square with 1 df. |
| p < .001 | If item 7 worked the same for native and non-native speakers with the same totals, a gap this large would turn up far less than 0.1% of the time. It's statistically significant. Benchmarks ↑ |
| ETS category C | Item 7's delta is large (1.80 ≥ 1.5) and significantly larger than 1 (z = 1.89 > 1.645), so it's a C item: moderate-to-large DIF, the category that sends an item to reviewers. The minus (C−) says it favors native speakers. |
Calculations
The Running Example
The reasoning-test study: 800 adults (400 native, 400 non-native English speakers), 10 right-or-wrong reasoning items, each checked for DIF by matching on total score.
- Null Hypothesis:
- \alpha_{MH} = 1
- Alternative (Two-Sided):
- \alpha_{MH} \neq 1
For each item, \alpha_{MH} is the population's common odds ratio: how many times higher a native speaker's odds of getting the item right are than a non-native speaker's with the same total score. 1 means no DIF. The alternative covers DIF in either direction. Each of the 10 items gets its own test; the Napkin Math follows item 7.
What Your Data Should Look Like
One row per test taker, one 0/1 column per item (1 = right), and one column saying which group each person belongs to. Software adds up the items into the total score, sorts people by it, and builds a 2 × 2 table of group by right-or-wrong at every score level, one set of tables for each item.
Our 800 rows give 11 score levels (0 to 10). For item 7, at a total of 5:
| Score 5 | Right | Wrong | Total |
|---|---|---|---|
| Native English | 26 | 24 | 50 |
| Non-Native English | 14 | 34 | 48 |
| Total | 40 | 58 | 98 |
| participant | language | item_01 | item_02 | item_03 | item_04 | item_05 | item_06 | item_07 | item_08 | item_09 | item_10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | non_native | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 |
| 2 | native | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3 | native | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
| 4 | native | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 |
| 5 | non_native | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 6 | native | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| … 794 more rows | |||||||||||
| Item | p | Native English p | Non-Native English p | Item–Total r |
|---|---|---|---|---|
| Item 1 | .78 | .79 | .76 | .35 |
| Item 2 | .69 | .68 | .69 | .32 |
| Item 3 | .64 | .66 | .62 | .43 |
| Item 4 | .56 | .55 | .57 | .40 |
| Item 5 | .53 | .57 | .49 | .49 |
| Item 6 | .44 | .47 | .41 | .41 |
| Item 7 | .41 | .50 | .33 | .42 |
| Item 8 | .36 | .37 | .35 | .35 |
| Item 9 | .32 | .33 | .32 | .36 |
| Item 10 | .19 | .21 | .17 | .40 |
| Total M (SD) | 4.91 (2.55) | 5.12 (2.58) | 4.70 (2.50) |
N = 800. The total adds the 10 items; each item's r is with the total of the other 9 (the corrected item–total correlation).
p is the proportion scoring 1 on the item (a right answer, or a yes).
Simulated data.
Napkin Math
The whole test, one idea at a time. Under each heading, a line says why the step matters, and the green note reads the equation in plain English with the reasoning-test study's numbers. Collapse all to read just the headings: they tell the whole story on their own.
-
1. Compare the Two Groups on the Item without Matching
Start with the raw gap. It's the number that raises the question, but it mixes two things, any real difference between the groups in reasoning and anything about the item itself, so it can't show DIF on its own.
\hat{p}_R - \hat{p}_F =.50 - .33= .17
\hat{p}_R = .50
\hat{p}_F = .33
M_{\text{total}, R} = 5.1
M_{\text{total}, F} = 4.7
\hat{p}_{R,\,\text{item 5}} = .57
\hat{p}_{F,\,\text{item 5}} = .49
\hat{p}_R is the share of native speakers who got item 7 right, .50, and \hat{p}_F the share of non-native speakers, .33. .50 − .33 = .17, a 17-point gap. Their totals differ far less (5.1 vs. 4.7 of 10), and item 5 shows an 8-point gap (.57 vs. .49) that, once people are matched on total score, the data can't tell from no DIF (Table 1: \Delta_{MH} = −0.50, p = .29).
-
2. Group People Who Got the Same Total Score
To separate the item from the groups' overall difference, compare only people who did equally well on the whole test. Each total score from 0 to 10 becomes its own small study, with its own 2 × 2 table for the item.
\begin{array}{l|cc|c} & \text{Right} & \text{Wrong} & \\ \hline \text{Reference} & A_k & B_k & n_{Rk} \\ \text{Focal} & C_k & D_k & n_{Fk} \\ \hline & m_{1k} & m_{0k} & T_k \end{array} =\begin{array}{l|cc|c} \text{Score } 5 & \text{Right} & \text{Wrong} & \\ \hline \text{Native} & 26 & 24 & 50 \\ \text{Non-native} & 14 & 34 & 48 \\ \hline & 40 & 58 & 98 \end{array}A_5 = 26
B_5 = 24
C_5 = 14
D_5 = 34
K = 11 score levels
At a total of k = 5, A = 26 of the 50 native speakers got item 7 right and B = 24 got it wrong; C = 14 of the 48 non-native speakers got it right and D = 34 wrong. That's 52% against 29%, among people with exactly the same total. There are 11 such tables, one for each score from 0 to 10.
-
3. Compare the Odds of a Right Answer at That Score
Within one score level, the odds ratio says how many times higher one group's odds of a right answer are than the other's. 1 would mean the item works the same for both.
\text{OR}_k = \dfrac{A_k D_k}{B_k C_k} =\dfrac{26 \times 34}{24 \times 14}= 2.63
Native speakers' odds at score 5 are A/B = 26 ÷ 24 = 1.08; non-native speakers' are C/D = 14 ÷ 34 = .41. The ratio is 884 ÷ 336 = 2.63: at the same total, native speakers' odds of getting item 7 right are more than two and a half times as high.
-
4. Pool the Odds Ratios across All the Score Levels
Each level gives its own, noisy odds ratio. The Mantel-Haenszel estimate combines them into one, giving more weight to levels with more people from both groups.
\alpha_{MH} = \dfrac{\sum_k A_k D_k / T_k}{\sum_k B_k C_k / T_k} =\dfrac{45.76}{21.29}= 2.15
\sum_k A_k D_k / T_k = 45.76
\sum_k B_k C_k / T_k = 21.29
\sum_k A_k D_k / T_k adds each level's A \times D divided by its number of people T (at score 5, 26 × 34 ÷ 98 = 9.02), 45.76 in all; the same for B \times C gives 21.29. 45.76 ÷ 21.29 = 2.15. Scores 0 and 10 add nothing: everyone there got item 7 wrong, or right.
-
5. Put the Gap on the Test Developers' Difficulty Scale
Odds ratios are lopsided: 2 and 0.5 are equally big gaps in opposite directions, yet 2 sits a full unit above 1 and 0.5 only half a unit below. Taking the log (+0.69 and −0.69) makes them symmetric around 0. ETS then multiplies by −2.35 to put the gap on its delta scale, the scale the A, B and C categories use. Delta writes an item's difficulty as 13 + 4z, where z is the normal-curve score for the share of people who get it wrong, so one delta point is a quarter of a standard deviation of item difficulty. The 2.35 is 4 ÷ 1.7: 1.7 turns a log odds into normal-curve units, and 4 turns those into delta points.
\Delta_{MH} = -2.35 \ln \alpha_{MH} =-2.35 \times \ln 2.15= −1.80
\ln \alpha_{MH} is the natural log of 2.15, 0.765. −2.35 × 0.765 = −1.80: for non-native speakers, item 7 is about 1.8 delta points harder than for native speakers with the same total.
-
6. Count the Right Answers Expected If the Item Worked the Same for Both Groups
If the item had no DIF, native speakers at each score level would get their share of that level's right answers, no more. The test adds up how far the actual count strays from that expectation, relative to how much it could stray by chance.
\chi^2_{MH} = \dfrac{\left( \left| \sum_k A_k - \sum_k E(A_k) \right| - 0.5 \right)^2}{\sum_k \operatorname{Var}(A_k)}, \quad E(A_k) = \dfrac{n_{Rk}\, m_{1k}}{T_k}, \quad \operatorname{Var}(A_k) = \dfrac{n_{Rk}\, n_{Fk}\, m_{1k}\, m_{0k}}{T_k^2 (T_k - 1)} =\dfrac{(|199 - 174.526| - 0.5)^2}{32.509}= 17.68
\sum_k A_k = 199
\sum_k E(A_k) = 174.526
\sum_k \operatorname{Var}(A_k) = 32.509
\sum A_k = 199 native speakers got item 7 right; with no DIF, \sum E(A_k) = 174.526 would have. The gap of 24.474, less the 0.5 continuity correction (which helps the smooth chi-square curve fit counts that can only be whole numbers), is 23.974. Squared, that's about 574.7, and ÷ 32.509, the summed variance, is 17.68.
-
7. Ask How Surprising the Gap Would Be If the Item Had No DIF
Next, ask how often chance alone would produce a gap this large if the item worked the same for both groups at every score level.
p = P(\chi^2_{df} \ge \chi^2) =P(\chi^2_{1} \ge 17.68) < .001\chi^2_{1} is a chi-square distribution with 1 df. The chance it lands at 17.68 or higher is about .00003, roughly 1 in 38,000.
-
8. Sort the Item into the ETS Categories
ETS combines size and significance. A C item needs a delta of at least 1.5 in absolute value that is also significantly larger than 1, so we compare its distance past 1 with its standard error.
z = \dfrac{|\Delta_{MH}| - 1}{SE(\Delta_{MH})} > 1.645 =\dfrac{1.80 - 1}{0.423}= 1.89
SE(\Delta_{MH}) = 0.423
95\% \text{ CI for } \Delta_{MH} = [−2.63, −0.97]
SE(\Delta_{MH}) is 0.423: 2.35 × 0.180, the standard error of \ln \alpha_{MH} from the Phillips-Holland formula. 1.80 is 0.80 past 1, and 0.80 ÷ 0.423 = 1.89, above 1.645, the one-sided 5% cutoff (one-sided because the only question is whether |\Delta_{MH}| is above 1). With |\Delta_{MH}| = 1.80 ≥ 1.5, item 7 is a C item, C− because it favors native speakers. Its 95% interval, −1.80 ± 1.96 × 0.423, runs from −2.63 to −0.97.
-
9. Check Every Item and Correct for Testing Ten at Once
The same steps run for every item. Ten tests at α = .05 give roughly a 40% chance of at least one false alarm, so the p-values are adjusted. Holm's method multiplies the smallest p by 10, the next by 9, and so on.
p^{\text{Holm}}_{(i)} = \max_{j \le i} \; \min\left\{1,\; (m - j + 1)\, p_{(j)}\right\} =10 \times .000026 \quad\text{and}\quad 9 \times .037p^{\text{Holm}}_{\text{item 7}} = .0003
p_{\text{item 4}} = .037
p^{\text{Holm}}_{\text{item 4}} = .33
Item 7 has the smallest p, so m - j + 1 = 10: 10 × .000026 = .0003, still far below .05. Item 4 is next, at .037 uncorrected; 9 × .037 = .33, no longer significant. Its delta, 0.88, was under 1 anyway, so it was category A either way.
Run It in Software
The code below reads the running example's data from data.csv; save it in the same folder you run the code from.
SPSS (version 30, as documented by IBM)
SPSS has no DIF menu, but Crosstabs with the total score as a layer runs the Mantel-Haenszel procedure for one item at a time.
- Transform → Compute Variable. Name the target
totaland enterSUM(item_01 TO item_10). - Analyze → Descriptive Statistics → Crosstabs. Move
languageinto Row(s),item_07into Column(s), andtotalinto Layer 1 of 1. - Click Statistics, check Cochran's and Mantel-Haenszel statistics, leave Test common odds ratio equals at 1, and click Continue, then OK.
- Repeat for each item, and adjust the p-values across items yourself (Holm or Bonferroni).
Or paste this syntax:
COMPUTE total = SUM(item_01 TO item_10). EXECUTE. CROSSTABS /TABLES=language BY item_07 BY total /FORMAT=AVALUE TABLES /STATISTICS=CMH(1) /CELLS=COUNT.
Reading the Output
Read the Mantel-Haenszel Common Odds Ratio Estimate first (the size), then the Mantel-Haenszel row of Tests of Conditional Independence (the test). SPSS sorts item_07 as 0 before 1, so its odds ratio compares the odds of a wrong answer: 0.465 is 1 ÷ 2.15. Take the reciprocal (or reverse the sign of the ln) before converting to ΔMH = −2.35 × ln(2.15) = −1.80.
Tests of Conditional Independence
| Chi-Squared | df | Asymptotic Significance (2-sided) | |
|---|---|---|---|
| Cochran's | 18.626 | 1 | .000 |
| Mantel-Haenszel | 17.679 | 1 | .000 |
Mantel-Haenszel Common Odds Ratio Estimate
| Value | ||
|---|---|---|
| Estimate | .465 | |
| ln(Estimate) | −.765 | |
| Standard Error of ln(Estimate) | .180 | |
| Asymptotic Significance (2-sided) | .000 | |
| Asymptotic 95% Confidence Interval | Common Odds Ratio, Lower Bound | .327 |
| Common Odds Ratio, Upper Bound | .662 | |
| ln(Common Odds Ratio), Lower Bound | −1.118 | |
| ln(Common Odds Ratio), Upper Bound | −.413 |
The Mantel-Haenszel row is the continuity-corrected statistic this page uses; Cochran's has no correction and a slightly different variance. A significance of .000 means p < .001. SPSS doesn't print ΔMH, its standard error (2.35 × .180 = 0.423) or the ETS category, so work them out as in Napkin Math steps 5 and 8. SPSS also prints tests of homogeneity of the odds ratio (Breslow-Day); with empty cells at the extreme scores, read them with caution.
Output laid out from this page's computed results, not captured from a live run; labels and layout may differ slightly in your version.
R
library(difR)
reasoning <- read.csv("data.csv")
items <- reasoning[, paste0("item_", sprintf("%02d", 1:10))]
res <- difMH(Data = items, group = reasoning$language, focal.name = "non_native",
p.adjust.method = "holm")
res
sqrt(res$varLambda) # SE of ln(alpha_MH), Phillips-Holland
2.35 * sqrt(res$varLambda) # SE of Delta_MH
Detection of Differential Item Functioning using Mantel-Haenszel method
with continuity correction and without item purification
Results based on asymptotic inference
Matching variable: test score
No set of anchor items was provided
Multiple comparisons made with Holm adjustement of p-values
Mantel-Haenszel Chi-square statistic:
Stat. P-value Adj. P
item_01 0.0002 0.9902 1.0000
item_02 2.2238 0.1359 1.0000
item_03 0.0053 0.9417 1.0000
item_04 4.3701 0.0366 0.3292
item_05 1.1163 0.2907 1.0000
item_06 0.1319 0.7165 1.0000
item_07 17.6790 0.0000 0.0003 ***
item_08 0.4734 0.4914 1.0000
item_09 1.0356 0.3088 1.0000
item_10 0.0001 0.9942 1.0000
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Detection threshold: 3.8415 (significance level: 0.05)
Items detected as DIF items:
item_07
Effect size (ETS Delta scale):
Effect size code:
'A': negligible effect
'B': moderate effect
'C': large effect
alphaMH deltaMH
item_01 0.9819 0.0429 A
item_02 0.7583 0.6501 A
item_03 1.0034 -0.0080 A
item_04 0.6873 0.8811 A
item_05 1.2381 -0.5019 A
item_06 1.0813 -0.1838 A
item_07 2.1497 -1.7985 C
item_08 0.8752 0.3134 A
item_09 0.8180 0.4721 A
item_10 0.9729 0.0646 A
Effect size codes: 0 'A' 1.0 'B' 1.5 'C'
(for absolute values of 'deltaMH')
difMH matches on the total score with the studied item included and uses the continuity correction by default, as this page does. Read alphaMH and deltaMH (the size), then Stat. and the Holm-adjusted P (the test). difR's A, B and C codes use the size of ΔMH alone; ETS's categories also require significance, which for item 7 means checking (1.80 − 1) ÷ 0.423 = 1.89 > 1.645. Here both give C. Add purify = TRUE to rerun with flagged items removed from the matching score, and see difLogistic for nonuniform DIF.
Output from a real run: R 4.6.1 (difR 6.1.0), run 2026-10-03; the two standard-error vectors trimmed.
Python
import numpy as np
import pandas as pd
from statsmodels.stats.contingency_tables import StratifiedTable
reasoning = pd.read_csv("data.csv")
items = [f"item_{i:02d}" for i in range(1, 11)]
reasoning["total"] = reasoning[items].sum(axis=1)
# One 2 x 2 table per total score: rows native, non_native; columns right (1), wrong (0)
tables = []
for score, level in reasoning.groupby("total"):
t = pd.crosstab(level["language"], level["item_07"]).reindex(
index=["native", "non_native"], columns=[1, 0], fill_value=0)
if (t.sum(axis=1) > 0).all() and (t.sum(axis=0) > 0).all():
# keep scores where both groups and both answers appear
tables.append(t.to_numpy())
st = StratifiedTable(tables)
print(st.oddsratio_pooled) # alpha_MH
print(-2.35 * np.log(st.oddsratio_pooled)) # MH D-DIF
print(st.logodds_pooled_se) # SE of ln(alpha_MH)
print(st.oddsratio_pooled_confint())
print(st.test_null_odds(correction=True))
2.149696071794304
-1.7985172049485931
0.1799286921724913
(1.5108504644200977, 3.0586701397094185)
pvalue 2.6149218134041696e-05
statistic 17.67904012538838
statsmodels has no DIF function, but StratifiedTable is the Mantel-Haenszel machinery: build one 2 × 2 table per score level for the item, then read the pooled odds ratio and the test. Loop over the 10 items and adjust the p-values with statsmodels.stats.multitest.multipletests(pvals, method="holm"). test_null_odds() leaves out the continuity correction unless you pass correction=True, and so does the test in st.summary(), which prints 18.424. The filter drops scores 0 and 10, where everyone got item 7 wrong, or right: they add nothing to αMH or the chi-square, and leaving them out lets summary() compute its test of a constant odds ratio (Breslow-Day), 5.656, p = .686.
Output from a real run: Python 3.9.6 (statsmodels 0.14.6, numpy 1.26.4, pandas 2.3.3), run 2026-10-03.
Impact
Effect Size
The size of DIF is the common odds ratio, usually reported on ETS's delta scale. \Delta_{MH} says how many points of item difficulty an item costs the focal group relative to reference group members with the same total, so it can be compared across items and tests. ETS's delta scale writes an item's difficulty as 13 + 4z, where z is the normal-curve score for the share of people who get it wrong, so one delta point is a quarter of a standard deviation of item difficulty. 0 is no DIF, and negative values mean the item is harder for the focal group.
At the same total score, native speakers' odds of getting item 7 right are 2.15 times non-native speakers' odds. On the delta scale that's −1.80, past the 1.5 of a C item, and significantly beyond 1, so item 7 is category C−.
For a feel of the scale: Δ = −1 corresponds to an odds ratio of 1.53, reference-group odds about 50% higher than those of comparable focal-group members (Zwick, 2012). The A, B and C categories are ETS conventions for deciding which items reviewers should see, not measures of harm. They combine size with significance, so the same Δ can be A in a small sample and B in a large one.
In the study's own terms, the gap is easiest to see at a single score: among people with a total of 5, 52% of native speakers got item 7 right against 29% of non-native speakers. Whether that matters depends on the test. One item can move a 10-point total by at most a point, but on a test used to select people, a point lost to something other than reasoning, such as an idiom, is a point too many, and several such items would add up.
Benchmarks MH D-DIF (ETS Delta Scale) at a Glance
Statistical Significance
For each item, p answers one narrow question: if the item worked the same way for both groups at every score level (a common odds ratio of 1), how often would the reference group's right answers stray this far from what's expected? The Mantel-Haenszel chi-square has 1 degree of freedom and catches DIF in either direction.
If item 7 worked the same for native and non-native speakers with the same totals, a gap this large would turn up about 3 times in 100,000 (\chi^2_{MH} = 17.68, p < .001). After Holm's correction across the 10 items it's still p < .001. Item 4's uncorrected .037 becomes .33.
A DIF analysis runs one test per item, so some items will come out significant by chance alone; with 10 items at α = .05 the chance of at least one false alarm is about 40%. Either adjust across the items (Holm or Bonferroni), as this page does, or use a rule that also demands a meaningful size, as ETS's categories do. ETS applies its categories without a Bonferroni-type correction on purpose: for fairness, missing a DIF item costs more than sending a clean one to review (Zwick, 2012). Say which approach you used.
p is not the probability that an item is free of DIF, and it says nothing about how large the DIF is. With thousands of test takers, trivial DIF comes out significant; that's why the categories also look at Δ.
Benchmarks p at a Glance
Strength of evidence against the null hypothesis.
Power and Sample Size
Power is the chance that a study detects an effect that's really there. For DIF, power depends on how large the DIF is, how many people are in each group (especially the smaller one), how hard the item is (items near 50% correct give the most information), how well the groups' score distributions overlap, and the rule you flag items with.
With 400 people per group, item 7's standard error on the delta scale was 0.42. If an item like it had a true Δ of −1.5, the MH chi-square at α = .05 would catch it about 94% of the time, and about 77% at the .005 a Bonferroni correction for 10 items needs. The ETS C rule, which needs Δ significantly beyond 1, would catch it only about a third of the time.
The C rule's low detection rate is well known (Zwick, 2012). Zwick also notes that once the standard error of Δ is .304 or less, the significance part of the C rule adds nothing; because standard errors shrink with the square root of the sample, getting item 7's 0.42 down to about 0.30 would take roughly twice as many people, around 775 per group.
Plan for groups well above ETS's minimums: 200 in the smaller group (500 in all) for DIF analyses when a test is assembled, and 300 (700 in all) for analyses after a test is given but before scores are reported, and decide the flagging rule and the correction for many items before looking at the results. There's no calculator for DIF on this page; simulating data like yours, with the DIF you want to catch, is the usual way to plan.
Other Info
Follow-Up and Post Hoc Tests
Post Hoc Tests
- Holm Correction: Use when you test every item on the test, as DIF analyses usually do. With 10 items, the smallest p is multiplied by 10, the next by 9, and so on (step 9 of the Napkin Math). difR:
p.adjust.method = "holm". - Bonferroni Correction: A simpler, more conservative option: judge each item's p against α ÷ the number of items (.05 ÷ 10 = .005 here).
References
- Holland, P. W., & Thayer, D. T. (1988). Differential item performance and the Mantel-Haenszel procedure. In H. Wainer & H. I. Braun (Eds.), Test validity (pp. 129–145). Lawrence Erlbaum Associates.
- Mantel, N., & Haenszel, W. (1959). Statistical aspects of the analysis of data from retrospective studies of disease. Journal of the National Cancer Institute, 22(4), 719–748. https://doi.org/10.1093/jnci/22.4.719
-
Holland, P. W., & Thayer, D. T. (1986, April). Differential item performance and the Mantel-Haenszel procedure [Paper presentation]. Annual Meeting of the American Educational Research Association, San Francisco, CA, United States. ERIC ED272577.
https://eric.ed.gov/?id=ED272577
“Values of Δ̂MH that are negative correspond to items that the reference group found easier on average than did comparable focal group members.” (p. 9)
“We prefer the more neutral terms, differential item performance or differential item functioning, (i.e., dif), to item bias since in many examples of items that exhibit dif the term "bias" does not accurately describe the situation.” (p. 1)
“We will always be comparing two groups of examinees, of which the performance of one, the focal group, F, is of primary interest.” (p. 1)
“the criterion for matching, X+, includes the studied item,” (p. 16)
-
Zwick, R. (2012). A review of ETS differential item functioning assessment procedures: Flagging rules, minimum sample size requirements, and criterion refinement (Research Report No. RR-12-08). Educational Testing Service.
https://doi.org/10.1002/j.2333-8504.2012.tb02290.x
“MH-D-DIF is negative when the focal group odds of correct response are less than the reference group odds, conditional on the matching variable.” (p. 2)
“An A item is one in which either the Mantel-Haenszel (MH) chi-square statistic is not significant at the 5% level or MH D-DIF is smaller than 1 in absolute value.” (p. 3)
“In order to qualify as a C item, the MH D-DIF statistic must be significantly greater than 1 in absolute value at the 5% level and must have an absolute value of 1.5 or more.” (p. 4)
“the C rule that is typically used for purposes of identifying DIF items for review by committees or possible deletion” (p. 11)
“The Mantel-Haenszel (1959) approach to DIF analysis, developed by Holland and Thayer (1988), involves the creation of K two-by-two tables, where K is the number of score categories on the matching criterion.” (p. 2)
“at least 200 members in the smaller group and at least 500 in total are needed for DIF analyses performed at the test assembly phase.” (p. 11)
-
Swaminathan, H., & Rogers, H. J. (1990). Detecting differential item functioning using logistic regression procedures. Journal of Educational Measurement, 27(4), 361–370.
https://doi.org/10.1111/j.1745-3984.1990.tb00754.x
“the logistic regression procedure is more powerful than the Mantel‐Haenszel procedure for detecting nonuniform DIF and as powerful in detecting uniform DIF.” (Abstract)
- Magis, D., Béland, S., Tuerlinckx, F., & De Boeck, P. (2010). A general framework and an R package for the detection of dichotomous differential item functioning. Behavior Research Methods, 42(3), 847–862. https://doi.org/10.3758/BRM.42.3.847
- Holm, S. (1979). A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6(2), 65–70. https://www.jstor.org/stable/4615733
-
Muff, S., Nilsen, E. B., O'Hara, R. B., & Nater, C. R. (2022). Rewriting results sections in the language of evidence. Trends in Ecology & Evolution, 37(3), 203–210.
https://doi.org/10.1016/j.tree.2021.10.009
“we suggest language of evidence that allows for a more nuanced approach to communicate scientific findings as a simple and intuitive alternative to statistical significance testing” (Abstract)
Spot an error? Something still confusing? Tell us at support@statsforpsychology.com.