I've written a stata routine to estimate an exact (cell) match average
treatment effect as suggested by Card and Sullivan (1988). So far my ado
file is only able to compute the average values of the non treated, the
treated, the difference and the weighted differece (att).
I would like to know if anyone could give me a suggestion on how I could
compute the std errors using Stata. Below follows an example of the output
and the do file that generates it.
Many thanks,
Joao Pedro
Reference:
Card, D. and D. G. Sullivan (1988). "Measuring the Effect of Subsidized
Training Programs on Movements in and out of Employment." Econometrica
56(3): 497-530.
| CONTROL TREATED
PREHIST | N RATE(%) N RATE(%) DIFF WEIGHT
ATT
0 | 2502 66.22 225 47.37 -18.84 0.05
-1.00
1 | 4154 62.17 404 51.32 -10.85 0.10
-1.03
10 | 23 56.60 1 100.00 43.40 0.00
0.01
11 | 3658 65.34 349 55.79 -9.55 0.08
-0.78
100 | 27 58.29 4 97.88 39.60 0.00
0.04
101 | 72 65.43 8 63.98 -1.45 0.00
-0.00
110 | 23 80.25 3 79.66 -0.59 0.00
-0.00
111 | 2651 69.07 206 57.08 -11.99 0.05
-0.58
1000 | 25 76.88 0 . . 0.00
.
1001 | 69 65.81 9 62.05 -3.75 0.00
-0.01
1010 | 1 40.68 0 . . 0.00
.
1011 | 59 72.78 6 65.25 -7.53 0.00
-0.01
1100 | 28 73.79 2 38.56 -35.23 0.00
-0.02
1101 | 70 73.90 6 54.10 -19.80 0.00
-0.03
1110 | 10 66.61 1 0.00 -66.61 0.00
-0.02
1111 | 2198 69.98 165 57.17 -12.81 0.04
-0.50
10000 | 19 66.82 1 59.32 -7.49 0.00
-0.00
10001 | 57 54.68 2 3.39 -51.29 0.00
-0.02
10011 | 48 70.32 9 48.96 -21.36 0.00
-0.05
10101 | 4 93.01 0 . . 0.00
.
10111 | 78 77.28 6 52.97 -24.32 0.00
-0.03
11000 | 27 66.64 5 68.47 1.84 0.00
0.00
11001 | 68 66.75 5 39.15 -27.60 0.00
-0.03
11010 | 1 100.00 0 . . 0.00
.
11011 | 85 72.39 8 68.11 -4.28 0.00
-0.01
11100 | 29 69.58 1 87.29 17.71 0.00
0.00
11101 | 58 77.15 4 43.22 -33.93 0.00
-0.03
11110 | 15 59.60 1 38.98 -20.62 0.00
-0.00
11111 | 2598 72.49 196 55.62 -16.87 0.05
-0.78
100000 | 209 64.86 13 56.58 -8.28 0.00
-0.03
100001 | 367 61.19 41 48.99 -12.20 0.01
-0.12
100010 | 6 41.81 1 19.49 -22.32 0.00
-0.01
100011 | 314 64.33 17 66.95 2.62 0.00
0.01
100100 | 3 72.03 0 . . 0.00
.
100101 | 10 79.24 2 46.61 -32.63 0.00
-0.02
100110 | 3 67.23 0 . . 0.00
.
100111 | 340 75.71 24 74.89 -0.81 0.01
-0.00
101000 | 3 32.77 0 . . 0.00
.
101001 | 6 57.20 1 70.34 13.14 0.00
0.00
101011 | 10 73.22 0 . . 0.00
.
101101 | 17 68.49 1 16.95 -51.55 0.00
-0.01
101110 | 3 79.10 1 86.44 7.34 0.00
0.00
101111 | 330 76.08 28 58.54 -17.55 0.01
-0.12
110000 | 153 67.91 13 58.47 -9.43 0.00
-0.03
110001 | 328 60.43 21 45.56 -14.87 0.00
-0.07
110010 | 1 100.00 0 . . 0.00
.
110011 | 479 68.66 36 61.09 -7.57 0.01
-0.06
110100 | 4 64.41 1 100.00 35.59 0.00
0.01
110101 | 5 45.42 0 . . 0.00
.
110110 | 4 51.69 0 . . 0.00
.
110111 | 329 79.24 26 64.60 -14.64 0.01
-0.09
111000 | 125 72.79 8 77.86 5.07 0.00
0.01
111001 | 397 68.40 23 57.89 -10.51 0.01
-0.06
111010 | 1 55.93 0 . . 0.00
.
111011 | 382 73.82 28 60.47 -13.35 0.01
-0.09
111100 | 210 71.76 20 54.36 -17.40 0.00
-0.08
111101 | 354 72.56 21 56.30 -16.27 0.00
-0.08
111110 | 136 75.21 6 89.97 14.77 0.00
0.02
111111 | 42408 82.30 2276 60.08 -22.22 0.54
-11.91
Total | 65594 4235
-17.61
--------------------------- do file begin ----------------------------
quietly {
noisily di _newline(2)
noisily di in text " {c |} CONTROL" _col(29) "
TREATED"
noisily di in text "PREHIST {c |} N " _col(29) "RATE(%) N
RATE(%) DIFF WEIGHT ATT"
sum part2 if part2==1
local N_treated =r(N)
local t_att=0
local t_cont=0
local t_treat=0
foreach num in 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110
1111 10000 10001 10011 10101 10111 11000 11001 11010 11011 11100 11101 11110
11111 100000 100001 100010 100011 100100 100101 100110 100111 101000 101001
101011 101101 101110 101111 110000 110001 110010 110011 110100 110101 110110
110111 111000 111001 111010 111011 111100 111101 111110 111111 {
sum posthist1 if prehist2==`num' & part2==0
local n_control=r(N)
local control=r(mean)*100
sum posthist1 if prehist2==`num' & part2==1
local n_treated=r(N)
local treated=r(mean)*100
local weight=r(N)/`N_treated'
local diff=`treated'-`control'
local att =`diff'*`weight'
if `att'!=. {
local t_att=(`t_att')+(`att')
}
if `n_control'!=. {
local t_cont=(`t_cont')+(`n_control')
}
if `n_treated'!=. {
local t_treat=(`t_treat')+(`n_treated')
}
*local phist=substr("00000"+"`num'",10,-6)
noisily di in text "`num'" _col(14)" {c |}" _col(14) %9.0f `n_control'
_col(24) %9.2f `control' _col(34) %9.0f `n_treated' _col(44) %9.2f
`treated' _col(54) %9.2f `diff' _col(64) %9.2f `weight' _col(74) %9.2f
`att'
}
noisily di in text "Total" _col(14)" {c |}" _col(14) %9.0f `t_cont'
_col(34) %9.0f `t_treat' _col(74) %9.2f `t_att'
}
---------------------------- do file ends ----------------------------
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/