-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcic_examples.log
232 lines (200 loc) · 11.3 KB
/
cic_examples.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
name: <unnamed>
log: C:\Users\kkranker\Documents\Stata\cic\code-cic\cic_examples.log
log type: text
opened on: 5 Nov 2019, 22:13:08
.
. *! cic_examples.do
. *! Changes-in-changes
. *! Exmple of how to use the command (from cic.sthlp)
. *! by Keith Kranker
.
. about
Stata/MP 16.0 for Windows (64-bit x86-64)
Revision 16 Oct 2019
Copyright 1985-2019 StataCorp LLC
Total physical memory: 32.00 GB
Available physical memory: 24.79 GB
Single-user 64-core Stata network license expires 15 Nov 2019:
Serial number: 501609253383
Licensed to: SCCMAdminRoot
Mathematica
. which cic
.\cic.ado
*! cic.ado
*! Changes-in-changes
*!
*! An implimentation of:
*! Athey, S. & G. W. Imbens. "Identification and Inference in Nonlinear Difference-in-Differences Models."
*! Econometrica, 74 (2), March 2006, pp. 431-497.
*! Based on Matlab code by S. Athey & G. W. Imbens, published on S. Athey's website
*!
*! Stata code by Keith Kranker
.
. // setup
. sysuse nlsw88, clear
(NLSW, 1988 extract)
. set seed 1
. gen TREAT = uniform() < .5
. replace wage = wage + TREAT
(1,099 real changes made)
. gen POST = uniform() < .5
. replace wage = wage - POST
(1,110 real changes made)
.
. // estimate
. cic continuous wage TREAT POST, vce(bootstrap, reps(50))
Bootstrap replications (50)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
.................................................. 50
Changes in Changes (CIC) Model
Bootstrap results
Number of strata = 4 Number of obs = 2,246
Replications = 50
command: cic
------------------------------------------------------------------------------
| Observed Bootstrap Normal-based
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mean | -.8076742 .5454668 -1.48 0.139 -1.876769 .261421
q10 | -.1191621 .1875861 -0.64 0.525 -.4868241 .2484999
q20 | -.0466981 .2777153 -0.17 0.866 -.5910101 .4976139
q30 | -.0789051 .3535705 -0.22 0.823 -.7718906 .6140804
q40 | .0141063 .5238739 0.03 0.979 -1.012668 1.04088
q50 | -.4009647 .600971 -0.67 0.505 -1.578846 .7769167
q60 | -.8840542 .6302271 -1.40 0.161 -2.119277 .3511682
q70 | -.8437986 .5930403 -1.42 0.155 -2.006136 .3185391
q80 | -1.012882 .5451661 -1.86 0.063 -2.081388 .0556236
q90 | -1.149755 1.161383 -0.99 0.322 -3.426024 1.126514
------------------------------------------------------------------------------
Effect of Treatment on the Treated Group
Continuous CIC model [continuous]
. bootstrap, reps(50): cic all wage TREAT POST, at(50 90) did vce(none)
(running cic on estimation sample)
Bootstrap replications (50)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
.................................................. 50
Changes in Changes (CIC) Model Number of obs = 2,246
Replications = 50
-------------------------------------------------------------------------------
| Observed Bootstrap Normal-based
wage | Coef. Std. Err. z P>|z| [95% Conf. Interval]
--------------+----------------------------------------------------------------
did_model |
TREAT#POST |
0 0 | 7.572724 .2165478 34.97 0.000 7.148298 7.99715
0 1 | 6.956156 .2532987 27.46 0.000 6.4597 7.452612
1 0 | 8.949919 .256902 34.84 0.000 8.446401 9.453438
1 1 | 7.614637 .2662501 28.60 0.000 7.092796 8.136477
--------------+----------------------------------------------------------------
did |
did | -.7187145 .4428388 -1.62 0.105 -1.586663 .1492336
--------------+----------------------------------------------------------------
qdid |
q50 | -.1740937 .3344224 -0.52 0.603 -.8295496 .4813622
q90 | -1.389872 .8285711 -1.68 0.093 -3.013842 .2340974
--------------+----------------------------------------------------------------
continuous |
mean | -.8076742 .475063 -1.70 0.089 -1.738781 .1234321
q50 | -.4009647 .4676812 -0.86 0.391 -1.317603 .5156735
q90 | -1.149755 1.060728 -1.08 0.278 -3.228744 .9292329
--------------+----------------------------------------------------------------
discrete_ci |
mean | -.8076742 .475063 -1.70 0.089 -1.738781 .1234321
q50 | -.4009647 .4676812 -0.86 0.391 -1.317603 .5156735
q90 | -1.149755 1.060728 -1.08 0.278 -3.228744 .9292329
--------------+----------------------------------------------------------------
dci_lower_bnd |
mean | -.8076742 .475063 -1.70 0.089 -1.738781 .1234321
q50 | -.4009647 .4676812 -0.86 0.391 -1.317603 .5156735
q90 | -1.149755 1.060728 -1.08 0.278 -3.228744 .9292329
--------------+----------------------------------------------------------------
dci_upper_bnd |
mean | -.8076742 .475063 -1.70 0.089 -1.738781 .1234321
q50 | -.4009647 .4676812 -0.86 0.391 -1.317603 .5156735
q90 | -1.149755 1.060728 -1.08 0.278 -3.228744 .9292329
-------------------------------------------------------------------------------
(Effect of Treatment on the Treated Group)
. cic all wage TREAT POST, vce(delta) at(50)
Changes in Changes (CIC) Model
Number of obs = 2,246
-------------------------------------------------------------------------------
wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------+----------------------------------------------------------------
continuous |
mean | -.8076742 .524304 -1.54 0.124 -1.835847 .2204987
q50 | -.4009647 . . . . .
--------------+----------------------------------------------------------------
discrete_ci |
mean | -.8076742 .3665384 -2.20 0.028 -1.526465 -.0888834
q50 | -.4009647 . . . . .
--------------+----------------------------------------------------------------
dci_lower_bnd |
mean | -.8076742 .368935 -2.19 0.029 -1.531165 -.0841836
q50 | -.4009647 . . . . .
--------------+----------------------------------------------------------------
dci_upper_bnd |
mean | -.8076742 .3665384 -2.20 0.028 -1.526465 -.0888834
q50 | -.4009647 . . . . .
-------------------------------------------------------------------------------
Effect of Treatment on the Treated Group
Continuous CIC model [continuous]
Discrete CIC model (under the conditional independence assumption) [discrete_ci]
Lower bound for the discrete CIC model (without conditional independence) [dci_lower_bnd]
Upper bound for the discrete CIC model (without conditional independence) [dci_upper_bnd]
. cic dci wage TREAT POST i.occupation, at(50) vce(bootstrap, reps(50))
Bootstrap replications (50)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
.................................................. 50
Changes in Changes (CIC) Model
Bootstrap results
Number of strata = 4 Number of obs = 2,237
Replications = 50
command: cic
-----------------------------------------------------------------------------------------
| Observed Bootstrap Normal-based
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
------------------------+----------------------------------------------------------------
did_model |
TREAT#POST |
0 0 | 10.45222 .3645118 28.67 0.000 9.737793 11.16665
0 1 | 9.975612 .4336514 23.00 0.000 9.125671 10.82555
1 0 | 11.99547 .374359 32.04 0.000 11.26174 12.7292
1 1 | 10.56486 .412829 25.59 0.000 9.755732 11.37399
|
occupation |
Professional/technical | 0 (empty)
Managers/admin | .1554287 .6024365 0.26 0.796 -1.025325 1.336183
Sales | -3.586821 .4012581 -8.94 0.000 -4.373272 -2.80037
Clerical/unskilled | -2.214702 .9890147 -2.24 0.025 -4.153135 -.2762684
Craftsmen | -3.542241 .7176089 -4.94 0.000 -4.948729 -2.135753
Operatives | -5.088737 .3514311 -14.48 0.000 -5.77753 -4.399945
Transport | -7.51579 .4115874 -18.26 0.000 -8.322486 -6.709093
Laborers | -5.849375 .3896969 -15.01 0.000 -6.613167 -5.085583
Farmers | -2.924082 1.445677 -2.02 0.043 -5.757557 -.0906069
Farm laborers | -7.699012 .4021461 -19.14 0.000 -8.487204 -6.91082
Service | -4.785211 .5244189 -9.12 0.000 -5.813053 -3.757369
Household workers | -4.596652 1.565714 -2.94 0.003 -7.665395 -1.527909
Other | -1.879271 .509485 -3.69 0.000 -2.877843 -.8806983
------------------------+----------------------------------------------------------------
did |
did | -.9539952 .4615821 -2.07 0.039 -1.85868 -.0493109
------------------------+----------------------------------------------------------------
qdid |
q50 | -.5419426 .355571 -1.52 0.127 -1.238849 .1549638
------------------------+----------------------------------------------------------------
discrete_ci |
mean | -.9915892 .5090583 -1.95 0.051 -1.989325 .0061468
q50 | -.5362072 .2843468 -1.89 0.059 -1.093517 .0211023
-----------------------------------------------------------------------------------------
Effect of Treatment on the Treated Group
Traditional DID model [did], [did_model]
Quantile DID model [qdid]
Discrete CIC model (under the conditional independence assumption) [discrete_ci]
.
. log close
name: <unnamed>
log: C:\Users\kkranker\Documents\Stata\cic\code-cic\cic_examples.log
log type: text
closed on: 5 Nov 2019, 22:15:04
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------