Twenty of fifty firms adopted a new policy in 2016. A consultant compared their sales before and after with the thirty firms that did not, and reported a large difference-in-differences effect. The board wants to know if it is real.
Difference-in-differences only works if, without the policy, treated and untreated firms would have moved in parallel. That cannot be tested directly, but the years before 2016 give you a look: if the treated firms were already pulling ahead, the estimate is mostly that head start. The panel is simulated, and it was built with exactly this flaw in the sales series and none in the wage series, so you can see both what failure and what a sound design look like. Your deliverable is an annotated notebook the board's analyst can rerun.
Open a difference-in-differences study and name what changed for whom: the treatment, the outcome, and the columns that say which firm, which year and whether the year is after the policy.
Which firms are treated, from when, and what outcome is being compared?
Open Studios in the sidebar.
Open the Causal studio under Analysis in the rail, then choose Policy change over time (difference-in-differences).
Choose firm panel (sample) as the data for the study.
Complete the sentence: the effect of treated on sales.
Below the question, set Unit to firm, Time to year and Post to post.The estimate compares each firm's change from before to after, so the study has to know what "before" means.
Stage 2 · studios · ~8 min
Estimate the effect
Run the difference-in-differences estimator. It compares the treated firms' change in sales with the untreated firms' change over the same years. Note the estimate before you look any further.
What effect on sales does the estimator report?
Go to the Estimate step.
Keep the difference-in-differences estimator and press Run.
Read the estimate and its interval. It looks convincing. Write it down before you test it.
Stage 3 · studios · ~8 min
Look before the policy
An event study estimates the treated–untreated gap year by year, before and after 2016. Before the policy the gaps should sit near zero. If they climb, the firms were already diverging, and the estimate mostly measures that.
Were the treated firms already pulling ahead before 2016?
In the estimator's options, turn on Event study and set the treatment start to 2016, then press Run again.
Read the coefficients for the years before 2016. Do they sit around zero, or climb towards the policy year?Flat leads do not show parallel trends would have continued, but climbing ones show they did not hold before.
Open Assumptions and read the parallel-trends check.
Stage 4 · studios · ~11 min
What a sound comparison looks like
The same firms and the same policy, but a different outcome: log wages, which were moving in parallel before 2016. Run the event study again and compare the two pictures. Then read the claim level.
How do the pre-period coefficients for log wage differ from those for sales?
Back in the Question step, change the outcome to log wage.
Go to Estimate, keep Event study on, and press Run.
Compare the leads with the ones for sales. Which outcome supports a difference-in-differences reading?
Open Interpret and read the claim level for this study.
Stage 5 · notebooks · ~5 min
Annotate it in a notebook
The board's analyst wants to rerun your work. Start a notebook and write down, in order, what you ran, what the event studies showed and why the sales estimate cannot be trusted.
Open Notebooks, press the plus button and choose a Python or R notebook.
Write a short note in a text cell for each step, and paste the estimates you recorded.
Hints
Write down the first estimate before you look at the years before 2016; it makes the change in your view visible.
Turn on Event study in the estimator's options. The leads, the years before treatment, are the test you can run.
Swap the outcome to log wage and rerun. The contrast between the two event studies is the lesson.
notebook
An annotated notebook
Explain, as notes beside the steps: the first estimate for sales, what the event study showed before 2016, why that breaks the design, how log wage differs, and what the board should and should not conclude.
The consultant's estimate
The years before the policy
Why the design fails for sales
The log wage comparison
What to tell the board
Rubric
Criterion
Points
Reports the first sales estimate with its interval.
1
Describes the pre-period coefficients for sales and what they show.
2
Explains why non-parallel pre-trends bias the difference-in-differences estimate.
2
Contrasts the flat log wage leads with the sales leads.
2
Notes that flat leads are necessary but cannot confirm parallel trends.
1
Model answer
Show the model answer
The consultant's estimate. The two-way difference-in-differences for sales reports a sizeable, significant effect; quote it from your run.
Before the policy. The event study shows the treated firms' sales gap growing year by year before 2016. The leads are not centered on zero; they climb into the policy year.
Why that breaks the design. Difference-in-differences assumes the treated firms would have kept moving in parallel with the others. Their sales were already diverging, so the post-2016 gap includes a trend that predates the policy. The estimate cannot separate the two, and the Assumptions step flags parallel trends as a concern.
Log wage. For log wage the leads sit around zero and the effect appears from 2016 on, which is what a credible design looks like. That still does not show parallel trends would have continued; it only removes the most obvious objection.
For the board. The reported sales effect is not credible as a policy effect. The wage result is more defensible, at the claim level the studio assigns. The panel is simulated with this flaw built in.