Pooled Cross Sections and Difference-in-Differences

Learn to estimate the effects of policies with data collected at different points in time. Pool independent cross sections with year dummies and test whether relationships change, compute and estimate difference-in-differences from natural experiments, judge the parallel-trends assumption with pre-policy data, placebo tests and triple differences, and remove unobserved, time-constant differences with first-differenced two-period panel data. Worked examples include the New Jersey minimum wage increase and a garbage incinerator's effect on house prices.

IntermediateLesson 7 of 8 in Econometrics 1 Course

What you will learn

  1. Combine random samples drawn in different years into one regression, let the intercept shift between years and test whether the effects of the explanatory variables have changed.
    • Combine cross sections from different years with year dummies
      Recognize an independently pooled cross section, explain why pooling helps, and use year dummies to absorb changes over time.
    • Test whether effects change over time
      Interact year dummies with explanatory variables to let slopes differ between years, interpret the interaction terms and test for structural change with t and F tests.
  2. Use natural experiments to evaluate a policy, compute the difference-in-differences estimate from four group means and estimate it by regression with standard errors and controls.
    • Explain natural experiments and why simple comparisons mislead
      Describe the counterfactual question behind policy evaluation, recognize a natural experiment, and explain why before-after and treated-control comparisons alone are biased.
    • Compute the difference-in-differences estimate from group means
      Calculate the difference-in-differences estimate step by step from four group means, interpret its sign and size, and connect it to the counterfactual.
    • Estimate and interpret the difference-in-differences regression
      Write the difference-in-differences regression, match each coefficient to the group means, add control variables appropriately, and report standard errors and percentage effects.
  3. State the assumption that makes difference-in-differences causal, recognize what violates it and judge its plausibility with pre-policy data, placebo tests and triple differences.
    • State the parallel-trends assumption and what it implies
      Express parallel trends in words and symbols, show how it turns the difference-in-differences estimate into the treatment effect, and see why its plausibility depends on how the outcome is measured.
    • Recognize threats that break a difference-in-differences design
      Identify the situations that violate parallel trends or the other conditions of a difference-in-differences study, and explain the direction of the resulting bias.
    • Check plausibility with pre-trends, placebo tests and triple differences
      Use data from before the policy, placebo groups and outcomes, alternative control groups and the triple-difference estimator to judge and strengthen a difference-in-differences design.
  4. Model two-period panel data with an unobserved, time-constant effect, remove it by first differencing and use the differenced equation to evaluate programs.
    • Set up two-period panel data and the unobserved effects model
      Describe the structure of two-period panel data, write the unobserved effects model and explain why pooled OLS is biased when the unobserved effect is correlated with the regressors.
    • Estimate by first differencing and know its assumptions
      Derive the first-differenced equation, estimate it by OLS, interpret its coefficients and check the conditions under which it is unbiased and precise.
    • Evaluate programs with first-differenced panel data
      Apply first differencing to a program-participation dummy, show that it equals difference-in-differences with panel data, and handle controls, attrition and more than two periods.

Difference-in-Differences study guide

4 chapters

1

Pool independent cross sections across time

Combining surveys from different years gives more observations and lets you study how economic relationships change. Begin by identifying whether the samples are independent or follow the same units. Then use year dummies to allow different starting levels and interactions to allow different slopes. The way you specify these terms determines which comparison each coefficient makes and which restrictions a stability test should impose.

1.1 Fresh samples and year effects

An independently pooled cross section combines fresh random samples from the same population in different years. A household surveyed in one year usually appears only once. Pooling increases the sample size and lets you investigate changes that a single year's survey cannot show.

Know what was sampled

A panel follows the same units; independently pooled cross sections draw each year's sample afresh. Under independent sampling, observations from different years are independent. Their distributions can still differ: the population, average outcome and error variance may change. Use heteroskedasticity-robust standard errors when a common variance is doubtful. A larger pool improves precision when the model represents the relationship across those years.

Give each year an intercept

For samples from 2015 and 2023, let y23 equal 1 in 2023 and 0 in 2015. Fit

y=β0+δ0y23+β1x1+⋯+βkxk+u.

The 2015 intercept is β0; the 2023 intercept is β0+δ0. The coefficient δ0 compares years holding the regressors fixed. It can absorb changes in prices, productivity or tastes that shift the expected outcome across years. It does not identify which of those forces caused the shift.

With T years and an intercept, include T−1 year dummies. The omitted year is the base year. If every year has its own dummy, the dummies sum to the intercept column, creating perfect collinearity. Changing the base year changes the comparisons in the coefficient table, but leaves fitted outcomes unchanged.

Read a pooled wage equation

Suppose 1,800 workers from 2015 and 2,100 from 2023 give 3,900 observations. A fitted log-earnings model contains 0.18y23+0.085educ and controls for experience. For workers with equal education and experience, the fitted log earnings are 0.18 higher in 2023. That is 18 log points; the exact proportional comparison is

100(e0.18−1)≈19.7%.

A raw increase of 0.25 in average log earnings would answer a different question. It includes changes in worker characteristics as well as the adjusted year shift. For example, a more educated later workforce can raise the raw mean even with the same education slope.

Separate nominal and real changes

Current-money earnings are nominal. To compare purchasing power, divide by the appropriate price index. For a logged outcome,

log⁡(realt)=log⁡(nominalt)−log⁡(Pt).

If everyone in a year uses the same index, this subtraction is a year-specific constant. With year dummies, it changes the intercept by −log⁡(Pbase) and the year coefficient by −log⁡(Pt/Pbase), leaving the slopes unchanged. If the base-year index is 1, the intercept stays unchanged. A nominal year shift can therefore include inflation even when the estimated education slope is unaffected by deflation.

Key Takeaways

  • Fresh samples across years are pooled cross sections; tracking the same units creates a panel.
  • Year coefficients compare outcomes at fixed regressor values.
  • An intercept and T years require T − 1 year dummies.
  • Independent sampling permits different error variances across years.
  • Deflating a log outcome with a common yearly index shifts year effects, not slopes.

1.2 Changing slopes and joint tests

A year dummy shifts the intercept. To let an explanatory variable's effect change too, multiply it by the year dummy. This interaction measures a difference between slopes, not the later slope by itself.

Build the two slopes

Consider

log⁡(wage)=β0+δ0y23+β1educ+δ1y23⋅educ+u.

In 2015, y23=0, so the education slope is β1. In 2023, y23=1, so it is β1+δ1. Keep the main education term: omitting it would force the base-year slope to zero.

If the estimates are 0.070 and 0.015, the approximate return per extra year of education rises from 7.0% to 8.5%. The increase is 1.5 percentage points in these approximate returns. To test whether it changed, test H0:δ1=0. A standard error of 0.005 gives

t=0.015/0.005=3.0.

That exceeds the large-sample two-sided 5% cutoff of about 1.96.

Interact a group dummy

The same logic applies to a dummy regressor. Estimates of −0.30 on female and 0.08 on y23⋅female imply female-minus-male log-wage gaps of −0.30 in 2015 and −0.22 in 2023. These are gaps of 30 and 22 log points. The exact comparisons are about 25.9% and 19.7% lower wages for women with the same included characteristics. The positive interaction means the negative gap narrowed; it does not mean the later gap became positive.

Test several changes together

For k regressors, fully interact the year dummy with every regressor. The unrestricted model has 2(k+1) parameters. A slope-stability test sets the k slope interactions to zero but keeps the intercept shift. A full Chow test also sets the intercept shift to zero, imposing k+1 restrictions. Choose the restrictions to match the question being asked.

Under homoskedasticity, the joint-test statistic is

F=(SSRr−SSRur)/qSSRur/(n−2(k+1)).

The restricted model imposes the null; the unrestricted model allows both years' coefficients to differ. With n=3,900, k=3, q=3, SSRr=812.4 and SSRur=806.1, the unrestricted residual degrees of freedom are 3,892. Then

F=6.3/3806.1/3,892≈10.14.

This exceeds a 5% critical value of about 2.6, rejecting stable slopes. Testing three interactions separately would answer three individual questions, not this joint one.

Choose a valid test

Fully interacting the pooled model gives the same coefficient estimates as separate regressions for the two years. Its unrestricted SSR is the sum of their SSRs. This makes differences and their standard errors convenient to obtain in one equation. The classical SSR-based F test requires a common error variance; use a heteroskedasticity-robust joint test when variances differ across years.

Key Takeaways

  • An interaction with a year dummy is the change in a slope.
  • The later slope adds the base-year slope and its interaction.
  • A slope-stability test retains the intercept shift; a full Chow test restricts it too.
  • The unrestricted two-year model has 2(k + 1) parameters.
  • Joint hypotheses need joint tests.
  • Use a robust joint test when the common-variance assumption is doubtful.
2

Estimate policy effects with difference-in-differences

A policy effect is a comparison with a missing outcome: what treated units would have experienced without the policy. A before-after change and a single treated-control gap each leave part of that problem unresolved. Build a comparison from both groups in both periods, work out the implied counterfactual, and express the same calculation as a regression. Read its coefficient together with its units, controls and uncertainty.

2.1 Finding a credible counterfactual

Policy evaluation asks what changed because of a policy. Observing an outcome after implementation is not enough: you also need a credible estimate of what would have happened without the policy.

Name the missing outcome

Write Y(1) for an outcome with treatment and Y(0) for the outcome without it. A treated unit reveals Y(1) after implementation, but its Y(0) in that same period is unobserved. That missing outcome is the counterfactual. The average treatment effect on the treated, or ATT, averages Y(1)−Y(0) over treated units after the policy. It is an average for those units and that period.

A natural experiment occurs when an event outside the researcher's control changes conditions for some units but not others. A law, a new program or the siting of a facility may create a treatment group and an unaffected comparison group. Assignment is not random, so systematic starting differences remain possible.

Why a single comparison misleads

A before-after comparison within the treated group includes the policy effect and everything else that changed over time. If a recession reduces employment, the observed change mixes the policy with that recession. The comparison needs a zero untreated change to isolate the effect.

An after-only comparison between treated and control groups includes the effect and any gap that would have existed without treatment. It isolates the effect only if the two groups would otherwise have had equal after-period outcomes.

ComparisonWhat can get mixed with the policy effect?
Treated after minus treated beforeOther changes over time
Treated after minus control afterPre-existing or other untreated group differences

Near a planned garbage incinerator in North Andover, Massachusetts, houses within about 4.8 km sold for 30,688 dollars less than farther houses in 1981, measured in 1978 prices. But their 1978 gap was already 18,824 dollars. Rumors began after 1978 and construction started in 1981. Assigning the entire later gap to the incinerator would include a large earlier difference.

Construct four comparison cells

Use data for both groups before and after the event. The cells are control-before, control-after, treated-before and treated-after. Repeated cross sections can fill them using fresh samples; panels can fill them by revisiting the same units.

Card and Krueger studied New Jersey's April 1, 1992 minimum wage increase from $4.25 to $5.05 per hour. Eastern Pennsylvania kept $4.25. They surveyed 410 fast-food restaurants in February–March and November–December 1992. The same restaurants were followed, making this a panel example. Pennsylvania supplied a comparison exposed to similar regional conditions without the wage increase.

Choose a control group whose untreated change is informative about the treatment group's missing change. Equal starting means are unnecessary. Similar starting levels alone are also insufficient: two equally productive regions may face very different subsequent shocks.

Key Takeaways

  • The counterfactual is the treated group’s outcome without treatment in the after period.
  • The ATT averages treatment effects over treated units.
  • Before-after comparisons include other time changes; after-only comparisons include untreated group gaps.
  • A useful control supplies the treated group’s missing untreated change.

2.2 From four means to a policy estimate

Difference-in-differences (DiD) uses four means to remove a fixed group gap and a shared time change. Calculate changes in a consistent direction: after minus before within each group, then treated minus control.

Work through the two changes

Let yˉ denote a sample mean. The estimator is

DiD^=(yˉT,after−yˉT,before)−(yˉC,after−yˉC,before).

In the Card–Krueger study, employment is measured in full-time-equivalent (FTE) workers per restaurant, counting a part-time worker as half a full-time worker.

GroupBeforeAfterChange
New Jersey20.4421.03+0.59
Pennsylvania23.3321.17−2.16

First find New Jersey's change: 21.03−20.44=0.59. Next find Pennsylvania's: 21.17−23.33=−2.16. Subtract the comparison change:

0.59−(−2.16)=2.75.

Employment rose by an estimated 2.75 FTE workers per restaurant relative to the comparison path. The raw New Jersey gain of 0.59 leaves out the decline observed in Pennsylvania.

See the counterfactual

Under parallel untreated trends, New Jersey without the increase would have shared Pennsylvania's change. Add that change to New Jersey's baseline:

20.44+(−2.16)=18.28.

The observed after-period mean is 21.03, so its distance above the counterfactual is 21.03−18.28=2.75. The treatment group can remain below the control group's level and still have a positive estimated treatment effect.

You can instead subtract group gaps. The treated-minus-control gap changes from 20.44−23.33=−2.89 before to 21.03−21.17=−0.14 after. Its change is again −0.14−(−2.89)=2.75. Mixing directions between the two periods would destroy this equivalence.

Interpret the published result

The paper reports 2.76 using unrounded data, with a standard error of 1.36. The resulting t statistic is about 2.03, and the estimate is about 13% of New Jersey's starting employment level. The positive result challenged the simple competitive labor-market prediction of lower employment after a higher minimum wage. Survey measurement and later payroll-based evidence became part of the debate.

Keep the outcome's units

A city introducing time-of-use electricity prices sees household use fall from 310 to 280 kWh per month. A comparison city falls from 300 to 295. The treated change is −30 and the control change is −5:

−30−(−5)=−25.

The estimated reduction is 25 kWh per household per month relative to the untreated path, assuming the design's causal conditions hold. A negative effect is a reduction in the measured outcome; whether that is desirable depends on what the outcome measures.

Key Takeaways

  • DiD subtracts the control change from the treated change.
  • The counterfactual equals the treated baseline plus the control change.
  • Changing group gaps gives the same estimate when subtraction directions are consistent.
  • Report the estimate in the outcome’s units and for the treated population.
  • Rounded means can give a slightly different result from unrounded data.

2.3 DiD in a regression

A DiD regression reproduces the four-cell comparison and provides a standard error. It also allows controls, but the coefficient still needs a credible comparison design to receive a causal interpretation.

Match coefficients to cells

Let after equal 1 after the policy and treat equal 1 for the affected group. Estimate

y=β0+δ0after+β1treat+δ1(after⋅treat)+u.

Substitute each pair of dummy values:

CellFitted mean
Control beforeβ0
Control afterβ0+δ0
Treated beforeβ0+β1
Treated afterβ0+δ0+β1+δ1

The interaction δ1 is DiD. The group main effect β1 is the baseline gap; the time main effect δ0 is the control group's change. Keep both main effects so the interaction measures the additional treated change.

For the rounded restaurant means, the estimates are β^0=23.33, β^1=−2.89, δ^0=−2.16 and δ^1=2.75. The treated-after prediction is 23.33−2.16−2.89+2.75=21.03. Without controls, OLS fits each cell mean exactly, so its interaction equals the raw DiD.

Add controls with a purpose

Add xγ for suitable observed characteristics. Controls can improve precision and adjust for different sample composition across repeated cross sections. They should describe factors the policy cannot change. Controlling for a variable changed by treatment can remove part of the effect you want to measure. Assess that causal role before adding a convenient predictor.

In the incinerator example, the real-price DiD without controls is about −11,864 dollars. With a logged price outcome, the uncontrolled interaction is about −0.063 and statistically insignificant; after house controls it is about −0.132 and significant at 5%. The houses sold near the site changed across samples, so adjusting for their characteristics matters. With controls, the interaction need not equal the four raw means' DiD.

Read logs and uncertainty

For a log coefficient b, the approximate proportional effect is 100b percent. Transforming the fitted log comparison gives 100(eb−1) percent: −0.132 corresponds to about 12.4% lower fitted prices, compared with the 13.2% approximation. This is a multiplicative comparison on the log-model scale; interpreting it as a change in the arithmetic mean price also needs an appropriate retransformation of the errors. A coefficient of −0.10 similarly gives about 9.5% lower fitted values.

Test a zero interaction with its standard error and report a confidence interval. Heteroskedasticity-robust errors address unequal observation-level variances. When a policy varies by state or city, shared shocks create within-group dependence, so inference must allow for it. Many individual observations in just one treated and one control location cannot separate the policy from a treated-location after-period shock.

Fit the same model in software

These commands include both main effects and the interaction:

fit <- lm(y ~ treat * after, data = df)
regress y i.treat##i.after, vce(robust)
import statsmodels.formula.api as smf
fit = smf.ols("y ~ treat * after", data=df).fit(cov_type="HC1")

R's lm fits the coefficients; its default printed standard errors are conventional. The Stata and Python commands request heteroskedasticity-robust errors. Those requests do not address within-location correlation. Identify the interaction by its variable names, and read the coefficient together with the design and the uncertainty estimate.

Key Takeaways

  • The after × treat coefficient is DiD; both main effects remain in the model.
  • Without controls, the interaction equals the four-means DiD.
  • Controls should not absorb changes caused by treatment.
  • A log coefficient transforms through 100(eᵇ − 1) for a proportional comparison.
  • Unequal variances and shared group shocks require different standard-error adjustments.
  • More individuals do not replace independent policy-level comparisons.
3

Assess the parallel-trends assumption

Difference-in-differences becomes a causal comparison through an assumption about the untreated path. Learning to calculate the estimator is only the first part of evaluating a policy. Examine what must be true of the comparison group, how temporary shocks or changing samples can undermine the result, and what earlier outcomes can reveal. A third comparison can remove additional trends, but it also brings a specific assumption to assess.

3.1 The untreated change assumption

Parallel trends states that, without treatment, the treated group's average outcome would have changed by the same amount as the control group's. The assumption supplies the untreated change that cannot be observed for treated units after the policy.

State what must be parallel

In potential-outcome notation,

E[Y(0)after−Y(0)before∣treated]=E[Y(0)after−Y(0)before∣control].

The groups may start at different levels. A permanent gap is compatible with parallel trends because DiD removes that gap. A shared recession is also compatible if it produces the same untreated change in both groups. A recession that affects the treated group more strongly creates a trend difference.

This concerns the path without the policy, not the observed path after it. If a successful policy makes treated outcomes rise faster, the observed lines should separate. Requiring the observed after-period lines to stay parallel would rule out the very treatment effect being estimated.

Separate effect from trend bias

The treated group's observed change is its treatment effect plus its untreated change. Subtracting the control change gives

DiD=ATT+(ΔYˉ(0)T−ΔYˉ(0)C).

Under parallel trends, the term in parentheses is zero. If the treated group would have grown 3 units more even without treatment and the true effect is 2, DiD is 2+3=5. The extra 3 is bias from the untreated trend gap. A negative trend gap would pull the estimate downward instead.

Draw the missing path

On a graph of mean outcomes over time, start a dashed counterfactual at the treated group's before mean. Move it by the control group's observed change. The vertical distance from that dashed after point to the treated group's actual after mean is DiD. The dashed path is inferred, not an additional set of observed treated outcomes.

The treated group's untreated after mean is missing, so the assumption cannot be directly checked for the policy period. Earlier observations can support its plausibility, while the possibility of a new group-specific shock still needs substantive investigation.

Choose levels or logs deliberately

Parallel changes in units and parallel proportional changes are different assumptions. If representative outcomes go from 100 to 110 in one group and 50 to 60 in another, both rise by 10. Their log changes differ:

log⁡(110/100)≈0.095,log⁡(60/50)≈0.182.

For positive representative group levels that start unequal, a common nonzero additive change cannot also be a common proportional change. Choose the scale using the economic question and evidence about untreated paths. For individual-level data, average the logged outcomes when evaluating mean-log trends; taking the log of each arithmetic group mean can answer a different question.

Key Takeaways

  • Parallel trends concerns untreated average changes, not equal starting levels.
  • DiD equals ATT plus the untreated trend difference.
  • Observed post-policy divergence can be the treatment effect.
  • Pre-policy evidence cannot reveal the treated group’s missing untreated after outcome.
  • Parallel trends in levels and in logs are different assumptions.

3.2 How the comparison can fail

A DiD coefficient combines every force that changes the treated-minus-control gap. To interpret it causally, investigate why that gap might have moved even without the policy and whether the baseline or control group was already affected.

Different trends and temporary shocks

A treated region may have faster underlying employment growth because its population is growing more quickly. DiD then assigns some of that growth to the policy, biasing the estimated employment effect upward. Slower untreated growth biases it downward. Geographic closeness is helpful only if it makes the relevant changes comparable.

Selection on temporary shocks causes another problem. People may join job training after an unusually low-earnings year. This pre-enrollment decline is the Ashenfelter dip. Even without training, part of the temporary decline would reverse. Using the dip as the baseline makes the recovery look like a program effect. A permanent low earnings level can be differenced away; a temporary shock and subsequent rebound cannot.

An affected baseline or comparison group

Anticipation means units react before formal implementation. Firms might change hiring when a policy is announced. The New Jersey increase was legislated in 1990, so adjustment could precede the 1992 before survey. A baseline before announcement reduces the risk of measuring only the remaining adjustment.

Spillovers occur when the policy changes control outcomes too. Cross-border commuting or customer movement can transmit a wage policy's effects to another state. If a policy raises the control outcome, subtracting that increase pushes the measured effect down. If it lowers the control outcome, subtraction pushes the estimate up. The direction follows the spillover's sign, not the label "spillover".

Other events and different samples

A separate tax change introduced only in the treated state at the same time enters the same after-by-treatment cell as the policy of interest. A simple two-by-two comparison cannot distinguish their effects. More restaurants within the two states do not create a separate policy comparison.

With pooled cross sections, the sampled units can also change. Suppose higher-income households move into a treated area after a transport improvement. An increase in average earnings may partly reflect the newcomers. Controls for characteristics unaffected by the policy can help compare more similar samples. A characteristic changed by the policy may instead be a channel through which the policy works, so controlling for it changes the question.

Keep two validity questions separate

Internal validity asks whether the comparison identifies the effect for the treated population and period studied. The threats above concern that question. External validity asks whether the result carries to other settings, populations or policy sizes. A well-identified effect in 1992 fast-food restaurants need not be the effect of a much larger wage change in another industry. A precise estimate can have weak internal validity, and a credible local estimate can have limited external reach.

Key Takeaways

  • An untreated trend advantage biases DiD upward; a disadvantage biases it downward.
  • A temporary dip followed by recovery can mimic a program effect.
  • Anticipation affects the baseline; spillovers affect the comparison path.
  • A simultaneous treated-only event is mixed with the policy in a two-by-two design.
  • Composition changes alter who contributes to group means.
  • Internal validity concerns the studied effect; external validity concerns transfer.

3.3 Evidence about the comparison path

A credible DiD analysis assembles evidence about the comparison path. Earlier outcomes, unaffected groups and other control groups can reveal weaknesses that a single before-after table hides.

Examine pre-policy changes

Plot several pre-policy means for each group on the same time axis. Treated means of 50, 52 and 54 and control means of 40, 42 and 44 show equal increases of 2 per year despite a gap of 10. Diverging earlier lines make a common untreated future change less plausible.

A fake-date placebo places an imaginary policy between two pre-policy years. Here its DiD is (52−50)−(42−40)=0. If the treated mean instead rose from 50 to 54 while the control rose from 40 to 42, the placebo would be 2. That result would reveal differential movement before the actual policy.

A small pre-trend estimate with a wide confidence interval leaves important trend gaps possible. Also, a shock beginning exactly with the policy will escape a pre-period check. Interpret the evidence together with what was happening in each location.

Change the comparison

A placebo group should be unaffected by the policy. In a minimum wage study, restaurants already paying well above the new minimum provide a useful check if the policy has no relevant effect on them. A large apparent effect there points toward other changes. A placebo outcome is one the policy cannot plausibly affect; a change in it can likewise signal a competing explanation.

Try alternative control groups that have a substantive reason to represent the untreated path. Similar estimates across reasonable controls reduce concern about one comparison group's unusual trend.

Add a third difference

Triple differences (DDD) adds an unaffected subgroup inside each location. Suppose a health policy in state B applies to people aged 65 and older. Compare the change for older versus younger people in B, then subtract the same age-group change gap in untreated state A.

StateOlder changeYounger changeOlder minus younger
B+8+3+5
A+4+2+2

The estimate is 5−2=3 units. Subtracting the younger change removes a shared state change; subtracting the age gap in A removes the age-specific change common across states.

DDD requires the older-minus-younger untreated trend gap to be the same in both states. It allows location-specific and age-specific changes that add together. A shock affecting only older people in B still has the same pattern as treatment and remains a problem.

The regression includes the time, state and age dummies, every pairwise interaction, and after⋅stateB⋅older. Its triple-interaction coefficient is DDD. Dropping a lower-order term forces an unrelated difference to zero and can contaminate that coefficient.

Key Takeaways

  • Compare pre-policy changes even when group levels differ.
  • Fake dates, unaffected groups and unaffected outcomes probe different weaknesses.
  • A passing check supports the design while leaving policy-period shocks unresolved.
  • DDD subtracts one subgroup DiD from the corresponding DiD in another location.
  • DDD needs a common untreated subgroup trend gap across locations.
  • The DDD regression retains all main and pairwise terms.
4

Remove unobserved effects with two-period panel data

Following the same units twice gives a direct way to handle permanent differences that are hard to measure. Separate those stable factors from temporary shocks, then subtract the earlier equation from the later one. First differencing changes the information used to estimate a slope and removes some regressors entirely. Its program-evaluation form connects to DiD, while feedback, missing units and changing controls still need attention.

4.1 Stable differences within a panel

Two-period panel data observe the same units twice. Revisiting each person, firm or city makes it possible to compare its outcome with its own earlier outcome, removing permanent unit differences from the change.

Organize units and periods

A balanced panel has observations for every unit in both periods. In long format, each unit-period pair has its own row: N units create 2N rows. A unit identifier and period variable tell you which rows belong together. In wide format, each unit has one row with separate outcome and regressor columns for the two periods.

Independently pooled cross sections do not supply these pairs. Their new samples allow changes in population means, but you cannot calculate a person's change by subtracting another sampled person's earlier value.

Split the unobserved factors

Write the two-period unobserved effects model as

yit=β0+δ0d2t+β1xit+ai+uit.

Here d2t is 0 in the first period and 1 in the second. The effect ai differs across units but stays constant within each unit. It can represent permanent geography, stable managerial quality or a worker's ability. The idiosyncratic error uit varies across units and periods, such as a temporary disruption to one firm's production.

The time dummy captures a common shift between periods. It cannot absorb a separate permanent factor for every unit. Likewise, a permanent unit effect cannot absorb a shock that changes differently across units over time.

Understand heterogeneity bias

Pooled OLS puts the two periods into one regression and leaves the composite error vit=ai+uit. If ai is correlated with the regressors, that correlation causes omitted variable bias and inconsistency. This is heterogeneity bias. The issue is correlation, not simply how large permanent differences are.

Three cities illustrate the risk. Their unemployment percentages and crimes per 1,000 residents are A: (4, 50) then (6, 54); B: (8, 30) then (9, 32); C: (10, 20) then (12, 24). Within each city, more unemployment accompanies more crime. Across cities, however, the lower-unemployment cities have higher crime for permanent reasons. Pooled OLS with a second-period dummy gives a slope of −5.0. That negative slope blends the across-city differences with the within-city relationship.

Distinguish bias from dependence

Even if the permanent effect is uncorrelated with the regressors, it appears in both observations for a unit. The two composite errors can therefore be correlated. Treating the 2N rows as independent gives an inappropriate standard-error calculation. Inference must allow correlation within units.

Correcting that dependence changes uncertainty estimates; it does not remove the omitted-variable correlation that caused heterogeneity bias. A model needs an identification strategy for the permanent factors as well as an appropriate calculation of its uncertainty.

Key Takeaways

  • A two-period panel pairs each unit with itself across time.
  • The unobserved effect is constant within a unit; the idiosyncratic error changes.
  • Correlation between permanent effects and regressors causes heterogeneity bias.
  • Within-unit error dependence concerns standard errors even without heterogeneity bias.

4.2 Regress changes on changes

First differencing (FD) subtracts each unit's first equation from its second. Because its unobserved effect is the same in both periods, that factor cancels without needing to be measured.

Derive the change equation

Subtract the levels equations term by term. The common constant β0 cancels; the second-period dummy changes by 1; ai−ai=0. Thus

Δyi=δ0+β1Δxi+Δui,

where each delta means period 2 minus period 1 for the same unit. Keep an intercept: it estimates δ0, the common time shift. The slope still estimates the original relationship between the regressor and outcome, now from variation in changes across units.

For the three cities, unemployment changes are 2, 1 and 2 percentage points, and crime changes are 4, 2 and 4 per 1,000 residents. Their FD regression is Δcrime^=0+2.0Δunem. The slope is positive, unlike the pooled slope of −5.0 distorted by permanent city differences.

Calculate OLS on changes

For five other cities, let unemployment changes be (−1, 0, 1, 2, 3) and crime changes be (−1, 3, 2, 6, 7). The means are 1 and 3.4. OLS uses deviations from these means, just as in a levels regression. The cross-product sum is 19 and the squared regressor-deviation sum is 10:

β^1=19/10=1.9,δ^0=3.4−1.9(1)=1.5.

The predicted crime change is 1.5 at zero unemployment change. An additional percentage point of unemployment change adds 1.9 crimes per 1,000 to the fitted change.

Check what differencing leaves behind

Unbiasedness requires E[Δui∣Δxi]=0. Strict exogeneity is a sufficient condition: each period's idiosyncratic error has mean zero given regressors in both periods and the unit effect. Merely zero correlation between changes in the regressor and error supports consistency under the usual sampling conditions, but is weaker than the conditional-mean requirement for unbiasedness.

Feedback can violate strict exogeneity. If a crime shock prompts more police hiring next period, the future regressor responds to an earlier error. Differencing removes permanent city traits, but leaves that connection between changes. A lagged dependent variable also creates a problem: the earlier outcome contains the earlier error, which enters the differenced error with a minus sign.

Time-constant regressors, such as birthplace or distance to the coast, also cancel. Their separate levels effects cannot be estimated by FD. Their interaction with the second-period dummy can remain: its change equals the time-constant characteristic, allowing its effect to change between periods.

Check information and implementation

Changes in a regressor must vary across units. Little variation makes slope estimates imprecise; differencing can also increase the importance of measurement error and worsen attenuation bias. Use usual OLS standard errors if differenced errors are homoskedastic and independent across units, and robust errors if their variances differ.

In Stata, code period as 1 and 2:

xtset city period
regress D.crime D.unem, vce(robust)

For actual years 2015 and 2023, xtset city year, delta(8) declares the interval; a default one-year interval would yield missing differences. In R, compute within-city changes or use plm(crime ~ unem, data = pdata, model = "fd") with a correctly indexed panel. In Python, sort before differencing:

ordered = df.sort_values(["city", "period"])
d = ordered.groupby("city")[["crime", "unem"]].diff().dropna()
fit = smf.ols("crime ~ unem", data=d).fit(cov_type="HC1")

The columns in d now hold changes. Grouping prevents the last row of one city from becoming the baseline for another.

Key Takeaways

  • FD removes every additive factor constant within a unit.
  • The differenced intercept estimates the common time shift.
  • Strict exogeneity is sufficient for the conditional-mean condition behind FD unbiasedness.
  • Time-constant regressors disappear unless entered through a time-varying interaction.
  • Weak change variation and measurement error can make FD less useful.
  • Sort and difference within units, using the correct time interval.

4.3 Program effects from panel changes

A program-participation dummy can be first-differenced just like any other regressor. When nobody participates initially, the resulting regression compares the outcome changes of later participants and nonparticipants.

Connect FD with DiD

Start with

yit=β0+δ0d2t+β1progit+ai+uit.

Subtract the first period:

Δyi=δ0+β1Δprogi+Δui.

If everyone starts untreated, Δprogi is 1 for new participants and 0 for nonparticipants. With no controls, the OLS slope is the participants' mean change minus the nonparticipants' mean change: panel DiD. The intercept is the mean change among nonparticipants.

Firms receiving a training grant reduce defective items per 100 produced from 4.6 to 3.5, a change of −1.1. Firms without grants move from 3.9 to 3.7, a change of −0.2. The estimate is −1.1−(−0.2)=−0.9 defective items per 100. It compares the treated change with the untreated path, not with zero change. If the outcome is log scrap rate and the coefficient is −0.25, the corresponding fitted proportional comparison is about 22.1% lower.

What the panel contributes

Both repeated-cross-section and panel DiD permit permanent group differences under their identifying conditions. A panel additionally compares each unit with itself and removes its own ai. Participation may depend on permanent characteristics, such as stable management quality, while the FD estimator remains unbiased if its remaining shocks meet the conditional-mean condition. Following the same units also avoids turnover in sample membership in a balanced panel.

Temporary selection remains a threat. If firms seek grants just after unusually high scrap rates, those rates may partly recover anyway. The change in the error then correlates with the change in participation. A panel does not remove this recovery; parallel untreated changes still underpin the program comparison.

Controls and participation changes

Time-varying controls enter as changes:

Δyi=δ0+β1Δprogi+γΔzi+Δui.

A change in sales or employment may be informative, but do not adjust away a change caused by the program when estimating its total effect. If units can enter or exit treatment, participation changes can be −1, 0 or 1. FD still applies, although a zero change can now describe either continuing participants or continuing nonparticipants.

Track missing units and additional periods

Attrition means units drop out between waves. Losing firms with poor outcomes can bias the observed comparison. Report losses, compare initial characteristics of retained and missing units, and establish whether missingness represents closure or a failure to collect data. A closed firm's employment is zero; an unanswered survey does not establish zero employment.

Card and Krueger followed the same restaurants. Their balanced-sample changes were +0.47 FTE in New Jersey and −2.28 in Pennsylvania, giving 2.75 with a standard error of 1.34. They retained permanently closed restaurants with employment set to zero.

With more than two periods, difference adjacent observations within each unit and include period dummies in the differenced equation. Adjacent error changes share a period's error, so inference must allow within-unit correlation over time.

Key Takeaways

  • With no initial participants, FD on participation changes reproduces panel DiD.
  • A panel removes permanent unit differences but leaves selection on temporary shocks.
  • Time-varying controls enter as changes and should not absorb treatment channels.
  • Treatment entry, no change and exit produce participation changes of 1, 0 and −1.
  • Outcome-related attrition can bias comparisons.
  • Multi-period differencing creates repeated changes within each unit.

Difference-in-Differences examples

4 Walkthroughs

1

Pool surveys and let effects change

13 steps
Build a pooled regression, interpret year interactions and choose a test of stability.
  1. 1
    IntroductionWhat changes between surveys?

    Suppose you have worker surveys from two years, each drawn fresh: pooled cross sections. You want to know whether pay changed for comparable workers and whether education became more strongly associated with pay. Those are separate questions: the first concerns a shift in level (a year dummy), and the second a shift in a slope (a year interaction). Start with how the samples were drawn, then build a regression that can express both comparisons.

  2. 2
    ExplanationIdentify the sample structure

    Fresh independent samples in each year form pooled cross sections. A panel follows the same units over time. The distinction determines whether a unit can be paired with its own earlier observation.

    Pooling can increase precision when the relationship is stable. Independence across samples does not require identical error variances; robust standard errors handle possible heteroskedasticity.

  3. 3
    ExplanationChoose a base year

    Let y23 be 1 for 2023 and 0 for 2015. A pooled model is

    y=β0+δ0y23+β1x+u.

    The omitted year is 2015. Its intercept is β0; the 2023 intercept is β0+δ0. The year coefficient compares outcomes at the same x. With more years, omit one dummy when keeping an intercept, so the year indicators do not duplicate the constant column.

  4. 4
    ExampleRead the adjusted year shift

    Pooling 1,800 workers in 2015 and 2,100 in 2023 gives 3,900 observations. A fitted log-earnings equation contains 0.18y23 and controls for education and experience.

    At fixed education and experience, the log difference is 0.18. The fitted proportional comparison is

    100(e0.18−1)≈19.7%.

    A raw mean-log increase of 0.25 can be larger because worker characteristics also changed.

  5. 5
    ChallengeSeparate the raw and adjusted changes

    A new four-year survey has fresh samples each year. Its raw mean-log income change from the base to the last year is 0.16, and the final year-dummy coefficient is 0.09. With an intercept, how many year dummies are needed, and which figure compares otherwise similar observations?

    ---reveal---

    Use three year dummies. The coefficient 0.09 is the comparison holding included regressors fixed. The raw 0.16 also reflects changed sample characteristics.

  6. 6
    Key InsightDeflating logs changes year effects

    If every nominal outcome in a year is divided by the same price index, the logged outcome loses the constant log⁡(Pt). Year dummies absorb this subtraction, leaving regressor slopes unchanged.

    The base intercept shifts by −log⁡(Pbase), and each year coefficient by −log⁡(Pt/Pbase). When the base index is 1, the intercept stays unchanged. A nominal shift therefore need not represent a purchasing-power gain.

  7. 7
    ExplanationGive education a changing slope

    Add the product of the year indicator and education:

    log⁡(wage)=β0+δ0y23+β1educ+δ1y23⋅educ+u.

    In 2015 the education slope is β1. In 2023 it is β1+δ1. The interaction measures their difference. Keep the education main effect so the base-year slope is estimated instead of forced to zero.

  8. 8
    ExampleTest a slope change

    Estimates of 0.070 for education and 0.015 for its year interaction give approximate returns of 7.0% and 8.5%. To test whether the return changed, use the interaction’s own standard error.

    If that error is 0.005,

    t=0.015/0.005=3.0.

    This exceeds the large-sample two-sided 5% cutoff of about 1.96. The test concerns a change in the education slope, not whether the later slope equals zero.

  9. 9
    ChallengeRead a narrowing group gap

    A log-pay model estimates −0.24 for a group dummy and +0.06 for its later-year interaction. What is the later log-pay gap, and has its sign changed?

    ---reveal---

    The later gap is −0.24+0.06=−0.18. It remains negative but is smaller in magnitude. The positive interaction describes a narrowing gap; it does not replace the baseline coefficient or make the group’s later pay higher.

  10. 10
    ExplanationDefine the joint null

    Fully interacting k regressors across two years estimates 2(k+1) parameters. Testing only the k slope interactions asks whether slopes stayed the same, while retaining a different time intercept.

    The full Chow test also restricts the intercept shift to zero, giving k + 1 restrictions. These nulls answer different questions. Several separate t tests are not a substitute for the requested joint test.

  11. 11
    ExampleCalculate the slope-stability F statistic

    With 3,900 observations and three regressors, the unrestricted model has eight parameters and 3,892 residual degrees of freedom. For slope stability, q = 3. Restricted and unrestricted SSRs are 812.4 and 806.1:

    F=(812.4−806.1)/3806.1/3,892≈10.14.

    The 5% critical value is about 2.6, so the equal-slopes null is rejected under the classical common-variance assumptions.

  12. 12
    ChallengeChoose the right stability test

    A later-year intercept shift is expected, but you want to know whether three slopes changed. Residual variability is substantially larger in the later year. What restrictions and uncertainty calculation fit that question?

    ---reveal---

    Jointly set the three slope interactions to zero while retaining the year dummy. Use a heteroskedasticity-robust joint test. Restricting the year dummy would also test intercept stability, and the classical SSR-based F test assumes a common variance.

  13. 13
    RecapRead the model as comparisons

    Identify fresh samples versus repeated units before fitting a pooled model. Read a year dummy as an adjusted level comparison and a year interaction as a change in slope. For the later slope, add its two components. State the joint restrictions before choosing a stability test, and match its standard errors to the error structure.

2

Build DiD from its missing outcome

18 steps
Move from the policy question to four means, a counterfactual and a regression.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionAsk what would have happened
  2. 2
    ExplanationIdentify the counterfactual
  3. 3
    ExampleUse a policy comparison
  4. 4
    ConnectionWhy one difference is insufficient
  5. 5
    ChallengeChoose a useful untreated path
  6. 6
    ExplanationKeep four cells and two directions
  7. 7
    ExampleCalculate the treated change
  8. 8
    ExampleBuild the untreated after outcome
  9. 9
    ExampleRead the effect and its uncertainty
  10. 10
    ChallengeEstimate a relative reduction
  11. 11
    ExplanationTranslate cells into coefficients
  12. 12
    ExampleRebuild the treated-after mean
  13. 13
    TipControl for causes, not treatment channels
  14. 14
    ExplanationConvert a log comparison
  15. 15
    TipFit main effects and interaction
  16. 16
    ChallengeFind the effect in a new model
  17. 17
    ChallengeSeparate a precise mean from a credible cause
  18. 18
    RecapReport the comparison you estimated
3

Judge the untreated comparison

16 steps
Assess parallel trends, diagnose threats and use placebo checks and triple differences.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionA calculation needs a design
  2. 2
    ExplanationState parallel trends
  3. 3
    ExampleAccount for trend bias
  4. 4
    ConnectionChoose the outcome scale
  5. 5
    ChallengeDistinguish a gap from a trend
  6. 6
    ExplanationDistinguish permanent differences from temporary selection
  7. 7
    ExampleAn announcement can affect the baseline
  8. 8
    Key InsightTrack spillover direction
  9. 9
    ExplanationCheck events and sample membership
  10. 10
    ChallengeExplain the direction of bias
  11. 11
    ExampleTry a fake policy date
  12. 12
    TipProbe the comparison in several ways
  13. 13
    ExampleCalculate the third difference
  14. 14
    ExplanationState the DDD assumption
  15. 15
    ChallengeChoose between comparisons
  16. 16
    RecapMake the remaining assumption explicit
4

Remove permanent effects with changes

20 steps
Derive and interpret first differences, then use them for program evaluation and panel checks.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionCompare a unit with itself
  2. 2
    ExplanationBuild unit-period pairs
  3. 3
    ExplanationSeparate stable and temporary factors
  4. 4
    ExampleSee how pooling can reverse a slope
  5. 5
    ChallengeSeparate bias and dependence
  6. 6
    ExplanationSubtract the equations
  7. 7
    ExampleFit the cities’ changes
  8. 8
    ExampleEstimate a less exact relationship
  9. 9
    ExplanationCheck the error-change condition
  10. 10
    Key InsightFind usable change variation
  11. 11
    ChallengeFit a change model with an intercept
  12. 12
    TipDifference the intended pairs
  13. 13
    ConnectionDifference participation too
  14. 14
    ExampleCalculate a grant effect
  15. 15
    TipCheck why units enter and disappear
  16. 16
    ChallengeKeep a closed firm in the comparison
  17. 17
    ExplanationInclude suitable controls as changes
  18. 18
    ExplanationDifference additional periods
  19. 19
    ChallengeExplain what the panel has solved
  20. 20
    RecapUse changes with their remaining assumptions

Difference-in-Differences practice questions

40 Practice Questions in 4 sets

Set 1: Build the comparison10 Practice Questions

Question 1 of 10

A survey draws a fresh independent sample of firms in each of four years. With an intercept, how many year dummies should a pooled regression include?
  1. 4 year dummies
  2. 3 year dummies
  3. 2 year dummies
  4. 1 year dummy
Show answerHide answer
Answer: B
One year is the base category, so four years require three dummies with an intercept. Including all four would make their sum equal the intercept column, causing perfect collinearity; the number of sampled firms does not change this counting rule.

Question 2 of 10

A log-pay model has an education coefficient of 0.06 and a later-year × education coefficient of −0.01. What is the approximate return to one extra year of education in the later year?
  1. 6%
  2. −1%
  3. 5%
  4. 7%
Show answerHide answer
Answer: C
The later-year slope adds the main education coefficient and its interaction: 0.06−0.01=0.05, or about 5%. The −1% value describes the change in the approximate return, not the return itself; the main coefficient remains part of the later-year effect.

Question 3 of 10

A job program starts during a national recovery. Why can the participants’ earnings increase alone misstate the program’s effect?
  1. It includes earnings growth that would have occurred without training.
  2. It subtracts the earnings growth of people who did not receive training.
  3. It measures only the earnings difference that existed before training.
  4. It removes the economy-wide earnings growth occurring during training.
Show answerHide answer
Answer: A
A treated-only change combines the program effect with other changes over the same period. The recovery could raise earnings without any training. A before-after comparison does not remove that common growth; an informative untreated comparison is needed to estimate it.

Question 4 of 10

After an energy rebate, treated households’ monthly use changes from 260 to 242 kWh. Control households’ use changes from 240 to 234 kWh. What is the DiD estimate?
  1. −18 kWh per household per month
  2. −24 kWh per household per month
  3. +12 kWh per household per month
  4. −12 kWh per household per month
Show answerHide answer
Answer: D
The treated change is −18 kWh and the control change is −6 kWh, so −18−(−6)=−12. The raw reduction of 18 includes the decline seen in the control group. DiD attributes only the extra reduction of 12 kWh to the rebate under the causal assumptions.

Question 5 of 10

A treated district’s mean test score was 64 before a policy. Over the same period, the untreated control mean rose by 7 points. Under parallel trends, what is the treated district’s mean score without the policy afterward?
  1. 64 points
  2. 71 points
  3. 57 points
  4. 7 points
Show answerHide answer
Answer: B
The untreated path applies the control change to the treated baseline: 64+7=71. Keeping the treated counterfactual at 64 would assume no untreated change, even though the control group improved. The treatment effect would compare the actual after score with 71.

Question 6 of 10

In y=β0+δ0after+β1treat+δ1after⋅treat+u, which coefficient measures the treated-minus-control gap before treatment?
  1. δ1
  2. δ0
  3. β0
  4. β1
Show answerHide answer
Answer: D
Before treatment, after=0, so the group gap comes from β1treat. The interaction is zero in that period. Reading δ1 as the baseline gap confuses the initial difference with the additional change that DiD measures.

Question 7 of 10

A policy’s true average effect is 4 units. Without it, the treated group would have increased by 2 units less than the control group. What population DiD would the comparison produce?
  1. 2 units
  2. 6 units
  3. 4 units
  4. −2 units
Show answerHide answer
Answer: A
DiD adds the treatment effect and the untreated trend gap, giving 4+(−2)=2. The slower untreated treated-group growth pulls the estimate downward. Adding a positive 2 would reverse the stated direction of the trend difference and yield the wrong bias.

Question 8 of 10

Employees enroll in training just after an unusually bad earnings year. Their earnings would partly rebound without training. How does using that year as the baseline affect an estimated earnings gain?
  1. It understates the gain because the baseline earnings level is too low.
  2. It leaves the gain unbiased because each employee has a before value.
  3. It overstates the gain because recovery is counted as a training effect.
  4. It removes the recovery because both periods are used in the estimate.
Show answerHide answer
Answer: C
The temporary earnings dip makes the subsequent change unusually positive even without training. DiD can attribute that recovery to the program and overstate its benefit. Observing a baseline for each worker removes neither the temporary shock nor the rebound it creates.

Question 9 of 10

A panel wage model omits stable ability. Ability is positively correlated with education and raises wages. What problem remains if the researcher changes only the standard errors to allow within-worker correlation?
  1. The education coefficient now measures only within-worker changes.
  2. The omitted ability effect is now absorbed by the time dummy.
  3. The two wage observations per worker now become independent.
  4. The education coefficient still has omitted-variable bias.
Show answerHide answer
Answer: D
A correlation-robust standard-error calculation changes the uncertainty estimate, not the regression’s mean specification. Stable ability remains in the composite error and is correlated with education. Removing heterogeneity bias requires addressing that correlation in the estimator.

Question 10 of 10

A balanced panel records firms’ input x and output y as follows. An FD regression includes an intercept. What output change does it predict for an input increase of 3?

FirmBefore (x, y)After (x, y)
L(1, 8)(3, 13)
M(2, 10)(3, 13)
N(4, 11)(4, 12)
  1. 7 output units
  2. 6 output units
  3. 5 output units
  4. 9 output units
Show answerHide answer
Answer: A
The within-firm changes are (2,5),(1,3),(0,1), which lie on Δy=1+2Δx. An increase of 3 therefore predicts 1+2(3)=7. Predicting 6 discards the fitted intercept, which represents the common time change rather than a permanent firm effect.
Set 2: Interpret models and test assumptions10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A two-year regression has two substantive regressors and 206 observations. The fully interacted model has SSR 108; the model keeping the year intercept shift but imposing equal slopes has SSR 120. Under homoskedasticity, what is the F statistic for equal slopes?
  1. About 11.11
  2. About 7.41
  3. About 22.22
  4. About 10.83
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A pooled log-sales model includes an intercept and year dummies. The price index is 1 in the base year and 1.25 in the later year. How does converting every observation to base-year prices change the later-year coefficient?
  1. It stays unchanged because year dummies already capture inflation.
  2. It is divided by 1.25.
  3. It rises by log⁡(1.25).
  4. It falls by log⁡(1.25).
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

After a hiring subsidy, the affected firms employ more workers than unaffected firms. What additional comparison is needed for a simple DiD design?
  1. The treated firms’ after-subsidy employment variance alone.
  2. The control firms’ after-subsidy average employment alone.
  3. The treated-minus-control employment gap before the subsidy.
  4. The share of all firms receiving the subsidy afterward.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A training grant can affect firms’ sales through improved productivity. A researcher adds after-grant sales as a control when estimating the grant’s total effect on employment. Why can this change the effect being estimated?
  1. It always removes only permanent differences in firm size.
  2. It can absorb an employment effect operating through sales.
  3. It ensures the estimate equals the unadjusted four-means DiD.
  4. It replaces the need to account for common changes over time.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Representative untreated outcomes change from 80 to 88 in group A and from 40 to 44 in group B. On which scale do these two paths have equal changes?
  1. Logs, because both outcomes grow by 10%.
  2. Levels, because both outcomes grow by 10%.
  3. Both scales, because both groups grow.
  4. Neither, because the baselines differ.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A treated-region policy raises an outcome by 6 units relative to its no-policy path. It also raises the control region’s outcome by 2 through spillovers. Untreated trends would otherwise match. What DiD is observed?
  1. 8 units
  2. 6 units
  3. 4 units
  4. 2 units
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Two pre-policy waves show treated means of 73 and 76 and control means of 61 and 64. What fake-date placebo DiD do they produce?
  1. 3 units
  2. 12 units
  3. 6 units
  4. 0 units
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A safety program applies only to small firms in region R. Injury rates change from 14 to 8 for small firms and 9 to 7 for large firms in R. In untreated region S, they change from 12 to 9 for small firms and 8 to 7 for large firms. What is the triple difference, R minus S, small minus large?
  1. −4 rate units
  2. −2 rate units
  3. −1 rate unit
  4. +2 rate units
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A city has observations in 2012 and 2020. After xtset city year, Stata reports missing D.output values for both years despite complete output data. How should the researcher declare these two-wave data while retaining calendar years?
  1. xtset city year, delta(1)
  2. xtset year city, delta(8)
  3. xtset city year, delta(8)
  4. xtset city, delta(8)
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A balanced panel has no initial participants. After a grant, a firm’s predicted outcome change is −1 without participation. The estimated participation-change slope is −2. A recipient’s actual outcome falls from 11 to 7. What are its fitted treated change and residual change?
  1. Fitted change −2; residual change −2.
  2. Fitted change −3; residual change −1.
  3. Fitted change −3; residual change +1.
  4. Fitted change −1; residual change −3.
Show answerHide answer

Save this lesson to see this answer.

Set 3: Separate estimates from causal claims10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A log-wage model gives a group-dummy coefficient of −0.25 and a later-year × group coefficient of +0.09, with standard error 0.03 for the interaction. Using a large-sample two-sided 5% test, what conclusion combines the later fitted wage gap and evidence of change?
  1. About 8.6% lower wages later; the gap changed significantly.
  2. About 14.8% lower wages later; the gap did not change significantly.
  3. About 14.8% lower wages later; the gap changed significantly.
  4. About 28.8% lower wages later; the gap did not change significantly.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

An employment policy is adopted in a region with mean employment 42 before treatment; a possible control starts at 35. Earlier evidence shows similar changes, and the control is unaffected by the policy. How should the initial level gap influence the control choice?
  1. The gap requires an after-only comparison instead of DiD.
  2. The gap alone is compatible with a useful DiD control.
  3. The gap makes the comparison invalid regardless of the trends.
  4. The gap means the treatment effect must equal 7 workers.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

After a transport reform, the treated-control gap in average commute time changes from +9 minutes to +4 minutes. What is the DiD estimate, and how should it be read?
  1. +5 minutes; treated commutes rose relative to the control path.
  2. +4 minutes; treated commutes rose relative to the control path.
  3. −9 minutes; treated commutes fell relative to the control path.
  4. −5 minutes; treated commutes fell relative to the control path.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A DiD regression without controls has β^0=30, δ^0=−4, β^1=6 and δ^1=3. The interaction standard error is 1. What are the treated-after fitted mean and the approximate 95% confidence interval for DiD?
  1. Mean 35; interval about [1.04, 4.96].
  2. Mean 39; interval about [1.04, 4.96].
  3. Mean 35; interval about [33.04, 36.96].
  4. Mean 29; interval about [−1.96, 1.96].
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

An employment DiD shows a treated increase of 8 and a control increase of 3. Independent evidence establishes that an unrelated treated-only shock added 2 and a policy spillover added 1 to the control. Otherwise untreated trends match. What is the policy’s direct treated effect?
  1. 4 employment units
  2. 5 employment units
  3. 2 employment units
  4. 6 employment units
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A pre-policy trend-gap estimate is close to zero, but its confidence interval includes differences large enough to explain the estimated policy effect. What does this imply for the design?
  1. The near-zero point estimate establishes equal untreated trends afterward.
  2. The wide interval establishes that the groups had unequal untreated trends.
  3. The pre-policy evidence is too imprecise to rule out an important trend gap.
  4. The policy effect must be set to zero because the earlier test is inconclusive.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A balanced panel observes 85 firms in two periods and stores one row per firm-period pair. How many rows does the long-format data set contain?
  1. 85 rows
  2. 170 rows
  3. 340 rows
  4. 87 rows
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A model includes a permanent unit effect ai that is uncorrelated with its regressors, but has positive variance. The idiosyncratic errors are independent across periods. Why do conventional pooled OLS standard errors remain inappropriate?
  1. The shared unit effect necessarily correlates with each regressor.
  2. The time dummy cancels the shared unit effect from both observations.
  3. The idiosyncratic errors must become correlated across different units.
  4. The shared unit effect correlates each unit’s two composite errors.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A two-period output model contains distance to the coast zi and the interaction d2tzi. What remains of these two columns after first differencing?
  1. Both columns become 0 because distance is constant.
  2. The level column becomes 0; the interaction becomes zi.
  3. The level column becomes zi; the interaction becomes 0.
  4. Both columns remain zi because distance is constant.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A treated panel initially has 10 firms employing 20 workers each. After the program, 9 employ 22 each and 1 has permanently closed. Control firms’ mean employment falls from 18 to 17. Keeping the closed firm at zero, what is panel DiD?
  1. 0.8 workers per treated firm
  2. 3 workers per treated firm
  3. −0.2 workers per treated firm
  4. 1.8 workers per treated firm
Show answerHide answer

Save this lesson to see this answer.

Set 4: Evaluate complete policy comparisons10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A pooled model reports a later-year log-earnings coefficient of 0.12. Average log earnings rose by 0.20, while education and experience distributions changed. How should the two figures be distinguished?
  1. 0.12 is the raw mean change; 0.20 is the adjusted year difference.
  2. 0.12 is the adjusted year difference; 0.20 is the raw mean change.
  3. Both measure the same change, so one regression result must be wrong.
  4. The difference establishes that real earnings grew by exactly 8%.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A fully interacted two-year model with three regressors gives a later-year intercept shift of 5 and a year × x interaction of −2; the other interactions are zero. How does the later-minus-earlier fitted outcome gap change as x moves from 1 to 4, and what does that show about adding only a year dummy?
  1. It moves from +3 to −3; an intercept-only shift cannot represent this.
  2. It stays at +5; a year dummy alone represents this fitted relationship.
  3. It moves from −2 to −8; dropping the intercept shift preserves the gap.
  4. It moves from +7 to +13; a year dummy alone represents this change.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A treated group’s mean outcome rises from 90 to 99, while the control rises from 70 to 75. Under parallel untreated trends, what are the treated counterfactual and the ATT estimate?
  1. Counterfactual 75; ATT estimate 24.
  2. Counterfactual 90; ATT estimate 9.
  3. Counterfactual 94; ATT estimate 5.
  4. Counterfactual 95; ATT estimate 4.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

One treated city and one control city each have 30,000 surveyed residents. Mean monthly energy use rises from 120 to 130 kWh in the treated city and from 100 to 104 in the control. An analyst reports an HC1 standard error of 1.5 for the DiD interaction. A treated-city tax change starts on the policy date. What approximate 95% interval follows from that reported error, and can it isolate the policy effect?
  1. [7.06, 12.94] kWh; it cannot separate the policy and tax effects.
  2. [3.06, 8.94] kWh; it isolates the policy because the interval excludes zero.
  3. [3.06, 8.94] kWh; it cannot separate the policy and tax effects.
  4. [1.06, 6.94] kWh; it isolates the policy after the control change is removed.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

What must be equal across treated and control groups under parallel trends?
  1. Their average levels before treatment.
  2. Their average changes without treatment.
  3. Their observed average changes after treatment.
  4. Their individual treatment effects afterward.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A subsidy applies only to eligible firms in region A. Mean outcome changes are +10 for eligible and +4 for ineligible firms in A, versus +6 and +3 in region B. An unrelated shock additionally benefited only eligible firms in A by 2. All other untreated changes satisfy the DDD assumption. What are raw DDD and the subsidy effect after accounting for that shock?
  1. Raw DDD 6; subsidy effect 4.
  2. Raw DDD 3; subsidy effect 5.
  3. Raw DDD 4; subsidy effect 2.
  4. Raw DDD 3; subsidy effect 1.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A pooled productivity regression mixes firms with persistently strong management and firms with persistently weak management. Management quality also predicts input use. What information does a two-period panel add that can address this source of bias?
  1. It identifies changes within the same firms, allowing stable management effects to cancel.
  2. It makes management quality independent of input use across all sampled firms.
  3. It turns each firm’s two observations into independent draws from the population.
  4. It ensures temporary productivity shocks have no connection with future input use.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

For three units, observed Δx values are 0, 1 and 2, and observed Δy values are 1, 4 and 7. Each outcome change includes a temporary shock equal to 2Δx. After removing those known shocks, what FD slope and intercept remain?
  1. Slope 3; intercept 1.
  2. Slope 2; intercept 0.
  3. Slope 1; intercept 1.
  4. Slope 1; intercept 0.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

An FD model has a common time-change intercept of −1 and a participation-change slope of 3. One firm exits treatment, while another remains treated in both periods. What outcome changes does the model predict for these firms, in that order?
  1. +2 and −1
  2. −3 and 0
  3. −4 and −1
  4. −4 and +2
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A grant panel starts untreated. All treated firms initially employ 18 workers; 20% later permanently close, while the rest employ 20 each. Control firms’ mean employment falls from 18 to 15 with no closures. Independent evidence establishes that the treated mean would have fallen by 4 without the grant. Keeping all baseline firms, what are the raw FD participation slope and the ATT consistent with that evidence?
  1. Raw slope 1; ATT 3 workers.
  2. Raw slope 2; ATT 1 worker.
  3. Raw slope 5; ATT 6 workers.
  4. Raw slope 1; ATT 2 workers.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

58 Key Terms, each with its definition

A

Adjacent-period difference
An adjacent-period difference subtracts the previous observation period’s value from the current period’s value for the same unit.
In a longer panel, successive error differences share an error term and can be correlated within a unit.
Alternative control group
An alternative control group is another substantively credible untreated comparison used to assess dependence on the original control choice.
Similar estimates using several reasonable comparison regions reduce concern about one region’s unusual path.
Anticipation
Anticipation occurs when units adjust to an expected policy before its formal start, affecting outcomes in the supposed before period.
Firms may revise hiring after a wage increase is announced but before the new wage takes effect.
Ashenfelter dip
The Ashenfelter dip is a temporary fall in earnings before program entry that can make subsequent recovery resemble a program benefit.
Using an unusually bad pre-training year as the baseline can overstate the earnings gain caused by training.
Attenuation bias
Attenuation bias is movement of an estimated slope toward zero caused by classical measurement error in a regressor.
Differencing can increase the importance of input measurement error relative to the regressor’s true movement.
Attrition
Attrition is the loss of units between panel waves, potentially biasing comparisons when remaining units have systematically different outcomes.
If low-performing firms disappear from the survey, the observed average improvement may overstate progress.
Average treatment effect on the treated
The average treatment effect on the treated is the mean treatment-induced outcome difference among units receiving treatment.
An estimated gain for program participants need not equal the effect of offering the program to everyone.

B

Balanced panel
A balanced panel has an observation for every included unit in every included period, preserving membership across those periods.
If all 120 firms are recorded twice, the balanced two-period panel has 240 unit-period rows.
Base year
The base year is the omitted year category against which the included year-dummy coefficients make their comparisons.
With an intercept and samples from four years, one year is omitted and three year dummies are included.

C

Change in the group gap
A change in the group gap subtracts the treated-minus-control mean difference before a policy from the corresponding difference after it.
A gap moving from −10 to −6 gives a positive DiD of 4 even though treated outcomes remain lower.
Chow test
A Chow test compares regression coefficients across groups or periods by jointly restricting their differences in an interacted model.
Across two years, the full test restricts both the intercept shift and every slope interaction to zero.
Composite error
A composite error combines the permanent unit effect and the time-varying idiosyncratic error left in a pooled panel regression.
The common unit component links a firm’s errors across periods even if its temporary shocks are independent.
Composition change
A composition change alters which types of units contribute to a group’s observed mean, potentially changing its measured outcome.
Different sizes of houses sold before and after a project can shift average prices in a repeated survey.
Control group
A control group is an untreated comparison group used to estimate what would have happened to treated units without treatment.
A region with similar untreated trends can be informative even if its initial employment level is lower.
Control variable
A control variable is an additional observed regressor used to account for outcome differences associated with that characteristic.
Unchanged house features can help adjust price comparisons when different houses sell in each wave.
Counterfactual
A counterfactual is the outcome that would have occurred under an alternative treatment state, such as no policy for treated units.
For firms that receive a hiring subsidy, a comparison group helps estimate how their employment would have changed without the subsidy.

D

DiD interaction coefficient
The DiD interaction coefficient measures the additional treated-group change after accounting for the baseline gap and the control change.
In the basic regression, the coefficient on after × treat is the estimated difference-in-differences.
Difference-in-differences
Difference-in-differences subtracts the control group’s outcome change from the treated group’s change between the same periods.
If treated use falls by 30 kWh and control use falls by 5 kWh, the estimate is a reduction of 25 kWh.

E

External validity
External validity concerns how far a treatment effect learned in one setting can be applied to other populations, places or interventions.
A small historical wage increase in restaurants may have a different effect from a large increase elsewhere.

F

First differencing
First differencing subtracts a unit’s earlier equation from its later equation, removing every additive factor that stays constant within it.
Subtracting each city’s earlier crime rate from its later rate removes its stable geographic contribution.
Full-time-equivalent employment
Full-time-equivalent employment combines different work schedules into a common measure expressed as full-time workers.
When calculating FTE for restaurant staff, one part-time employee counts as half a full-time worker.

G

Group mean
A group mean is the average outcome for a defined comparison cell, such as the treated group in the period before a policy.
The basic two-by-two DiD calculation uses four means, one for each combination of group and period.

H

Heterogeneity bias
Heterogeneity bias is omitted-variable bias caused by an unobserved permanent unit effect being correlated with the included regressors.
Pooled input–output estimates can be biased when stable management quality influences both quantities.

I

Idiosyncratic error
An idiosyncratic error is the part of the panel model’s error that varies across both units and time, beyond the permanent unit effect.
A temporary production disruption at one firm enters its period-specific error, not its constant unit effect.
Independently pooled cross section
An independently pooled cross section combines fresh random samples drawn from the same population at different times.
A survey of newly sampled households in each year can measure how population earnings change over time.
Internal validity
Internal validity concerns whether the research design identifies the causal treatment effect for the population and period studied.
A treated-only economic shock can undermine internal validity even when a coefficient is precisely estimated.

L

Log-point change
A log-point change measures a difference in natural-log outcomes; multiplying it by 100 gives a small-change percentage approximation.
A log coefficient of −0.10 corresponds to about 9.5% lower fitted values using the exponential conversion.

N

Natural experiment
A natural experiment is an outside event that changes treatment exposure for some units and creates a possible comparison with others.
A policy introduced in one region but not another can provide a setting for a DiD analysis of outcomes.
Nominal outcome
A nominal outcome is measured in the money prices of its own period, so a comparison over time can include inflation.
Higher nominal earnings can reflect higher prices as well as an increase in what workers can buy.

P

Panel DiD
Panel DiD compares mean changes for treated and control units that are followed over time, using each unit’s own before outcome.
With no initial participants, a no-controls FD regression on participation change gives the panel DiD slope.
Parallel trends
Parallel trends means the treated and control groups would have had equal average outcome changes over the period without treatment.
A permanent starting gap is allowed if it would have remained constant along the untreated paths.
Parallel trends in levels
Parallel trends in levels requires equal additive untreated outcome changes across groups, measured in the outcome’s original units.
Representative outcomes rising by 10 in both groups are parallel in levels despite different initial values.
Parallel trends in logs
Parallel trends in logs requires equal changes in average logged untreated outcomes, making the comparison depend on proportional movement.
When representative outcomes both grow by 10%, their log changes match even when their level increases differ.
Participation change
A participation change is the later program indicator minus the earlier indicator, recording entry, exit or unchanged treatment status.
A firm leaving a program has a change of −1; a firm staying in it has a change of zero.
Placebo date
A placebo date is a fake treatment date placed before actual treatment to check for an apparent effect when the policy was absent.
A nonzero fake-date DiD can reveal that the treated group was already moving differently before the reform.
Placebo group
A placebo group is a group expected to be unaffected by the policy but analyzed as if treated to probe alternative explanations.
An apparent wage-policy effect in firms paying well above the new minimum can point to broader changes.
Placebo outcome
A placebo outcome is an outcome the policy should not plausibly change, used to check for movements unrelated to the proposed mechanism.
An apparent effect on an unaffected outcome can suggest that a concurrent shock is driving the comparison.
Post-treatment control
A post-treatment control is a regressor that treatment can change, so holding it fixed can remove a channel of the total treatment effect.
Sales after a productivity grant may be part of the process through which the grant changes employment.
Potential outcome
A potential outcome is the outcome a unit would have under a specified treatment state, whether or not that state is observed.
A treated firm reveals its outcome with the grant, while its same-period outcome without the grant is missing.
Pre-policy trend
A pre-policy trend describes how an outcome moved before treatment, providing evidence about the plausibility of a comparison path.
Similar earlier employment changes support using a control region to approximate the treated region’s path.

R

Real outcome
A real outcome is adjusted for the price level, allowing money amounts from different periods to be compared in common prices.
Dividing each year’s nominal earnings by its price index expresses earnings on a common purchasing-power basis.
Restricted model
A restricted model imposes the coefficient conditions in a null hypothesis, such as equal education slopes across two years.
For a slope-stability test, the restricted regression keeps the year dummy but omits its slope interactions.

S

Selection on temporary shocks
Selection on temporary shocks occurs when treatment participation responds to short-lived outcome disturbances that also affect observed changes.
A firm applying for a grant after unusually high defects may improve partly through ordinary recovery.
Simultaneous event
A simultaneous event is another change occurring with treatment that can move the same group’s outcomes and confound a policy comparison.
A treated-only tax change on the policy date is mixed with the policy in a simple two-by-two analysis.
Slope stability
Slope stability means the regressor coefficients remain the same across periods, even when the model allows its intercept to change.
A joint test of zero year–regressor interactions asks whether the estimated slopes stayed the same.
Spillover
A spillover is an effect of treatment on units outside the intended treatment group, which can contaminate the comparison path.
Cross-border customer movement may change employment at restaurants used as the untreated control group.
Strict exogeneity
Strict exogeneity requires each period’s idiosyncratic error to have mean zero given all periods’ regressors and the unit effect.
Police hiring responding to an earlier crime shock can violate strict exogeneity in a crime regression.

T

Time-constant regressor
A time-constant regressor has the same value for a unit in every observed period, so its separate level effect drops out under FD.
Distance to the coast cancels, but distance interacted with a second-period dummy can remain in differences.
Triple differences
Triple differences subtracts a subgroup DiD in one location from the corresponding subgroup DiD in another location.
An older-younger change gap of 5 in the treated state minus a gap of 2 in the control state gives DDD of 3.
Two-period panel
A two-period panel records outcomes and characteristics for the same identified units in two periods, allowing within-unit changes.
Revisiting each firm lets an analyst compare its productivity with its own earlier productivity.

U

Unobserved effect
An unobserved effect is an unmeasured unit-specific factor that stays constant over the observed periods in the panel model.
Stable geography can help explain why one city has persistently different crime rates from another.
Unrestricted model
An unrestricted model estimates coefficients without the restrictions being tested, providing a comparison for the restricted fit.
The fully interacted two-year model allows each year to have its own intercept and regressor slopes.
Untreated trend gap
An untreated trend gap is the difference between the changes the treated and control groups would have experienced without the policy.
A treated region growing faster for unrelated reasons adds that extra growth to its measured DiD.

W

Within-group error correlation
Within-group error correlation occurs when observations in the same policy group share unmeasured shocks and are statistically dependent.
Residents of one city may share a local economic shock, so their outcomes are not independent policy evidence.
Within-unit variation
Within-unit variation is movement in a variable over time for the same unit, which supplies the changes used by the FD estimator.
A worker’s birthplace has no within-worker variation and disappears when the two periods are differenced.

Y

Year dummy
A year dummy is an indicator for one sample year that lets a regression’s intercept differ from the omitted base year.
With 2015 as the base year, a 2023 dummy compares expected outcomes with 2015 at fixed values of the included worker characteristics.
Year–regressor interaction
A year–regressor interaction multiplies a year dummy by a regressor so the model can estimate a change in that regressor’s slope.
A positive interaction on education indicates a larger education slope in the later year than in the base year.

Z

Zero conditional mean in differences
Zero conditional mean in differences requires the average differenced error to be zero at every regressor-change value in the FD model.
Removing a stable city effect is insufficient if unemployment changes still predict temporary crime shocks.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started