Diff in Diff Uk12 Villa
Diff in Diff Uk12 Villa
Diff in Diff Uk12 Villa
difference-in-differences
Juan M. Villa
PhD Student – University of Manchester
2. What is diff?
3. Difference in differences
a) Single diff-in-diff
b) Diff-in-diff with covariates
c) Kernel propensity score diff-in-diff
d) Quantile diff-in-diff
4. Balancing test
Causal inference
• Experimental designs are the golden rule but costly and not
always available. Targeting methods do not necessarily fit the
evaluation requirements.
Treated
Diff at follow up
Baseline Follow-up
Intervention
starts
What is diff?
Required:
period(varname) treated(varname)
Optional:
cov(varlist)
SE/Robust:
cluster(varname) robust bs reps(int)
Balancing test:
test report nostar
What is diff?
Contains data from cardkrueger1994.dta
obs: 820 Dataset from Card&Krueger (1994)
vars: 8 27 May 2011 20:36
size: 18,860 (99.9% of memory free)
-----------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-----------------------------------------------------------------------------------------------------
id int %8.0g Store ID
t byte %8.0g Feb. 1992 = 0; Nov. 1992 = 1
treated long %8.0g treated New Jersey = 1; Pennsylvania = 0
fte float %9.0g Output: Full Time Employment
bk byte %8.0g Burger King == 1
kfc byte %8.0g Kentuky Fried Chiken == 1
roys byte %8.0g Roy Rogers == 1
wendys byte %8.0g Wendy's == 1
-----------------------------------------------------------------------------------------------------
Sorted by: id t
summ
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
id | 820 246.5073 148.1413 1 522
t | 820 .5 .5003052 0 1
treated | 820 .8073171 .3946469 0 1
fte | 801 17.59457 9.022517 0 80
bk | 820 .4170732 .4933761 0 1
-------------+--------------------------------------------------------
kfc | 820 .195122 .3965364 0 1
roys | 820 .2414634 .4282318 0 1
wendys | 820 .1463415 .3536639 0 1
Difference in differences
Single diff-in-diff
. diff fte, t(treated) p(t) cov(bk kfc roys)
R-square: 0.00805
R-square: 0.18784
DIFFERENCE IN DIFFERENCES ESTIMATION
--------------------- ------------ BASE LINE --------- ----------- FOLLOW UP ---------- -------------
Outcome Variable(s) | Control | treated | Diff(BL) | Control | treated | Diff(FU) | DIFF-IN-DIFF
---------------------+---------+-----------+----------+---------+-----------+----------+-------------
fte | 21.161 | 18.837 | -2.324 | 18.758 | 19.369 | 0.611 | 2.935
Std. Error | 1.142 | 0.851 | 1.031 | 1.158 | 0.853 | 1.037 | 1.460
t | 18.53 | 18.43 | -2.25 | 19.09 | 19.87 | 0.51 | 2.01
P>|t| | 0.000 | 0.000 | 0.024** | 0.000 | 0.000 | 0.556 | 0.045**
-----------------------------------------------------------------------------------------------------
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
Difference in differences
R-square: 0.02698
Quantile Diff-in-diff
. diff fte, t(treated) p(t) qdid(0.25)
R-square: 0.00297
R-square: 0.00477
Single t-test
. diff fte, t(treated) p(t) cov(bk kfc roys wendys) test
t-test at period = 0:
----------------------------------------------------------------------------------------------
Variable(s) | Mean Control | Mean Treated | Diff. | |t| | Pr(|T|>|t|)
---------------------+------------------+--------------+------------+---------+---------------
fte | 19.949 | 17.065 | -2.884 | 2.44 | 0.0150**
bk | 0.443 | 0.411 | -0.032 | 0.52 | 0.6035
kfc | 0.152 | 0.205 | 0.054 | 1.08 | 0.2818
roys | 0.215 | 0.248 | 0.033 | 0.61 | 0.5448
wendys | 0.190 | 0.136 | -0.054 | 1.22 | 0.2241
----------------------------------------------------------------------------------------------
*** p<0.01; ** p<0.05; * p<0.1
Balancing test
t-test at period = 0:
----------------------------------------------------------------------------------------------
Weighted Variable(s) | Mean Control | Mean Treated | Diff. | |t| | Pr(|T|>|t|)
---------------------+------------------+--------------+------------+---------+---------------
fte | 21.656 | 17.065 | -4.591 | 3.22 | 0.0014***
bk | 0.618 | 0.408 | -0.210 | 3.55 | 0.0004***
kfc | 0.104 | 0.209 | 0.104 | 2.60 | 0.0097***
roys | 0.183 | 0.252 | 0.068 | 1.42 | 0.1570
wendys | 0.095 | 0.132 | 0.037 | 1.01 | 0.3123
----------------------------------------------------------------------------------------------
*** p<0.01; ** p<0.05; * p<0.1
Attention: option kernel weighs variables in cov(varlist)
Means and t-test are estimated by linear regression