From Four Group Means to a DiD Contrast
A treated group and a control group can begin at different outcome levels and can both change over time. The two-period difference-in-differences (DiD) calculation focuses on how much the groups’ changes differ. It is a contrast of four group-time means: treated and control, each measured before and after an intervention.
The calculation is useful because a post-period difference alone includes any gap that was already present before the intervention. DiD subtracts the change observed in the control group from the change observed in the treated group. The resulting number summarizes the treated group’s change relative to the control group’s change, in the outcome’s original units.
Keep the order of the subtraction fixed: calculate post minus pre within each group, then take treated minus control. This convention determines the sign. A positive contrast means the treated group’s outcome increased more, or decreased less, than the control group’s outcome. A negative contrast means it decreased more, or increased less. Which direction is favorable depends on what the outcome measures.
Calculation and Interpretation
A reliable calculation keeps the group-specific changes visible before subtracting them. The baseline gap and post-period gap can also be calculated as checks, but neither is itself the DiD contrast.
Identify the treated and control means in the pre- and post-intervention periods, and confirm that all means refer to the same outcome and units.
For each group, subtract its pre-period mean from its post-period mean.
Subtract the control group’s change from the treated group’s change. Keep the resulting sign and outcome units.
Describe the contrast in context. The arithmetic gives a relative change; interpreting it as a causal treatment effect additionally requires the design’s identifying assumptions.
The calculation can also be written as the difference between the post-period gap and the pre-period gap:
To see the equality, distribute the minus sign over the control-group change: \((\bar{Y}_{T,1}-\bar{Y}_{T,0})-\bar{Y}_{C,1}+\bar{Y}_{C,0}\). Rearranging terms gives the post-period treated-control gap minus the pre-period treated-control gap. This identity is a useful arithmetic check: both routes must produce the same contrast.
Worked Examples
Worked Example: The Groups Start at Different Levels
Hypothetical data. Suppose a program is introduced in one set of clinics. The outcome is the average number of minutes patients wait. Before the program, the treated clinics have a mean wait of 50 minutes and the control clinics have a mean wait of 42 minutes. Afterward, their means are 62 and 49 minutes, respectively. What is the two-period DiD contrast?
First calculate each group’s change:
Subtract the control change from the treated change:
As a check, the treated-control gap is \(50-42=8\) minutes before the program and \(62-49=13\) minutes afterward. The gap changed by \(13-8=5\) minutes, matching the calculation. The treated clinics’ mean wait increased by 5 minutes more than the control clinics’ mean wait increased. The treated group’s higher baseline mean is not itself the DiD contrast. These hypothetical means alone do not establish that the program caused the relative increase.
Worked Example: The Treated Group Changes Less
Hypothetical data. A policy is introduced in a set of districts, and the outcome is monthly service calls per 1,000 residents. The treated districts’ mean is 120 before the policy and 126 afterward. The control districts’ mean is 110 before and 121 afterward. Calculate and interpret the DiD contrast.
The treated-group change is \(126-120=6\) calls per 1,000 residents per month. The control-group change is \(121-110=11\) calls per 1,000 residents per month. Therefore,
The negative sign means the treated districts’ mean increased by 5 fewer calls per 1,000 residents per month than the control districts’ mean increased. Check using the gaps: the treated-control gap was \(120-110=10\) before and \(126-121=5\) afterward. Its change is \(5-10=-5\), the same result.
It would be inaccurate to say that service calls fell in the treated districts: their mean rose from 120 to 126. The negative DiD contrast describes a smaller increase relative to the control group, not an absolute decline in the treated group.
Worked Example: A Declining Outcome in Both Groups
Hypothetical data. A prevention program is offered in some communities. The outcome is the mean number of missed workdays per employee during a fixed period. In the treated communities, the mean falls from 8.0 days before the program to 6.5 days afterward. In control communities, it falls from 7.0 days to 6.0 days. Calculate the DiD contrast.
The treated-group change is \(6.5-8.0=-1.5\) days, and the control-group change is \(6.0-7.0=-1.0\) day. Thus,
Both groups’ mean number of missed workdays declined. The contrast says the treated-group mean declined by 0.5 days more than the control-group mean declined. The gap check gives the same answer: the treated-control gap was \(8.0-7.0=1.0\) day before and \(6.5-6.0=0.5\) day afterward; \(0.5-1.0=-0.5\) days. Because fewer missed workdays is favorable in this example, the direction of this relative change is favorable, but the calculation by itself does not show that the program caused it.
Reading the Number Without Overclaiming
A DiD contrast is measured in the same units as the outcome. If the outcome is minutes, the contrast is in minutes; if it is a rate per 1,000 people, the contrast retains that rate’s units. When the outcome is a percentage, differences are usually expressed in percentage points. For example, a change from 12% to 10% is a decrease of 2 percentage points, not a 2% decrease.
The calculation is descriptive of the four means. A causal interpretation requires additional assumptions about how the treated group would have changed without treatment; those assumptions are not established merely by computing the contrast or observing four means. Therefore, report the numerical contrast first, and qualify any causal wording according to the design and its assumptions.
Common Mistakes
- Comparing only post-period means. In the first example, the post-period gap is 13 minutes, but the DiD is 5 minutes because the baseline gap was already 8 minutes. Compare changes, or equivalently compare the two gaps.
- Subtracting in inconsistent directions. Using pre minus post for one group and post minus pre for the other reverses or distorts the result. Use post minus pre for both groups, then treated minus control.
- Interpreting a negative contrast as a decline in the treated group. A negative contrast means the treated group changed less, or declined more, than the control group. Inspect each group’s own change before describing what happened.
- Calling the calculation a causal effect without qualification. The four means determine the contrast, but do not by themselves verify the assumptions needed for causal interpretation.
Check Your Understanding
Use the order post minus pre within each group, then treated minus control.
- A treated group’s mean is 24 before and 30 after; a control group’s mean is 20 before and 23 after. Calculate both changes and the DiD contrast.
- In Question 1, what are the baseline and post-period treated-control gaps? Verify the contrast using their difference.
- A treated group’s outcome falls by 4 units, while a control group’s outcome falls by 1 unit. What is the DiD contrast, and what does its sign describe?
- Why is the post-period treated-control gap generally not the same as the DiD contrast?
- What additional qualification is needed before describing a calculated DiD contrast as a causal effect?