0% found this document useful (0 votes)
23 views30 pages

CausalInference w7 Panel

C'est un document sur les effects causaux en panel

Uploaded by

Kingue bébé
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views30 pages

CausalInference w7 Panel

C'est un document sur les effects causaux en panel

Uploaded by

Kingue bébé
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Causal inference week 7:

Panel diff-in-diff

Andy Eggers

Oxford DPIR

HT 2018

1/30
Introduction

Introduction

Panel diff-in-diff
Motivating example
Basic estimation
Interpretation and assumptions
Relaxing parallel trends assumption
Testing assumptions

Further examples and extensions


Levitt on effect of campaign spending
Ansell on effect of house prices on welfare attitudes
Adler on the “Waitrose effect”

2/30
Introduction

Overview

Strategies for estimating effects of treatments so far:


I Randomize treatment and take the DIGM
I Identify and control for confounding variables such that the CIA holds
I Identify an instrumental variable and use two-stage-least-squares to
estimate average treatment effect for compliers
I Identify a situation in which the treatment depends on a cutoff
I Use observations at more than one point in time
Today: Generalizing the diff-in-diff.

3/30
Introduction

Simplest diff-in-diff

● Group T
● Group C

● ATT given
common trends
assumption

Time trend in group T?


Time trend in group C

Before After
4/30
Introduction

Dinas et al on the Golden Dawn

5/30
Introduction

Diff-in-diff with unit and time period dummies


Given panel data, you can run
lm(gdper ˜ treatment + as.factor(election) + as.factor(muni))
to estimate coefficients of regression
gdpermt = β1 treatmentmt + αt + γm ,
which MM would write as
T
X M
X
gdpermt = β1 treatmentmt + αj Electionjt + γk Municipalityk .
j =1 k =1

Regression output (truncated):

6/30
Introduction

Panel diff-in-diff: main idea

Given a simple diff-in-diff in panel data, we can run this regression:

Yit = β1 treatmentit + αt + γi

But in panel data we can run this regression for any type of treatment
applied in any pattern.

Under what assumptions is β1 an unbiased estimator of the ATT?


Two ways of putting it:
I parallel trends: time trends unrelated to treatment received; i.e., if
treatment did not vary, treated and untreated units would follow
common trends
I no time-varying confounders: any omitted variables related to
treatment must be fixed over time

7/30
Panel diff-in-diff

Introduction

Panel diff-in-diff
Motivating example
Basic estimation
Interpretation and assumptions
Relaxing parallel trends assumption
Testing assumptions

Further examples and extensions


Levitt on effect of campaign spending
Ansell on effect of house prices on welfare attitudes
Adler on the “Waitrose effect”

8/30
Panel diff-in-diff Motivating example

“English Bacon”: research question

Does the UK government favor politically-aligned local councils when


distributing targeted grants?

Consider assessing this with cross-sectional data (Ward & John, 1999).
I What covariates would you need?
I What about IV?
I What about RDD?

9/30
Panel diff-in-diff Motivating example

“English Bacon”: overview

I Assemble panel data for 1992-2012 with


I partisan composition of local councils
I grants allocated (per capita)
I Define treatment Copartisanit as: council i’s majority
and PM are copartisans in year t
I Regress grants on (lagged) treatment and
Alex Fouirnaies I council dummies (council fixed effects)
I year dummies (year fixed effects)
I council-year interactions (council-specific linear time
trends)
I Test for larger effects before elections, in swing
councils, etc. (more next week on treatment effect
heterogeneity)
Hande Mutlu-Eren

10/30
Panel diff-in-diff Basic estimation

“English Bacon”: basic regression (no unit-specific time


trends)

We might expect grants at t to depend on Copartisani ,t −1 .


We estimate

LogOfGrantsPerCapitait = β1 Copartisani ,t −1 + αt + γi

with this syntax


lm(lngrants ˜ treatment_lag1 + as.factor(year) + as.factor(council) )

to estimate effect of alignment k years ago on grants now.

11/30
Panel diff-in-diff Basic estimation

Regression output (truncated)

12/30
Panel diff-in-diff Basic estimation

Effect of partisan alignment at t − k on log grants


For lags of k = 0, 1, . . . , 6 years:

0.25
Effect of partisan alignment on (log) specific grants

0.20



0.15





0.10
0.05


0.00
−0.10

0 1 2 3 4 5 6

Years relative to partisan alignment


13/30
Panel diff-in-diff Interpretation and assumptions

What could explain this finding?


Recall: regression equation was

LogOfGrantsPerCapitait = β1 Copartisani ,t −k + αt + γi

Could we find positive β1 because

0.25
Effect of partisan alignment on (log) specific grants
I rural councils get fewer

0.20
per-capita grants and tend to be ●

0.15


Conservative; mostly Labour ●

0.10
governments in 1992-2012?

0.05

I Labour governments gave more

0.00
grants when they were in
government, and there are more −0.10

Labour councils in the data? 0 1 2 3 4 5 6

Years relative to partisan alignment


What else could explain it?

14/30
Panel diff-in-diff Interpretation and assumptions

Explaining panel DiD findings


Suppose the data generating process (DGP) is

Yit = β1 Dit + ηXt + ζ Ui + ψVit + ωit

where
I Xt are time-specific variables that affect outcomes for all units the
same way (e.g. budget for targeted grants),
I Ui are unit-specific variables that are constant over time (e.g.
urban/rural character, presence of Roman ruins),
I Vit are variables that may vary within units over time (e.g. presence of
ambitious council member, local economic situation), and
I ωit is random noise.
In panel-DiD analysis where we estimate Yit = β1 Dit + αt + γi + it ,
I time dummies (αt ) control for all Xt
I unit dummies (γi ) control for all Ui
so the only possible confounders are Vit .
15/30
Panel diff-in-diff Interpretation and assumptions

Applying regression anatomy to a panel DiD regression


Think of a panel DiD regression this way:
1. Regress treatment on unit and time period fixed effects:

Copartisani ,t −k = αt + γi

2. Regress outcome on the residuals from the above regression:


!
LogOfGrantsit = β1 Copartisani ,t −k ˆ
− Copartisan i ,t −k

Key conclusions:
I All residuals will be zero for any unit that is always treated or never treated → no role
in estimating β1
I β1 estimated based on variation in treatment over time within units
I the only relevant confounders vary with treatment over time within units

Panel DiD regression as the “within” estimator.

16/30
Panel diff-in-diff Interpretation and assumptions

What could explain this finding? (2)

Recall: regression equation was

LogOfGrantsPerCapitait = β1 Copartisani ,t −k + αt + γi

0.25
Effect of partisan alignment on (log) specific grants
What confounders might vary with

0.20
treatment over time within units?

0.15



Labour councils had growing

0.10
I
needs, Conservative councils

0.05

shrinking needs?
0.00
I Labour councillors improving? −0.10

I others? 0 1 2 3 4 5 6

Years relative to partisan alignment

17/30
Panel diff-in-diff Relaxing parallel trends assumption

Relaxing the parallel trends assumption

Regression equation was

LogOfGrantsPerCapitait = β1 Copartisani ,t −k + αt + γi

but consider adding unit-specific linear time trends:

LogOfGrantsPerCapitait = β1 Copartisani ,t −k + αt + γi + γi t

where t is the year. To implement (needs at least 3 years):

lm(lngrants ˜ treatment_k + as.factor(year) + as.factor(council)*year )



(Could add year2 or year or ln(year) to make time trends non-linear.)

18/30
Panel diff-in-diff Relaxing parallel trends assumption

Effect over time, w. unit specific time trends

0.25
Effect of partisan alignment on (log) specific grants

0.20



0.15





0.10

● ●
0.05



0.00



−0.10

0 1 2 3 4 5 6

Years relative to partisan alignment


19/30
Panel diff-in-diff Testing assumptions

Testing assumptions in panel DiD


Unfortunately, no test as simple and transparent as the parallel trends plot.
The alternative:
5
X 3
X
LogOfGrantsPerCapitait = βk Copartisani ,t −k + θk Copartisani ,t +k + αt + γi + γi t
k =0 k =1

i.e. include lags and leads of treatment in one regression.

Unit linear time trends


Effect of partisan alignment on (log) specific grants

0.05 0.10 0.15

● ●


● ●
● ●

−0.05
−0.15

−3 −2 −1 0 1 2 3 4 5 6

Years relative to partisan alignment 20/30


Further examples and extensions

Introduction

Panel diff-in-diff
Motivating example
Basic estimation
Interpretation and assumptions
Relaxing parallel trends assumption
Testing assumptions

Further examples and extensions


Levitt on effect of campaign spending
Ansell on effect of house prices on welfare attitudes
Adler on the “Waitrose effect”

21/30
Further examples and extensions Levitt on effect of campaign spending

Levitt on effects of campaign spending

Levitt (1994), “Using Repeat Challengers to Estimate the Effect of


Campaign Spending on Election Outcomes in the U.S. House”.

Question: What is the effect of campaign spending on election outcomes?

Consider running this cross-sectional regression:


DemVoteSharei = β0 + β1 (DemSpendi − RepSpendi ) + β2 DemPresVoteSharei + i

I Would you expect β1 to be positive or negative?


I What assumption is necessary to interpret that coefficient causally?
I Why might this assumption be violated?

22/30
Further examples and extensions Levitt on effect of campaign spending

Levitt on effects of campaign spending

Levitt (1994), “Using Repeat Challengers to Estimate the Effect of


Campaign Spending on Election Outcomes in the U.S. House”.

Question: What is the effect of campaign spending on election outcomes?

Consider running this panel regression:


DemVoteShareit = β0 + β1 (DemSpendit − RepSpendit ) + αt + γi + i

where γi is a dummy for each candidate pair.


I Would you expect β1 to be positive or negative?
I What assumption is necessary to interpret that coefficient causally?
I Why might this assumption be violated?

23/30
Further examples and extensions Levitt on effect of campaign spending

Levitt and use of covariates

As noted above, the only relevant confounders are those that change
within units over time.
In panel DiD you can control for observable covariate that change within
units over time, e.g.:

DemVoteShareit = β0 +β1 (DemSpendit −RepSpendit )+αt +γi +θ(DemScandalit −RepScandalit

Levitt controls for scandal and incumbency.

24/30
Further examples and extensions Levitt on effect of campaign spending

First differences approach


Suppose again the data generating process (DGP) is
Yit = β1 Dit + αXt + γUi + ψVit + ωit .

We estimated β1 via regression with unit and time-period dummies.

First differences approach: Generate first difference of each variable,


e.g.
∆Yit = Yit − Yi ,t −1
and then estimate
∆Yit = βf1 ∆Dit + αt ,
i.e. regress differenced outcome on differenced treatment and year
dummies (could add unit dummies for unit-specific linear time trends).

Generally gives similar results; same results if only two periods.

25/30
Further examples and extensions Ansell on effect of house prices on welfare attitudes

Ansell on effect of house prices on welfare attitudes

Ansell (2014), “The political economy of ownership: housing markets and


the welfare state”

Question: How does variation in house prices affect homeowners?


preferences regarding redistribution?

Consider running this cross-sectional regression:


SupportForRedistributioni = β0 + β1 PriceOfHomei + β2 Incomei + β3 Agei + i .

I Would you expect β1 to be positive or negative?


I What assumption is necessary to interpret β1 causally?
I Why might this assumption be violated?

26/30
Further examples and extensions Ansell on effect of house prices on welfare attitudes

Ansell on effect of house prices on welfare attitudes (2)


Ansell (2014), “The political economy of ownership: housing markets and
the welfare state”

Question: How does variation in house prices affect homeowners?


preferences regarding redistribution?

Consider running this panel regression:


SupportForRedistributionit = β1 PriceOfHomeit + αt + γi

or (Ansell’s actual basic specification – first differences)


∆SupportForRedistributionit = β1 ∆PriceOfHomeit + αt

I Would you expect β1 to be positive or negative?


I What assumption is necessary to interpret β1 causally?
I Why might this assumption be violated?
27/30
Further examples and extensions Ansell on effect of house prices on welfare attitudes

Ansell’s control strategy

Ansell (2014) controls for changes in


I home ownership
I household income
I party ID
I retired status
and controls for (i.e. allows time trends to vary by)
I age
I gender
I race

28/30
Further examples and extensions Adler on the “Waitrose effect”

Adler on the “Waitrose effect”

Adler (2017 MPhil dissertation), “The other Waitrose effect”

Question: How does gentrification affect renters?

Consider running this cross-sectional regression:


EvictionRatei = β0 + β1 WaitroseNearbyi + β2 UnemploymentRatei + β3 CrimeRatei + i .

I Would you expect β1 to be positive or negative?


I What assumption is necessary to interpret β1 causally?
I Why might this assumption be violated?

29/30
Further examples and extensions Adler on the “Waitrose effect”

Adler on the “Waitrose effect” (2)

Adler (2017 MPhil dissertation), “The other Waitrose effect”

Question: How does gentrification affect renters?

Consider running this panel regression:


EvictionRateit = β1 WaitroseNearbyit + αt + γi

I Would you expect β1 to be positive or negative?


I What assumption is necessary to interpret β1 causally?
I Why might this assumption be violated?

30/30

You might also like