TreatmentEffects_DID
Economics 403A
Treatment Effects
and
Differences-in-Differences
Dr. Randall R. Rojas
1
Today’s Class
• Treatment Effects
• Differences-in-Differences
2
Treatment Effects
• Avoid the faulty line of reasoning known as post
hoc, ergo propter hoc
– One event’s preceding another does not necessarily
make the first the cause of the second
– Another way to say this is embodied in the warning
that ‘‘correlation is not the same as causation’’
– Another way to describe the problem we face in this
example is to say that data exhibit a selection bias,
because some people chose (or self-selected) to go to
the hospital and the others did not
• When membership in the treated group is in part
determined by choice, then the sample is not a random
sample
3
Treatment Effects
• Selection bias is also an issue when asking:
– ‘‘How much does an additional year of education
increase the wages of married women?’’
– ‘‘How much does participation in a job-training
program increase wages?’’
– ‘‘How much does a dietary supplement contribute to
weight loss?’’
• Selection bias interferes with a straightforward
examination of the data, and makes more difficult
our efforts to measure a causal effect, or
treatment effect
4
Treatment Effects
• We would like to randomly assign items to a
treatment group, with others being treated as
a control group
– We could then compare the two groups
– The key is a randomized controlled experiment
5
Treatment Effects
• The ability to perform randomized controlled
experiments in economics is limited because
the subjects are people, and their economic
well-being is at stake
6
Treatment Effects
• Define the indicator variable d as:
– The model is then:
– And the regression functions are:
1 individual in treatment group
0 individual in control groupi
d
ì
= í
î
1 2β β , 1, ,i i iy d e i N= + + = !
( ) 1 2
1
β β if in treatment group, 1
β if in control group, = 0
i
i
i
d
E y
d
+ =ì
= í
î
7
The Difference Estimator
• The least squares estimator for β2, the treatment
effect, is:
with:
– The estimator b2is called the difference estimator,
because it is the difference between the sample
means of the treatment and control groups
( )( )
( )
1
2 1 02
1
N
i i
i
N
i
i
d d y y
b y y
d d
=
=
– –
= = –
–
å
å
1 0
1 1 0 01 1
,
N N
i ii i
y y N y y N
= =
= =å å
8
The Difference Estimator
• The difference estimator can be rewritten as:
– To be unbiased, we must have:
( )( )
( )
( )12 2 2 1 02
1
β β
N
i i
i
N
i
i
d d e e
b e e
d d
=
=
– –
= + = + –
–
å
å
( ) ( ) ( )1 0 1 0 0E e e E e E e- = – =
9
The Difference Estimator
• If we allow individuals to ‘‘self-select’’ into treatment
and control groups, then:
is the selection bias in the estimation of the treatment
effect
– We can eliminate the self-selection bias is we randomly
assign individuals to treatment and control groups, so that
there are no systematic differences between the groups,
except for the treatment itself
( ) ( )1 0E e E e-
10
Table 7.6a Summary Statistics for Regular-Sized ClassesExample:
Project STAR Kindergarten
Effect of classroom size on student learning
11
Regular Sized Classroom
Table 7.6b Summary Statistics for Small ClassesExample
Project STAR Kindergarten
12
Small Sized Classroom
Example
Project STAR Kindergarten
• The model of interest is:
• Adding TCHEXPER to the base model we
obtain:
1 2β βTOTALSCORE SMALL e= + +
13
1 2 3β β βTOTALSCORE SMALL TCHEXPER e= + + +
Example
Project STAR Kindergarten
14
Example
Project STAR Kindergarten
• The students in our sample are enrolled in 79
different schools
– One way to account for school effects is to include
an indicator variable for each school
– That is, we can introduce 78 new indicators:
1 if student is in school
_
0 otherwise
j
SCHOOL j
ì
= í
î
15
Example
Project STAR Kindergarten
• The model is now:
– The regression function for a student in school j is:
79
1 2 3
2
β β β δ _i i i j i i
j
TOTALSCORE SMALL TCHEXPER SCHOOL j e
=
= + + + +å
( )
( )
( )
1 3
1 2 3
β δ β student in regular class
β δ β β student in small class
j i
i
j i
TCHEXPER
E TOTALSCORE
TCHEXPER
ì + +ï
= í
+ + +ïî
16
Example
Project STAR Kindergarten
• Another way to check for random assignment
is to regress SMALL on these characteristics
and check for any significant coefficients, or
an overall significant relationship
– If there is random assignment, we should not find
any significant relationships
– Because SMALL is an indicator variable, we use
the linear probability model
17
The Differences-in-Differences
Estimator
• Randomized controlled experiments are rare
in economics because they are expensive and
involve human subjects
– Natural experiments, also called quasi-
experiments, rely on observing real-world
conditions that approximate what would happen
in a randomized controlled experiment
– Treatment appears as if it were randomly assigned
18
The Differences-in-Differences
Estimator
19
The Differences-in-Differences
Estimator
• Estimation of the treatment effect is based on
data averages for the two groups in the two
periods:
– The estimator is called a differences-in-differences
(abbreviated as D-in-D, DD, or DID) estimator of the
treatment effect.
( ) ( )
( ) ( ), , , ,
ˆ ˆ ˆˆ ˆδ= C E B A
Treatment After Control After Treatment Before Control Beforey y y y
– – –
= – – –
δ̂
20
The Differences-in-Differences
Estimator
• The sample means are:
,
,
,
,
 mean for control group before policy
B̂ mean for treatment group before policy
Ê mean for control group after policy
Ĉ mean for trea
Control Before
Treatment Before
Control After
Treatment After
y
y
y
y
= =
= =
= =
= = tment group after policy
21
The Differences-in-Differences
Estimator
• Consider the regression model:
• The regression function is:
( )1 2 3y β β β δit i t i t itTREAT AFTER TREAT AFTER e= + + + ´ +
22
( )
1
1 2
1 3
1 2 3
β 0, 0 [Control before = A]
β β 1, 0 [Treatment before = B]
E y
β β 0, 1 [Control after = E]
β β β δ
it
TREAT AFTER
TREAT AFTER
TREAT AFTER
TREAT
= =
+ = =
=
+ = =
+ + + =1, 1 [Treatment after = C]AFTER
ì
ï
ï
í
ï
ï =î
The Differences-in-Differences
Estimator
• Using the points in the figure:
• Using the least squares estimates, we have:
( ) ( ) ( ) ( ) ( )1 2 3 1 3 1 2 1δ C E B A β β β δ β β β β βé ù é ù= – – – = + + + – + – + -ë û ë û
( ) ( ) ( )
( ) ( )
1 2 3 1 3 1 2 1
, , , ,
ˆ ˆδ b δ b
Treatment After Conrol After Treatment Before Conrol Before
b b b b b b
y y y y
é ù é ù= + + + – + – + -ë ûë û
= – – –
23
• On April 1, 1992 minimum wages were increased in NJ from
$4.25/hr to $5.05/hr but remained at $4.25/hr in PA.
• Q: What effect did this increase have on full-time
employment in fast food restaurants in NJ?
Example: Minimum wages PA vs. NJ
24
Full-time Equivalent Employees by State and Period
The Differences-in-Differences
Estimator
• We will test the null and alternative
hypotheses:
– The differences-in-differences estimate of the
change in employment due to the change in the
minimum wage is:
0 1: δ 0 versus : δ 0H H³ < ( ) ( ) ( ) ( ) , , , ,δ̂ 21.0274 21.1656 20.4394 23.3312 2.7536 NJ After PA After NJ Before PA BeforeFTE FTE FTE FTE= - - - = - - - = 25 Example: Minimum wages PA vs. NJ • Rather than compute the differences-in- differences estimate using sample means, it is easier and more general to use the regression format – The differences-in-differences regression is: ( )1 2 3β β β δit i t i t itFTE NJ D NJ D e= + + + ´ + 26 This is the estimate we need 27 Example: Minimum wages PA vs. NJ • In our differences-in-differences analysis, we did not exploit one very important feature of the data -namely, that the same fast food restaurants were observed on two occasions – We have ‘‘before’’ and ‘‘after’’ data – These are called paired data observations, or repeat data observations, or panel data observations 28 Example: Minimum wages PA vs. NJ • We previously introduced the notion of a panel of data – we observe the same individual-level units over several periods – Using panel data we can control for unobserved individual-specific characteristics 29 Example: Minimum wages PA vs. NJ • Let ci denote any unobserved characteristics of individual restaurant i that do not change over time: ( )1 2 3β β β δit i t i t i itFTE NJ D NJ D c e= + + + ´ + + 30 Example: Minimum wages PA vs. NJ • Subtract the observation for t = 1 from that for t = 2: where: ( ) ( ) 2 1 2 3 2 1 1 2 3 1 3 β β β 1 δ 1 β β β 0 δ 0 β δ i i i i i i i i i i i i i FTE NJ NJ c e FTE NJ NJ c e FTE NJ e = + + + ´ + + - = + + + ´ + + D = + + D 2 1i i iFTE FTE FTED = - 2 1i i ie e eD = - 31 Example: Minimum wages PA vs. NJ • Using the differenced data, the regression model of interest becomes: 3β δi i iFTE NJ eD = + +D 32 Example: Minimum wages PA vs. NJ • The estimated model is: – The estimate of the treatment effect using the differenced data, which accounts for any unobserved individual differences, is very close to the differences-in-differences – We fail to conclude that the minimum wage increase has reduced employment in these New Jersey fast food restaurants ( ) ( ) ( ) 22.2833 2.7500 0.0146 1.036 1.154 FTE NJ R se D = - + = δ̂ 2.75= 33