From db9e34e3b4afed36b34e04610961e9b3fe58e54b Mon Sep 17 00:00:00 2001 From: Keith Kranker Date: Wed, 5 Jun 2019 01:01:28 -0600 Subject: [PATCH] Remove graph program and testing scripts from the master branch --- cic_benchmark_testing.do | 403 ----- cic_benchmark_testing.log | 3554 ------------------------------------- cicgraph.ado | 143 -- 3 files changed, 4100 deletions(-) delete mode 100644 cic_benchmark_testing.do delete mode 100644 cic_benchmark_testing.log delete mode 100644 cicgraph.ado diff --git a/cic_benchmark_testing.do b/cic_benchmark_testing.do deleted file mode 100644 index 8f2e6bb..0000000 --- a/cic_benchmark_testing.do +++ /dev/null @@ -1,403 +0,0 @@ -*! $Id$ -*! Examples of Stata implimetation of the changes-in-changes model (cic.ado) -*! Stata code by Keith Kranker -*! Last updated $Date$ - -clear all -cap nois cd "C:\Users\keith\Desktop\cic" -if _rc nois cd "C:\Users\kkranker\Documents\Dissertation\Stata-Changes-in-Changes" -include cic.ado - - - -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -set tracedepth 3 -if 0 set trace on -else set trace off -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -local Nreps = 200 -if 01 local vce "vce(bootstrap, reps(\`Nreps'))" -else macro drop _vce -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - - -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* Benchmark againt results in Athey and Imbens supplimental appendix -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - -// load data - -qui { - infix y 1-4 after 7-8 high 9-10 male 11-12 marital 13-14 manu 17-18 /// - constr 19-20 head 21-22 neck 23-24 upper_extr 25-26 trunk 27-28 /// - low_back 29-30 lower_extr 31-32 occ_dis 33-34 state 39-41 v18 37-38 /// - age 42-44 prev_earn 45-60 /// - using A_I_Matlab\mvd.dat - - gen ind=(age<99) & (marital<8) & (male<9) & (manu<8) & (constr<8) & (v18<9) - replace head=head==1 - replace neck=neck==1 - replace upper_extr=upper_extr==1 - replace trunk=trunk==1 - replace low_back=low_back==1 - replace lower_extr=lower_extr==1 - replace occ_dis=occ_dis==1 - gen ky=state==16 - keep if ky - - replace y=.25 if (y==0) // add 0.25 to zero durations before taking logarithms - gen ly=log(y) - - gen high_after = . - replace high_after = 1 if high==0 & after==0 - replace high_after = 2 if high==0 & after==1 - replace high_after = 3 if high==1 & after==0 - replace high_after = 4 if high==1 & after==1 - label define high_after 1 "Control Group, 1st Period" /// - 2 "Control Group, 2nd Period" /// - 3 "Treatment Group, 1st Period" /// - 4 "Treatment Group, 2nd Period" - label val high_after high_after -} -set seed 1 - -cap log close -log using cic_benchmark_testing.log, replace - -mac list _Nreps _vce - -// Table 1 -count -tabstat y ly , by(high_after) s(count mean sd min p25 p50 p75 p90 max) columns(s) labelwidth(30) nototal format(%9.2f) - -// DID estimate -reg y high##after -reg ly high##after - -// cic estimates from A&I Appendix -// Table 2 -timer on 2 -cic all y high after , at(25 50 75 90) `vce' did -cic all ly high after , at(50) `vce' did -timer off 2 -timer list 2 - - - -// Table 3 -timer on 3 -cic all y high after , at(25 50 75 90) `vce' untreated did -cic all ly high after , at(50) `vce' untreated did -timer off 3 -timer list 3 - -// graphs -cic all y high after , at(1 5(2.5)90) `vce' -ereturn list -cicgraph, name(g) e(continuous discrete_ci dci_lower_bnd dci_upper_bnd) - - -// VCE via delta metho -cic all y high after, vce(delta) at(25 50 75 90) -cic all y high after, vce(delta) did at(25 50 75 90) - - -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* Test misc features with this dataset -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - -* Basic -cic all y high after, at(5(10)95) `vce' did - -* With control variables -egen agegroup = cut(age), group(7) -cic all y high after i.agegroup, did `vce' round(.25) - -* Test recall -cic -cicgraph , name(r0) - -* With weights -gen tempweight = 1 -replace tempweight = 2 in 1 -cic all ly high after [fw=tempweight], did `vce' - -* With control variables and weights -timer on 24 -cic all ly high after i.agegroup [fw=tempweight], did `vce' round(.25) -timer off 24 -timer list - -// compare vce() option above to the bootstrap prefix -set seed 1 -timer on 10 -cic all y high after, vce(bootstrap, reps(`Nreps')) -timer off 10 -timer list 10 -ereturn list -estat bootstrap , all // estat bootstrap does work - -cic // test replay works -est store a - -timer on 12 -cap nois bootstrap, reps(`Nreps') strata(high after) : cic all y high after -timer off 12 -timer list 12 - -// test if selected vars works -cap nois bootstrap [continuous]_b[mean], reps(20) strata(high after) : cic all y high after - -// test jacknife -jacknife: cic all y high after if uniform()<.1 - -// check fweights are working -// I should get the same results if I use fweights or if I expand the datset -preserve - gen testweight =(uniform()<.95) + (uniform()<.20) - tab testweight - cic all y high after [fw=testweight], at(25 50 75 90) `vce' - drop if testweight==0 - expand testweight - cic all y high after , at(25 50 75 90) `vce' -restore - -// check other weights are working -preserve - gen testweight = max(0,rnormal(1.25,.05)) - summ testweight - cic all y high after [iw=testweight], at(25 50 75 90) `vce' - cic all y high after [aw=testweight], at(25 50 75 90) `vce' - cap nois cic all y high after [pw=testweight], at(25 50 75 90) `vce' - cap nois cic all y high after [pw=testweight], at(25 50 75 90) vce(none) -restore - -// check it works with svy bootstrap. -// This example is just quick-and-dirty. -// It does not account for the fact that you might want to include strata(high after) in some applications. -preserve - forvalues i = 1/100 { - gen testweight`i' = max(0,rnormal(1.25,.05)) - local testweightlist `testweightlist' testweight`i' - } - bys high after: gen rownum=_n - xtile gid=rownum, nq(10) - svyset gid, bsrweight(`testweightlist') vce(bootstrap) - svy : cic all y high after -restore - - -// direct comparision of vce() options -est restore a -cic -set seed 1 -cic all y high after, vce(boot, reps(`Nreps') sepercentile) -cic all y high after, vce(delta) -cic all y high after, vce(none) - -// test various combinations of estimators/vce/graphs with graphs -cic all y high after , at(25 50 75) vce(bootstrap, reps(5)) -cicgraph, name(all) -cic dci y high after , at(25 50 75) vce(bootstrap, reps(5)) -cicgraph, name(dci) -cic continuous y high after , at(25 50 75) vce(bootstrap, reps(5)) -cic bounds y high after , at(25 50 75) vce(bootstrap, reps(5)) did -cicgraph, name(bounds) eq(qdid dci_lower_bnd) -cic continuous y high after , at(25 50 75) vce(none) -cicgraph,name(novce) - - - -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* The following code can be used to test the program using another -* "fake" data set -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -sysuse nlsw88, clear -set seed 1 -gen TREAT1 = uniform() < .5 -replace wage = wage + TREAT1 -gen POST1 = uniform() < .5 -replace wage = wage - POST1 - -// bootstrap the sample conditional on Ngt for g; t = 0; 1 -cic all wage TREAT1 POST1 i.occupation, at(10(10)90 99.5) - - - -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* The following code can be used to test the program using "fake" data -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -clear -set obs 4 -gen post = inlist(_n,1,3) -gen treat = inlist(_n,1,2) -local n_g=500 -expand `n_g' -bys p t: gen y = _n / `n_g' -gen d = 1.75 - 1.5 * y if t==0 & p==0 -replace d = 0.75 - 0.5 * y if t==0 & p==1 -replace d = 0.80 - 0.4 * y if t==1 & p==0 -replace d = 0.50 - 1.0 * y if t==1 & p==1 -replace d = round(d,.01) -cic all d treat post, at(10(10)90) vce(b) - -cicgraph , name(r1) -cicgraph , ci(ci_percentile) name(r2) - - - - -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* The following code tests various sub-functions -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - -/* * * * * BEGIN MATA BLOCK * * * * */ -version 11.2 -mata: -mata set matastrict on -mata set matafavor speed -mata set matalnum on /* drop this later */ - -"check prob" -prob((1\1\2\3),(1\2\3\4\5)) -prob((1\1\2\3),(1\2\3\4\5),(1\1\2\1)) -prob((1\ 2\3),(1\2\3\4\5),(2 \2\1)) -prob((1\ 2\3),(1\2\3\4\5),(1.5\1.5\.75)) - -"check cdfinv & cdfinv_brckt" -P = (.1\.3\.6\.7\1.0) -YS = (1\2\3\4\5) -/* 1 = */ cdfinv(.05 , P, YS) -/* 1 = */ cdfinv(.1 , P, YS) -/* 2 = */ cdfinv(.2 , P, YS) -/* 2 = */ cdfinv(.2999, P, YS) -/* 2 = */ cdfinv(.3 , P, YS) -/* 3 = */ cdfinv(.3001, P, YS) -/* 5 = */ cdfinv(.9999, P, YS) -/* 5 = */ cdfinv(1 , P, YS) - -/* -499 = */ cdfinv_brckt(.05 , P, YS) -/* 1 = */ cdfinv_brckt(.1 , P, YS) -/* 1 = */ cdfinv_brckt(.2 , P, YS) -/* 1 = */ cdfinv_brckt(.2999, P, YS) -/* 2 = */ cdfinv_brckt(.3 , P, YS) -/* 2 = */ cdfinv_brckt(.3001, P, YS) -/* 4 = */ cdfinv_brckt(.9999, P, YS) -/* 5 = */ cdfinv_brckt(1 , P, YS) - - -// YS -// bs_draw_nowgt(YS) -// bs_draw_nowgt(YS,(10\1\1\1\0)) - - -// check draw sample -YS = (1\2\3\4\5\6\7\8) -N00=N01=N10=N11=2 -for (i=1; i<=1000; i++) { - bs_draw = bs_draw_wgt((1\2),(3\4),(5\6),(7\8),N00, N01, N10, N11) - if (i==1) bs_draw - if (i==1) avg = bs_draw' - else avg = (avg \ bs_draw') -} -meanvariance(avg)' -colmin(avg)' -colmax(avg)' - -popsize=rows(YS) -tempwgt = (1\9\1\9\1\9\1\9) -cumsum00 = quadrunningsum(tempwgt[1\2]) -cumsum01 = quadrunningsum(tempwgt[3\4]) -cumsum10 = quadrunningsum(tempwgt[5\6]) -cumsum11 = quadrunningsum(tempwgt[7\8]) -popsize00 = round(cumsum00[N00]) // the number of obs. in each group is rounded to the nearest integer -popsize01 = round(cumsum01[N01]) -popsize10 = round(cumsum10[N10]) -popsize11 = round(cumsum11[N11]) -cumsum00 = cumsum00/cumsum00[N00] // normalize to sum to one within groups -cumsum01 = cumsum01/cumsum01[N01] -cumsum10 = cumsum10/cumsum10[N10] -cumsum11 = cumsum11/cumsum11[N11] - -cumsum00 -popsize00 - -for (i=1; i<=1000; i++) { - bs_draw = bs_draw_wgt((1\2),(3\4),(5\6),(7\8),N00, N01, N10, N11, cumsum00, cumsum01, cumsum10, cumsum11, popsize00, popsize01, popsize10, popsize11) - if (i==1) bs_draw - if (i==1) avg = bs_draw' - else avg = (avg \ bs_draw') -} -meanvariance(avg)' -colmin(avg)' -colmax(avg)' - -popsize=1000 -cumsum00 = quadrunningsum(tempwgt[1\2]) -cumsum01 = quadrunningsum(tempwgt[3\4]) -cumsum10 = quadrunningsum(tempwgt[5\6]) -cumsum11 = quadrunningsum(tempwgt[7\8]) -popsize00 = round(cumsum00[N00]/colsum(tempwgt)*popsize) // the number of obs. in each group is rounded to the nearest integer -popsize01 = round(cumsum00[N00]/colsum(tempwgt)*popsize) -popsize10 = round(cumsum00[N00]/colsum(tempwgt)*popsize) -popsize11 = round(cumsum00[N00]/colsum(tempwgt)*popsize) -cumsum00 = cumsum00/cumsum00[N00] // normalize to sum to one within groups -cumsum01 = cumsum01/cumsum01[N01] -cumsum10 = cumsum10/cumsum10[N10] -cumsum11 = cumsum11/cumsum11[N11] - - -cumsum00 -popsize00 - -for (i=1; i<=100; i++) { - bs_draw = bs_draw_wgt((1\2),(3\4),(5\6),(7\8),N00, N01, N10, N11, cumsum00, cumsum01, cumsum10, cumsum11, popsize00, popsize01, popsize10, popsize11) - if (i==1) bs_draw - if (i==1) avg = bs_draw' - else avg = (avg \ bs_draw') -} -meanvariance(avg)' -colmin(avg)' -colmax(avg)' - -cumdfinv((1::10), .94 ) -cumdfinv((1::10), .94, J(10,1,1)) -cumdfinv((1::10), .9 ) -cumdfinv((1::10), .9 , J(10,1,1)) - -cumdfinv((1::9) , .94 ,(2\J(8,1,1))) -cumdfinv((1::9) , .84 ,(J(8,1,1)\2)) -cumdfinv((1::9) , .9 ,(2\J(8,1,1))) -cumdfinv((1::9) , .8 ,(J(8,1,1)\2)) - -// test fden w/ this vector -Y= ( 1.11 \ 1.1 \ 1.2 \ 1.3 \ 5 \ 5.1 \ 5.2 \ 10 \ 10 \ 10 ) - -// the following three should all equal 0.072278 -fden(1.1,Y) // no weights -fden(1.1,Y, J(10,1,1) ) // weight = 1 -fden(1.1,Y[1..8], (J(7,1,1) \ 3) ) // weight = 1, except handle three "10" at bottom - -// the following two should equal 0.076557 -fden(1.1,(Y\Y)) // stack Y on top of itself -fden(1.1,Y, J(10,1,2)) // weight = 2 - - - -mata describe - -end -/* * * * * END OF MATA BLOCK * * * * */ - - -* test cic_vce_parse -cic_vce_parse, vce(boot, reps(1000) saving(myfile.dta, replace) sepercent) -return list -cap nois cic_vce_parse, vce(none, reps(25)) -return list -cic_vce_parse, vce(boot, reps(25) mse accel(myvector) saving("c:\temp\test.dta", replace)) -return list - -log close - diff --git a/cic_benchmark_testing.log b/cic_benchmark_testing.log deleted file mode 100644 index 82d1b7d..0000000 --- a/cic_benchmark_testing.log +++ /dev/null @@ -1,3554 +0,0 @@ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - name: - log: C:\Users\kkranker\Documents\Dissertation\Stata-Changes-in-Changes\cic_benchmark_testing.log - log type: text - opened on: 5 Jan 2015, 13:54:03 - -. -. mac list _Nreps _vce -_Nreps: 200 -_vce: vce(bootstrap, reps(200)) - -. -. // Table 1 -. count - 5626 - -. tabstat y ly , by(high_after) s(count mean sd min p25 p50 p75 p90 max) columns(s) labelwidth(30) nototal format(%9.2f) - -Summary for variables: y ly - by categories of: high_after - - high_after | N mean sd min p25 p50 p75 p90 max -----------------------------+------------------------------------------------------------------------------------------ - Control Group, 1st Period | 1705.00 6.27 12.43 0.25 1.00 3.00 7.00 12.00 182.00 - | 1705.00 1.13 1.22 -1.39 0.00 1.10 1.95 2.48 5.20 -----------------------------+------------------------------------------------------------------------------------------ - Control Group, 2nd Period | 1527.00 7.04 16.12 0.25 1.00 3.00 7.00 14.00 182.00 - | 1527.00 1.13 1.27 -1.39 0.00 1.10 1.95 2.64 5.20 -----------------------------+------------------------------------------------------------------------------------------ -Treatment Group, 1st Period | 1233.00 11.18 28.99 0.25 2.00 4.00 8.00 17.00 182.00 - | 1233.00 1.38 1.30 -1.39 0.69 1.39 2.08 2.83 5.20 -----------------------------+------------------------------------------------------------------------------------------ -Treatment Group, 2nd Period | 1161.00 12.89 28.25 0.25 2.00 5.00 10.00 23.00 182.00 - | 1161.00 1.58 1.30 -1.39 0.69 1.61 2.30 3.14 5.20 ------------------------------------------------------------------------------------------------------------------------ - -. -. // DID estimate -. reg y high##after - - Source | SS df MS Number of obs = 5626 --------------+------------------------------ F( 3, 5622) = 30.02 - Model | 41982.2909 3 13994.097 Prob > F = 0.0000 - Residual | 2620635.86 5622 466.139428 R-squared = 0.0158 --------------+------------------------------ Adj R-squared = 0.0152 - Total | 2662618.15 5625 473.354338 Root MSE = 21.59 - ------------------------------------------------------------------------------- - y | Coef. Std. Err. t P>|t| [95% Conf. Interval] --------------+---------------------------------------------------------------- - 1.high | 4.905048 .8071237 6.08 0.000 3.322774 6.487322 - 1.after | .7657738 .7606973 1.01 0.314 -.7254866 2.257034 - | - high#after | - 1 1 | .9512506 1.165423 0.82 0.414 -1.333429 3.23593 - | - _cons | 6.271554 .5228724 11.99 0.000 5.246522 7.296586 ------------------------------------------------------------------------------- - -. reg ly high##after - - Source | SS df MS Number of obs = 5626 --------------+------------------------------ F( 3, 5622) = 39.54 - Model | 191.071442 3 63.6904807 Prob > F = 0.0000 - Residual | 9055.9345 5622 1.61080301 R-squared = 0.0207 --------------+------------------------------ Adj R-squared = 0.0201 - Total | 9247.00594 5625 1.64391217 Root MSE = 1.2692 - ------------------------------------------------------------------------------- - ly | Coef. Std. Err. t P>|t| [95% Conf. Interval] --------------+---------------------------------------------------------------- - 1.high | .2564785 .0474464 5.41 0.000 .1634652 .3494918 - 1.after | .0076573 .0447173 0.17 0.864 -.0800058 .0953204 - | - high#after | - 1 1 | .1906012 .0685089 2.78 0.005 .0562973 .3249051 - | - _cons | 1.125615 .0307368 36.62 0.000 1.065359 1.185871 ------------------------------------------------------------------------------- - -. -. // cic estimates from A&I Appendix -. // Table 2 -. timer on 2 - -. cic all y high after , at(25 50 75 90) `vce' did - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -did_model | - high#after | - 0 0 | 6.271554 .3127365 20.05 0.000 5.658602 6.884507 - 0 1 | 7.037328 .4111431 17.12 0.000 6.231502 7.843154 - 1 0 | 11.1766 .8039706 13.90 0.000 9.600848 12.75236 - 1 1 | 12.89363 .8266156 15.60 0.000 11.27349 14.51376 ---------------+---------------------------------------------------------------- -did | - did | .9512506 1.145542 0.83 0.406 -1.293971 3.196472 ---------------+---------------------------------------------------------------- -qdid | - q25 | -.7657738 .5878918 -1.30 0.193 -1.918021 .3864728 - q50 | .2342262 .6059106 0.39 0.699 -.9533367 1.421789 - q75 | 1.234226 .6913621 1.79 0.074 -.1208187 2.589271 - q90 | 5.234226 2.04942 2.55 0.011 1.217436 9.251016 ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.533038 0.70 0.483 -1.928592 4.080807 - q25 | 1 .5611465 1.78 0.075 -.0998269 2.099827 - q50 | 2 .5633487 3.55 0.000 .8958567 3.104143 - q75 | 2 .8089325 2.47 0.013 .4145213 3.585479 - q90 | 5 2.572443 1.94 0.052 -.0418954 10.0419 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.465503 0.27 0.789 -2.480298 3.264368 - q25 | 0 .4450735 0.00 1.000 -.8723281 .8723281 - q50 | 1 .4245897 2.36 0.019 .1678196 1.83218 - q75 | 2 .8220577 2.43 0.015 .3887965 3.611204 - q90 | 5 2.564617 1.95 0.051 -.0265573 10.02656 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.516733 0.05 0.963 -2.902919 3.042564 - q25 | 0 .6092874 0.00 1.000 -1.194181 1.194181 - q50 | 1 .5994134 1.67 0.095 -.1748288 2.174829 - q75 | 1 .883105 1.13 0.257 -.7308539 2.730854 - q90 | 4 2.664446 1.50 0.133 -1.222218 9.222218 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.533038 0.70 0.483 -1.928592 4.080807 - q25 | 1 .5611465 1.78 0.075 -.0998269 2.099827 - q50 | 2 .5633487 3.55 0.000 .8958567 3.104143 - q75 | 2 .8089325 2.47 0.013 .4145213 3.585479 - q90 | 5 2.572443 1.94 0.052 -.0418954 10.0419 -------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Traditional DID model [did], [did_model] ( == 1 - high) -Quantile DID model [qdid] -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 all ly high after , at(50) `vce' did - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -did_model | - high#after | - 0 0 | 1.125615 .0299486 37.58 0.000 1.066917 1.184314 - 0 1 | 1.133273 .0330534 34.29 0.000 1.068489 1.198056 - 1 0 | 1.382094 .0364239 37.94 0.000 1.310704 1.453483 - 1 1 | 1.580352 .0403614 39.16 0.000 1.501245 1.659459 ---------------+---------------------------------------------------------------- -did | - did | .1906012 .0720186 2.65 0.008 .0494473 .3317551 ---------------+---------------------------------------------------------------- -qdid | - q50 | .2154863 .1021398 2.11 0.035 .0152959 .4156766 ---------------+---------------------------------------------------------------- -continuous | - mean | .583609 .1627377 3.59 0.000 .2646489 .9025691 - q50 | .5108256 .1515459 3.37 0.001 .2138011 .8078502 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .182626 .0723581 2.52 0.012 .0408067 .3244453 - q50 | .2231436 .1052924 2.12 0.034 .0167743 .4295129 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .1364867 .1253891 1.09 0.276 -.1092715 .3822448 - q50 | .2231436 .1507968 1.48 0.139 -.0724126 .5186998 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | .583609 .1627377 3.59 0.000 .2646489 .9025691 - q50 | .5108256 .1515459 3.37 0.001 .2138011 .8078502 -------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Traditional DID model [did], [did_model] ( == 1 - high) -Quantile DID model [qdid] -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] - -. timer off 2 - -. timer list 2 - 2: 11.62 / 1 = 11.6200 - -. -. -. -. // Table 3 -. timer on 3 - -. cic all y high after , at(25 50 75 90) `vce' untreated did - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - - command: cic - --------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- -did_model | -__000001#after | - 0 0 | 11.1766 .8952932 12.48 0.000 9.421859 12.93134 - 0 1 | 12.89363 .8666644 14.88 0.000 11.195 14.59226 - 1 0 | 6.271554 .3299653 19.01 0.000 5.624834 6.918274 - 1 1 | 7.037328 .4176236 16.85 0.000 6.218801 7.855855 ----------------+---------------------------------------------------------------- -did | - did | .9512506 1.463695 0.65 0.516 -1.917539 3.82004 ----------------+---------------------------------------------------------------- -qdid | - q25 | 1.717024 1.349219 1.27 0.203 -.9273969 4.361446 - q50 | 1.717024 1.476493 1.16 0.245 -1.176849 4.610897 - q75 | 1.717024 1.384674 1.24 0.215 -.9968864 4.430935 - q90 | -.2829756 1.7425 -0.16 0.871 -3.698213 3.132261 ----------------+---------------------------------------------------------------- -continuous | - mean | .3051939 1.039264 0.29 0.769 -1.731727 2.342114 - q25 | 0 .2734022 0.00 1.000 -.5358584 .5358584 - q50 | 0 .6307848 0.00 1.000 -1.236315 1.236315 - q75 | 1 .7860435 1.27 0.203 -.5406169 2.540617 - q90 | 0 2.148735 0.00 1.000 -4.211442 4.211442 ----------------+---------------------------------------------------------------- -discrete_ci | - mean | .9230141 1.071525 0.86 0.389 -1.177136 3.023164 - q25 | 1 .4562244 2.19 0.028 .1058166 1.894183 - q50 | 1 .3933812 2.54 0.011 .2289871 1.771013 - q75 | 2 .8372604 2.39 0.017 .3589997 3.641 - q90 | 1 2.46338 0.41 0.685 -3.828136 5.828136 ----------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .3051939 1.039264 0.29 0.769 -1.731727 2.342114 - q25 | 0 .2734022 0.00 1.000 -.5358584 .5358584 - q50 | 0 .6307848 0.00 1.000 -1.236315 1.236315 - q75 | 1 .7860435 1.27 0.203 -.5406169 2.540617 - q90 | 0 2.148735 0.00 1.000 -4.211442 4.211442 ----------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.558566 1.102029 1.41 0.157 -.6013705 3.718503 - q25 | 1 .3323436 3.01 0.003 .3486185 1.651381 - q50 | 1 .7184573 1.39 0.164 -.4081504 2.40815 - q75 | 3 .8051967 3.73 0.000 1.421843 4.578157 - q90 | 2 2.700809 0.74 0.459 -3.293489 7.293489 --------------------------------------------------------------------------------- -Effect of Treatment on the Untreated Group -Traditional DID model [did], [did_model] (__000001 == 1 - high) -Quantile DID model [qdid] -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 all ly high after , at(50) `vce' untreated did - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - - command: cic - --------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- -did_model | -__000001#after | - 0 0 | 1.382094 .0335375 41.21 0.000 1.316362 1.447826 - 0 1 | 1.580352 .0382087 41.36 0.000 1.505465 1.65524 - 1 0 | 1.125615 .0314391 35.80 0.000 1.063996 1.187235 - 1 1 | 1.133273 .0335246 33.80 0.000 1.067566 1.19898 ----------------+---------------------------------------------------------------- -did | - did | .1906012 .0686567 2.78 0.006 .0560365 .3251659 ----------------+---------------------------------------------------------------- -qdid | - q50 | .1982585 .1878043 1.06 0.291 -.1698311 .5663481 ----------------+---------------------------------------------------------------- -continuous | - mean | .0512383 .0610389 0.84 0.401 -.0683956 .1708723 - q50 | 0 .2046316 0.00 1.000 -.4010705 .4010705 ----------------+---------------------------------------------------------------- -discrete_ci | - mean | .2110083 .0691303 3.05 0.002 .0755153 .3465013 - q50 | .2876821 .0999363 2.88 0.004 .0918106 .4835535 ----------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0512383 .0610389 0.84 0.401 -.0683956 .1708723 - q50 | 0 .2046316 0.00 1.000 -.4010705 .4010705 ----------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | .4589945 .0623991 7.36 0.000 .3366945 .5812946 - q50 | .2876821 .1791278 1.61 0.108 -.0634019 .638766 --------------------------------------------------------------------------------- -Effect of Treatment on the Untreated Group -Traditional DID model [did], [did_model] (__000001 == 1 - high) -Quantile DID model [qdid] -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] - -. timer off 3 - -. timer list 3 - 3: 12.47 / 1 = 12.4740 - -. -. // graphs -. cic all y high after , at(1 5(2.5)90) `vce' - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.41175 0.76 0.446 -1.690871 3.843086 - q1 | 0 (omitted) - q5 | .75 .1473382 5.09 0.000 .4612225 1.038778 - q7_5 | .75 .3277162 2.29 0.022 .107688 1.392312 - q10 | .75 .3277162 2.29 0.022 .107688 1.392312 - q12_5 | .75 .3277162 2.29 0.022 .107688 1.392312 - q15 | .75 .3277162 2.29 0.022 .107688 1.392312 - q17_5 | .75 .3660168 2.05 0.040 .0326203 1.46738 - q20 | 1.75 .5941177 2.95 0.003 .5855507 2.914449 - q22_5 | 1.75 .582939 3.00 0.003 .6074606 2.892539 - q25 | 1 .585298 1.71 0.088 -.1471631 2.147163 - q27_5 | 2 .6855288 2.92 0.004 .6563882 3.343612 - q30 | 2 .6952639 2.88 0.004 .6373077 3.362692 - q32_5 | 1 .5166572 1.94 0.053 -.0126295 2.01263 - q35 | 1 .4930675 2.03 0.043 .0336054 1.966395 - q37_5 | 1 .5963878 1.68 0.094 -.1688986 2.168899 - q40 | 2 .6799165 2.94 0.003 .6673882 3.332612 - q42_5 | 2 .5581511 3.58 0.000 .9060439 3.093956 - q45 | 1 .6260669 1.60 0.110 -.2270686 2.227069 - q47_5 | 1 .6007533 1.66 0.096 -.1774548 2.177455 - q50 | 2 .5740625 3.48 0.000 .8748582 3.125142 - q52_5 | 2 .6348149 3.15 0.002 .7557857 3.244214 - q55 | 1 .8686471 1.15 0.250 -.702517 2.702517 - q57_5 | 2 .5809151 3.44 0.001 .8614274 3.138573 - q60 | 2 .7433288 2.69 0.007 .5431023 3.456898 - q62_5 | 2 .6183135 3.23 0.001 .7881279 3.211872 - q65 | 2 .6186182 3.23 0.001 .7875307 3.212469 - q67_5 | 3 .892726 3.36 0.001 1.250289 4.749711 - q70 | 2 .7595125 2.63 0.008 .5113828 3.488617 - q72_5 | 2 .8505245 2.35 0.019 .3330026 3.666997 - q75 | 2 .8118315 2.46 0.014 .4088395 3.59116 - q77_5 | 2 1.083638 1.85 0.065 -.1238915 4.123891 - q80 | 3 1.219605 2.46 0.014 .6096175 5.390383 - q82_5 | 1 1.410513 0.71 0.478 -1.764555 3.764555 - q85 | 2 1.546076 1.29 0.196 -1.030254 5.030254 - q87_5 | 3 2.047648 1.47 0.143 -1.013317 7.013317 - q90 | 5 2.32366 2.15 0.031 .4457096 9.55429 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.370898 0.29 0.775 -2.294875 3.078945 - q1 | 0 (omitted) - q5 | .75 .2684756 2.79 0.005 .2237975 1.276202 - q7_5 | 0 .2486616 0.00 1.000 -.4873678 .4873678 - q10 | 0 (omitted) - q12_5 | 0 (omitted) - q15 | 0 (omitted) - q17_5 | 0 .1565167 0.00 1.000 -.3067672 .3067672 - q20 | 1 .5174347 1.93 0.053 -.0141534 2.014153 - q22_5 | 1 .4731749 2.11 0.035 .0725943 1.927406 - q25 | 0 .4689076 0.00 1.000 -.9190421 .9190421 - q27_5 | 1 .5154644 1.94 0.052 -.0102916 2.010292 - q30 | 1 .503031 1.99 0.047 .0140773 1.985923 - q32_5 | 0 .4118533 0.00 1.000 -.8072176 .8072176 - q35 | 0 .1403513 0.00 1.000 -.2750835 .2750835 - q37_5 | 0 .3007528 0.00 1.000 -.5894647 .5894647 - q40 | 1 .4972032 2.01 0.044 .0254996 1.9745 - q42_5 | 1 .3198225 3.13 0.002 .3731594 1.626841 - q45 | 1 .4915364 2.03 0.042 .0366063 1.963394 - q47_5 | 0 .6090606 0.00 1.000 -1.193737 1.193737 - q50 | 1 .4381035 2.28 0.022 .1413329 1.858667 - q52_5 | 1 .4019738 2.49 0.013 .2121459 1.787854 - q55 | 0 .6586113 0.00 1.000 -1.290854 1.290854 - q57_5 | 1 .4245897 2.36 0.019 .1678196 1.83218 - q60 | 1 .5758105 1.74 0.082 -.1285679 2.128568 - q62_5 | 1 .6160337 1.62 0.105 -.2074038 2.207404 - q65 | 1 .5835044 1.71 0.087 -.1436476 2.143648 - q67_5 | 2 .6945408 2.88 0.004 .638725 3.361275 - q70 | 2 .7338033 2.73 0.006 .5617719 3.438228 - q72_5 | 2 .7661002 2.61 0.009 .4984712 3.501529 - q75 | 2 .7240311 2.76 0.006 .580925 3.419075 - q77_5 | 2 1.091032 1.83 0.067 -.1383843 4.138384 - q80 | 2 1.091205 1.83 0.067 -.1387228 4.138723 - q82_5 | 1 1.303021 0.77 0.443 -1.553875 3.553875 - q85 | 2 1.523155 1.31 0.189 -.9853282 4.985328 - q87_5 | 3 2.055994 1.46 0.145 -1.029674 7.029674 - q90 | 5 2.305314 2.17 0.030 .4816677 9.518332 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.415951 0.05 0.961 -2.705391 2.845036 - q1 | 0 .3277162 0.00 1.000 -.642312 .642312 - q5 | .75 .5597188 1.34 0.180 -.3470288 1.847029 - q7_5 | 0 .4921239 0.00 1.000 -.9645451 .9645451 - q10 | 0 .4921239 0.00 1.000 -.9645451 .9645451 - q12_5 | 0 .4921239 0.00 1.000 -.9645451 .9645451 - q15 | 0 .4921239 0.00 1.000 -.9645451 .9645451 - q17_5 | 0 .5357566 0.00 1.000 -1.050064 1.050064 - q20 | 1 .6856571 1.46 0.145 -.3438632 2.343863 - q22_5 | 1 .6760624 1.48 0.139 -.3250579 2.325058 - q25 | 0 .5994973 0.00 1.000 -1.174993 1.174993 - q27_5 | 1 .6655749 1.50 0.133 -.3045028 2.304503 - q30 | 1 .6117772 1.63 0.102 -.1990613 2.199061 - q32_5 | 0 .4594075 0.00 1.000 -.9004222 .9004222 - q35 | 0 .4218886 0.00 1.000 -.8268864 .8268864 - q37_5 | 0 .5239011 0.00 1.000 -1.026827 1.026827 - q40 | 1 .6306852 1.59 0.113 -.2361203 2.23612 - q42_5 | 1 .5785965 1.73 0.084 -.1340282 2.134028 - q45 | 0 .7515311 0.00 1.000 -1.472974 1.472974 - q47_5 | 0 .6904954 0.00 1.000 -1.353346 1.353346 - q50 | 1 .6275901 1.59 0.111 -.230054 2.230054 - q52_5 | 1 .5737122 1.74 0.081 -.1244553 2.124455 - q55 | 0 .7407045 0.00 1.000 -1.451754 1.451754 - q57_5 | 1 .5817795 1.72 0.086 -.1402668 2.140267 - q60 | 1 .9077555 1.10 0.271 -.7791681 2.779168 - q62_5 | 0 .746432 0.00 1.000 -1.46298 1.46298 - q65 | 0 .6505506 0.00 1.000 -1.275056 1.275056 - q67_5 | 1 .8356233 1.20 0.231 -.6377916 2.637792 - q70 | 1 .7646558 1.31 0.191 -.4986978 2.498698 - q72_5 | 1 .9229078 1.08 0.279 -.808866 2.808866 - q75 | 1 .8972879 1.11 0.265 -.758652 2.758652 - q77_5 | 1 1.184659 0.84 0.399 -1.321889 3.321889 - q80 | 2 1.295285 1.54 0.123 -.5387124 4.538712 - q82_5 | 0 1.349772 0.00 1.000 -2.645504 2.645504 - q85 | 1 1.560755 0.64 0.522 -2.059023 4.059023 - q87_5 | 2 2.103831 0.95 0.342 -2.123433 6.123433 - q90 | 4 2.386962 1.68 0.094 -.6783597 8.67836 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.41175 0.76 0.446 -1.690871 3.843086 - q1 | 0 (omitted) - q5 | .75 .1473382 5.09 0.000 .4612225 1.038778 - q7_5 | .75 .3277162 2.29 0.022 .107688 1.392312 - q10 | .75 .3277162 2.29 0.022 .107688 1.392312 - q12_5 | .75 .3277162 2.29 0.022 .107688 1.392312 - q15 | .75 .3277162 2.29 0.022 .107688 1.392312 - q17_5 | .75 .3660168 2.05 0.040 .0326203 1.46738 - q20 | 1.75 .5941177 2.95 0.003 .5855507 2.914449 - q22_5 | 1.75 .582939 3.00 0.003 .6074606 2.892539 - q25 | 1 .585298 1.71 0.088 -.1471631 2.147163 - q27_5 | 2 .6855288 2.92 0.004 .6563882 3.343612 - q30 | 2 .6952639 2.88 0.004 .6373077 3.362692 - q32_5 | 1 .5166572 1.94 0.053 -.0126295 2.01263 - q35 | 1 .4930675 2.03 0.043 .0336054 1.966395 - q37_5 | 1 .5963878 1.68 0.094 -.1688986 2.168899 - q40 | 2 .6799165 2.94 0.003 .6673882 3.332612 - q42_5 | 2 .5581511 3.58 0.000 .9060439 3.093956 - q45 | 1 .6260669 1.60 0.110 -.2270686 2.227069 - q47_5 | 1 .6007533 1.66 0.096 -.1774548 2.177455 - q50 | 2 .5740625 3.48 0.000 .8748582 3.125142 - q52_5 | 2 .6348149 3.15 0.002 .7557857 3.244214 - q55 | 1 .8686471 1.15 0.250 -.702517 2.702517 - q57_5 | 2 .5809151 3.44 0.001 .8614274 3.138573 - q60 | 2 .7433288 2.69 0.007 .5431023 3.456898 - q62_5 | 2 .6183135 3.23 0.001 .7881279 3.211872 - q65 | 2 .6186182 3.23 0.001 .7875307 3.212469 - q67_5 | 3 .892726 3.36 0.001 1.250289 4.749711 - q70 | 2 .7595125 2.63 0.008 .5113828 3.488617 - q72_5 | 2 .8505245 2.35 0.019 .3330026 3.666997 - q75 | 2 .8118315 2.46 0.014 .4088395 3.59116 - q77_5 | 2 1.083638 1.85 0.065 -.1238915 4.123891 - q80 | 3 1.219605 2.46 0.014 .6096175 5.390383 - q82_5 | 1 1.410513 0.71 0.478 -1.764555 3.764555 - q85 | 2 1.546076 1.29 0.196 -1.030254 5.030254 - q87_5 | 3 2.047648 1.47 0.143 -1.013317 7.013317 - q90 | 5 2.32366 2.15 0.031 .4457096 9.55429 -------------------------------------------------------------------------------- -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] - -. ereturn list - -scalars: - e(level) = 95 - e(N_reps) = 200 - e(N) = 5626 - e(N_misreps) = 0 - e(k_exp) = 0 - e(k_eexp) = 148 - e(N_strata) = 4 - e(version) = 3 - e(rank) = 94 - e(k_extra) = 0 - e(k_aux) = 0 - e(k_eq) = 4 - -macros: - e(title) : "Changes in Changes (CIC) Model" - e(cmd) : "cic" - e(cmdline) : "cic all y high after , at(1 5(2.5)90) vce(bootstrap, reps(200))" - e(estimator) : "all" - e(vce) : "bootstrap" - e(depvar) : "y" - e(footnote) : "Effect of Treatment on the Treated Group" - e(eqnames) : "continuous discrete_ci dci_lower_bnd dci_upper_bnd" - e(prefix) : "bootstrap" - e(exp1) : "[continuous]_b[mean]" - e(exp2) : "[continuous]_b[q1]" - e(exp3) : "[continuous]_b[q5]" - e(exp4) : "[continuous]_b[q7_5]" - e(exp5) : "[continuous]_b[q10]" - e(exp6) : "[continuous]_b[q12_5]" - e(exp7) : "[continuous]_b[q15]" - e(exp8) : "[continuous]_b[q17_5]" - e(exp9) : "[continuous]_b[q20]" - e(exp10) : "[continuous]_b[q22_5]" - e(exp11) : "[continuous]_b[q25]" - e(exp12) : "[continuous]_b[q27_5]" - e(exp13) : "[continuous]_b[q30]" - e(exp14) : "[continuous]_b[q32_5]" - e(exp15) : "[continuous]_b[q35]" - e(exp16) : "[continuous]_b[q37_5]" - e(exp17) : "[continuous]_b[q40]" - e(exp18) : "[continuous]_b[q42_5]" - e(exp19) : "[continuous]_b[q45]" - e(exp20) : "[continuous]_b[q47_5]" - e(exp21) : "[continuous]_b[q50]" - e(exp22) : "[continuous]_b[q52_5]" - e(exp23) : "[continuous]_b[q55]" - e(exp24) : "[continuous]_b[q57_5]" - e(exp25) : "[continuous]_b[q60]" - e(exp26) : "[continuous]_b[q62_5]" - e(exp27) : "[continuous]_b[q65]" - e(exp28) : "[continuous]_b[q67_5]" - e(exp29) : "[continuous]_b[q70]" - e(exp30) : "[continuous]_b[q72_5]" - e(exp31) : "[continuous]_b[q75]" - e(exp32) : "[continuous]_b[q77_5]" - e(exp33) : "[continuous]_b[q80]" - e(exp34) : "[continuous]_b[q82_5]" - e(exp35) : "[continuous]_b[q85]" - e(exp36) : "[continuous]_b[q87_5]" - e(exp37) : "[continuous]_b[q90]" - e(exp38) : "[discrete_ci]_b[mean]" - e(exp39) : "[discrete_ci]_b[q1]" - e(exp40) : "[discrete_ci]_b[q5]" - e(exp41) : "[discrete_ci]_b[q7_5]" - e(exp42) : "[discrete_ci]_b[q10]" - e(exp43) : "[discrete_ci]_b[q12_5]" - e(exp44) : "[discrete_ci]_b[q15]" - e(exp45) : "[discrete_ci]_b[q17_5]" - e(exp46) : "[discrete_ci]_b[q20]" - e(exp47) : "[discrete_ci]_b[q22_5]" - e(exp48) : "[discrete_ci]_b[q25]" - e(exp49) : "[discrete_ci]_b[q27_5]" - e(exp50) : "[discrete_ci]_b[q30]" - e(exp51) : "[discrete_ci]_b[q32_5]" - e(exp52) : "[discrete_ci]_b[q35]" - e(exp53) : "[discrete_ci]_b[q37_5]" - e(exp54) : "[discrete_ci]_b[q40]" - e(exp55) : "[discrete_ci]_b[q42_5]" - e(exp56) : "[discrete_ci]_b[q45]" - e(exp57) : "[discrete_ci]_b[q47_5]" - e(exp58) : "[discrete_ci]_b[q50]" - e(exp59) : "[discrete_ci]_b[q52_5]" - e(exp60) : "[discrete_ci]_b[q55]" - e(exp61) : "[discrete_ci]_b[q57_5]" - e(exp62) : "[discrete_ci]_b[q60]" - e(exp63) : "[discrete_ci]_b[q62_5]" - e(exp64) : "[discrete_ci]_b[q65]" - e(exp65) : "[discrete_ci]_b[q67_5]" - e(exp66) : "[discrete_ci]_b[q70]" - e(exp67) : "[discrete_ci]_b[q72_5]" - e(exp68) : "[discrete_ci]_b[q75]" - e(exp69) : "[discrete_ci]_b[q77_5]" - e(exp70) : "[discrete_ci]_b[q80]" - e(exp71) : "[discrete_ci]_b[q82_5]" - e(exp72) : "[discrete_ci]_b[q85]" - e(exp73) : "[discrete_ci]_b[q87_5]" - e(exp74) : "[discrete_ci]_b[q90]" - e(exp75) : "[dci_lower_bnd]_b[mean]" - e(exp76) : "[dci_lower_bnd]_b[q1]" - e(exp77) : "[dci_lower_bnd]_b[q5]" - e(exp78) : "[dci_lower_bnd]_b[q7_5]" - e(exp79) : "[dci_lower_bnd]_b[q10]" - e(exp80) : "[dci_lower_bnd]_b[q12_5]" - e(exp81) : "[dci_lower_bnd]_b[q15]" - e(exp82) : "[dci_lower_bnd]_b[q17_5]" - e(exp83) : "[dci_lower_bnd]_b[q20]" - e(exp84) : "[dci_lower_bnd]_b[q22_5]" - e(exp85) : "[dci_lower_bnd]_b[q25]" - e(exp86) : "[dci_lower_bnd]_b[q27_5]" - e(exp87) : "[dci_lower_bnd]_b[q30]" - e(exp88) : "[dci_lower_bnd]_b[q32_5]" - e(exp89) : "[dci_lower_bnd]_b[q35]" - e(exp90) : "[dci_lower_bnd]_b[q37_5]" - e(exp91) : "[dci_lower_bnd]_b[q40]" - e(exp92) : "[dci_lower_bnd]_b[q42_5]" - e(exp93) : "[dci_lower_bnd]_b[q45]" - e(exp94) : "[dci_lower_bnd]_b[q47_5]" - e(exp95) : "[dci_lower_bnd]_b[q50]" - e(exp96) : "[dci_lower_bnd]_b[q52_5]" - e(exp97) : "[dci_lower_bnd]_b[q55]" - e(exp98) : "[dci_lower_bnd]_b[q57_5]" - e(exp99) : "[dci_lower_bnd]_b[q60]" - e(exp100) : "[dci_lower_bnd]_b[q62_5]" - e(exp101) : "[dci_lower_bnd]_b[q65]" - e(exp102) : "[dci_lower_bnd]_b[q67_5]" - e(exp103) : "[dci_lower_bnd]_b[q70]" - e(exp104) : "[dci_lower_bnd]_b[q72_5]" - e(exp105) : "[dci_lower_bnd]_b[q75]" - e(exp106) : "[dci_lower_bnd]_b[q77_5]" - e(exp107) : "[dci_lower_bnd]_b[q80]" - e(exp108) : "[dci_lower_bnd]_b[q82_5]" - e(exp109) : "[dci_lower_bnd]_b[q85]" - e(exp110) : "[dci_lower_bnd]_b[q87_5]" - e(exp111) : "[dci_lower_bnd]_b[q90]" - e(exp112) : "[dci_upper_bnd]_b[mean]" - e(exp113) : "[dci_upper_bnd]_b[q1]" - e(exp114) : "[dci_upper_bnd]_b[q5]" - e(exp115) : "[dci_upper_bnd]_b[q7_5]" - e(exp116) : "[dci_upper_bnd]_b[q10]" - e(exp117) : "[dci_upper_bnd]_b[q12_5]" - e(exp118) : "[dci_upper_bnd]_b[q15]" - e(exp119) : "[dci_upper_bnd]_b[q17_5]" - e(exp120) : "[dci_upper_bnd]_b[q20]" - e(exp121) : "[dci_upper_bnd]_b[q22_5]" - e(exp122) : "[dci_upper_bnd]_b[q25]" - e(exp123) : "[dci_upper_bnd]_b[q27_5]" - e(exp124) : "[dci_upper_bnd]_b[q30]" - e(exp125) : "[dci_upper_bnd]_b[q32_5]" - e(exp126) : "[dci_upper_bnd]_b[q35]" - e(exp127) : "[dci_upper_bnd]_b[q37_5]" - e(exp128) : "[dci_upper_bnd]_b[q40]" - e(exp129) : "[dci_upper_bnd]_b[q42_5]" - e(exp130) : "[dci_upper_bnd]_b[q45]" - e(exp131) : "[dci_upper_bnd]_b[q47_5]" - e(exp132) : "[dci_upper_bnd]_b[q50]" - e(exp133) : "[dci_upper_bnd]_b[q52_5]" - e(exp134) : "[dci_upper_bnd]_b[q55]" - e(exp135) : "[dci_upper_bnd]_b[q57_5]" - e(exp136) : "[dci_upper_bnd]_b[q60]" - e(exp137) : "[dci_upper_bnd]_b[q62_5]" - e(exp138) : "[dci_upper_bnd]_b[q65]" - e(exp139) : "[dci_upper_bnd]_b[q67_5]" - e(exp140) : "[dci_upper_bnd]_b[q70]" - e(exp141) : "[dci_upper_bnd]_b[q72_5]" - e(exp142) : "[dci_upper_bnd]_b[q75]" - e(exp143) : "[dci_upper_bnd]_b[q77_5]" - e(exp144) : "[dci_upper_bnd]_b[q80]" - e(exp145) : "[dci_upper_bnd]_b[q82_5]" - e(exp146) : "[dci_upper_bnd]_b[q85]" - e(exp147) : "[dci_upper_bnd]_b[q87_5]" - e(exp148) : "[dci_upper_bnd]_b[q90]" - e(command) : "cic" - e(strata) : "high y" - e(vcetype) : "Bootstrap" - e(properties) : "b V" - -matrices: - e(b) : 1 x 148 - e(V) : 148 x 148 - e(b_bs) : 1 x 148 - e(reps) : 1 x 148 - e(bias) : 1 x 148 - e(z0) : 1 x 148 - e(se) : 1 x 148 - e(ci_normal) : 2 x 148 - e(ci_percentile) : 2 x 148 - e(ci_bc) : 2 x 148 - -. cicgraph, name(g) e(continuous discrete_ci dci_lower_bnd dci_upper_bnd) - -. -. -. // VCE via delta metho -. cic all y high after, vce(delta) at(25 50 75 90) - -Changes in Changes (CIC) Model - Number of obs = 5,626 -------------------------------------------------------------------------------- - y | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.487323 0.72 0.469 -1.83962 3.991836 - q25 | 1 . . . . . - q50 | 2 . . . . . - q75 | 2 . . . . . - q90 | 5 . . . . . ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.32094 0.30 0.767 -2.197519 2.981588 - q25 | 0 (omitted) - q50 | 1 . . . . . - q75 | 2 . . . . . - q90 | 5 . . . . . ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.233195 0.06 0.955 -2.347717 2.487361 - q25 | 0 (omitted) - q50 | 1 . . . . . - q75 | 1 . . . . . - q90 | 4 . . . . . ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.235408 0.87 0.384 -1.34577 3.497986 - q25 | 1 . . . . . - q50 | 2 . . . . . - q75 | 2 . . . . . - q90 | 5 . . . . . -------------------------------------------------------------------------------- -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 all y high after, vce(delta) did at(25 50 75 90) - -Changes in Changes (CIC) Model - Number of obs = 5,626 -------------------------------------------------------------------------------- - y | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -did_model | - high#after | - 0 0 | 6.271554 . . . . . - 0 1 | 7.037328 . . . . . - 1 0 | 11.1766 . . . . . - 1 1 | 12.89363 . . . . . ---------------+---------------------------------------------------------------- -did | - did | .9512506 . . . . . ---------------+---------------------------------------------------------------- -qdid | - q25 | -.7657738 . . . . . - q50 | .2342262 . . . . . - q75 | 1.234226 . . . . . - q90 | 5.234226 . . . . . ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.487323 0.72 0.469 -1.839621 3.991837 - q25 | 1 . . . . . - q50 | 2 . . . . . - q75 | 2 . . . . . - q90 | 5 . . . . . ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.32094 0.30 0.767 -2.19752 2.981589 - q25 | 0 (omitted) - q50 | 1 . . . . . - q75 | 2 . . . . . - q90 | 5 . . . . . ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.233195 0.06 0.955 -2.347717 2.487362 - q25 | 0 (omitted) - q50 | 1 . . . . . - q75 | 1 . . . . . - q90 | 4 . . . . . ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.235408 0.87 0.384 -1.345771 3.497987 - q25 | 1 . . . . . - q50 | 2 . . . . . - q75 | 2 . . . . . - q90 | 5 . . . . . -------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Traditional DID model [did], [did_model] ( == 1 - high) -Quantile DID model [qdid] -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] - -. -. -. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -. * Test misc features with this dataset -. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -. -. * Basic -. cic all y high after, at(5(10)95) `vce' did - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -did_model | - high#after | - 0 0 | 6.271554 .2856759 21.95 0.000 5.71164 6.831469 - 0 1 | 7.037328 .4265236 16.50 0.000 6.201357 7.873299 - 1 0 | 11.1766 .8044051 13.89 0.000 9.599997 12.75321 - 1 1 | 12.89363 .7534556 17.11 0.000 11.41688 14.37037 ---------------+---------------------------------------------------------------- -did | - did | .9512506 1.217028 0.78 0.434 -1.43408 3.336581 ---------------+---------------------------------------------------------------- -qdid | - q5 | -.0157738 .5906869 -0.03 0.979 -1.173499 1.141951 - q15 | -.7657738 .4998544 -1.53 0.126 -1.74547 .2139228 - q25 | -.7657738 .5982188 -1.28 0.201 -1.938261 .4067135 - q35 | -.7657738 .4998544 -1.53 0.126 -1.74547 .2139228 - q45 | -.7657738 .6953891 -1.10 0.271 -2.128711 .5971638 - q55 | -.7657738 .8123813 -0.94 0.346 -2.358012 .8264642 - q65 | .2342262 .6084533 0.38 0.700 -.9583205 1.426773 - q75 | 1.234226 .6915036 1.78 0.074 -.121096 2.589548 - q85 | 2.234226 1.267879 1.76 0.078 -.2507706 4.719223 - q95 | 24.23423 11.75944 2.06 0.039 1.186156 47.2823 ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.514857 0.71 0.477 -1.892957 4.045173 - q5 | .75 .1785621 4.20 0.000 .4000247 1.099975 - q15 | .75 .3357261 2.23 0.025 .091989 1.408011 - q25 | 1 .574914 1.74 0.082 -.1268107 2.126811 - q35 | 1 .5006277 2.00 0.046 .0187876 1.981212 - q45 | 1 .6322767 1.58 0.114 -.2392396 2.23924 - q55 | 1 .7878474 1.27 0.204 -.5441525 2.544153 - q65 | 2 .5609575 3.57 0.000 .9005434 3.099457 - q75 | 2 .7823268 2.56 0.011 .4666677 3.533332 - q85 | 2 1.518057 1.32 0.188 -.9753373 4.975337 - q95 | 13 23.79865 0.55 0.585 -33.6445 59.6445 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.476577 0.27 0.791 -2.502004 3.286073 - q5 | .75 .279084 2.69 0.007 .2030054 1.296995 - q15 | 0 (omitted) - q25 | 0 .4058616 0.00 1.000 -.7954741 .7954741 - q35 | 0 .1565167 0.00 1.000 -.3067672 .3067672 - q45 | 1 .4763502 2.10 0.036 .0663707 1.933629 - q55 | 0 .6215356 0.00 1.000 -1.218187 1.218187 - q65 | 1 .5439249 1.84 0.066 -.0660732 2.066073 - q75 | 2 .7116405 2.81 0.005 .6052103 3.39479 - q85 | 2 1.525125 1.31 0.190 -.9891893 4.989189 - q95 | 13 24.57168 0.53 0.597 -35.1596 61.1596 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.509494 0.05 0.963 -2.888731 3.028376 - q5 | .75 .5426979 1.38 0.167 -.3136684 1.813668 - q15 | 0 .4955835 0.00 1.000 -.9713258 .9713258 - q25 | 0 .5957133 0.00 1.000 -1.167577 1.167577 - q35 | 0 .4525472 0.00 1.000 -.8869763 .8869763 - q45 | 0 .7344878 0.00 1.000 -1.43957 1.43957 - q55 | 0 .696708 0.00 1.000 -1.365523 1.365523 - q65 | 0 .5860823 0.00 1.000 -1.1487 1.1487 - q75 | 1 .8948625 1.12 0.264 -.7538983 2.753898 - q85 | 1 1.548415 0.65 0.518 -2.034837 4.034837 - q95 | 11 25.73648 0.43 0.669 -39.44257 61.44257 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.514857 0.71 0.477 -1.892957 4.045173 - q5 | .75 .1785621 4.20 0.000 .4000247 1.099975 - q15 | .75 .3357261 2.23 0.025 .091989 1.408011 - q25 | 1 .574914 1.74 0.082 -.1268107 2.126811 - q35 | 1 .5006277 2.00 0.046 .0187876 1.981212 - q45 | 1 .6322767 1.58 0.114 -.2392396 2.23924 - q55 | 1 .7878474 1.27 0.204 -.5441525 2.544153 - q65 | 2 .5609575 3.57 0.000 .9005434 3.099457 - q75 | 2 .7823268 2.56 0.011 .4666677 3.533332 - q85 | 2 1.518057 1.32 0.188 -.9753373 4.975337 - q95 | 13 23.79865 0.55 0.585 -33.6445 59.6445 -------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Traditional DID model [did], [did_model] ( == 1 - high) -Quantile DID model [qdid] -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] - -. -. * With control variables -. egen agegroup = cut(age), group(7) - -. cic all y high after i.agegroup, did `vce' round(.25) - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -did_model | - high#after | - 0 0 | 4.681698 .5403722 8.66 0.000 3.622588 5.740808 - 0 1 | 5.403618 .5929619 9.11 0.000 4.241434 6.565802 - 1 0 | 9.043842 .9513629 9.51 0.000 7.179205 10.90848 - 1 1 | 10.69512 1.205118 8.87 0.000 8.333128 13.0571 - | - agegroup | - 0 | 0 (empty) - 1 | .3960705 .6898915 0.57 0.566 -.956092 1.748233 - 2 | 1.633449 .9585042 1.70 0.088 -.2451845 3.512083 - 3 | 1.879766 .9112704 2.06 0.039 .093709 3.665823 - 4 | 3.327682 .9967462 3.34 0.001 1.374096 5.281269 - 5 | 2.59125 1.075635 2.41 0.016 .4830447 4.699455 - 6 | 2.821838 .9746625 2.90 0.004 .9115349 4.732142 ---------------+---------------------------------------------------------------- -did | - did | .9293529 1.263318 0.74 0.462 -1.546706 3.405411 ---------------+---------------------------------------------------------------- -qdid | - q10 | -.4694777 .5885523 -0.80 0.425 -1.623019 .6840637 - q20 | -.4694777 .5789734 -0.81 0.417 -1.604245 .6652893 - q30 | -.4694777 .5715176 -0.82 0.411 -1.589632 .6506763 - q40 | -.4694777 .6186279 -0.76 0.448 -1.681966 .7430108 - q50 | -.2194777 .646033 -0.34 0.734 -1.485679 1.046724 - q60 | .0305223 .6531124 0.05 0.963 -1.249554 1.310599 - q70 | .7805223 .7412786 1.05 0.292 -.6723571 2.233402 - q80 | 1.030522 .9823262 1.05 0.294 -.8948016 2.955846 - q90 | 5.280522 2.406556 2.19 0.028 .5637601 9.997285 ---------------+---------------------------------------------------------------- -continuous | - mean | .5823871 1.557934 0.37 0.709 -2.471108 3.635882 - q10 | .5 .3782709 1.32 0.186 -.2413974 1.241397 - q20 | .5 .3512697 1.42 0.155 -.1884759 1.188476 - q30 | .75 .3574758 2.10 0.036 .0493603 1.45064 - q40 | .5 .3776082 1.32 0.185 -.2400984 1.240098 - q50 | .75 .4367249 1.72 0.086 -.1059651 1.605965 - q60 | 1 .4490358 2.23 0.026 .119906 1.880094 - q70 | 1.75 .7066347 2.48 0.013 .3650214 3.134979 - q80 | 1.75 1.072403 1.63 0.103 -.3518717 3.851872 - q90 | 4 3.057201 1.31 0.191 -1.992003 9.992003 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3889628 1.557282 0.25 0.803 -2.663254 3.441179 - q10 | .5 .336511 1.49 0.137 -.1595494 1.159549 - q20 | .25 .3248405 0.77 0.442 -.3866757 .8866757 - q30 | .25 .3260468 0.77 0.443 -.38904 .88904 - q40 | .25 .3431284 0.73 0.466 -.4225194 .9225194 - q50 | .5 .37714 1.33 0.185 -.2391809 1.239181 - q60 | 1 .4567181 2.19 0.029 .104849 1.895151 - q70 | 1.75 .6333686 2.76 0.006 .5086204 2.99138 - q80 | 1.75 1.081461 1.62 0.106 -.3696254 3.869625 - q90 | 4 3.075751 1.30 0.193 -2.028361 10.02836 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .2766288 1.55863 0.18 0.859 -2.778229 3.331487 - q10 | .25 .3434144 0.73 0.467 -.4230798 .9230798 - q20 | .25 .3513792 0.71 0.477 -.4386906 .9386906 - q30 | .25 .3531779 0.71 0.479 -.4422159 .9422159 - q40 | .25 .3685991 0.68 0.498 -.4724409 .9724409 - q50 | .25 .4161848 0.60 0.548 -.5657072 1.065707 - q60 | .75 .4768511 1.57 0.116 -.1846109 1.684611 - q70 | 1.75 .6768052 2.59 0.010 .4234861 3.076514 - q80 | 1 1.131576 0.88 0.377 -1.217847 3.217847 - q90 | 4 3.112436 1.29 0.199 -2.100262 10.10026 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | .5823871 1.557934 0.37 0.709 -2.471108 3.635882 - q10 | .5 .3782709 1.32 0.186 -.2413974 1.241397 - q20 | .5 .3512697 1.42 0.155 -.1884759 1.188476 - q30 | .75 .3574758 2.10 0.036 .0493603 1.45064 - q40 | .5 .3776082 1.32 0.185 -.2400984 1.240098 - q50 | .75 .4367249 1.72 0.086 -.1059651 1.605965 - q60 | 1 .4490358 2.23 0.026 .119906 1.880094 - q70 | 1.75 .7066347 2.48 0.013 .3650214 3.134979 - q80 | 1.75 1.072403 1.63 0.103 -.3518717 3.851872 - q90 | 4 3.057201 1.31 0.191 -1.992003 9.992003 -------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Traditional DID model [did], [did_model] ( == 1 - high) -Quantile DID model [qdid] -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] - -. -. * Test recall -. cic - -Changes in Changes (CIC) Model - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - y | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -did_model | - high#after | - 0 0 | 4.681698 .5403722 8.66 0.000 3.622588 5.740808 - 0 1 | 5.403618 .5929619 9.11 0.000 4.241434 6.565802 - 1 0 | 9.043842 .9513629 9.51 0.000 7.179205 10.90848 - 1 1 | 10.69512 1.205118 8.87 0.000 8.333128 13.0571 - | - agegroup | - 0 | 0 (empty) - 1 | .3960705 .6898915 0.57 0.566 -.956092 1.748233 - 2 | 1.633449 .9585042 1.70 0.088 -.2451845 3.512083 - 3 | 1.879766 .9112704 2.06 0.039 .093709 3.665823 - 4 | 3.327682 .9967462 3.34 0.001 1.374096 5.281269 - 5 | 2.59125 1.075635 2.41 0.016 .4830447 4.699455 - 6 | 2.821838 .9746625 2.90 0.004 .9115349 4.732142 ---------------+---------------------------------------------------------------- -did | - did | .9293529 1.263318 0.74 0.462 -1.546706 3.405411 ---------------+---------------------------------------------------------------- -qdid | - q10 | -.4694777 .5885523 -0.80 0.425 -1.623019 .6840637 - q20 | -.4694777 .5789734 -0.81 0.417 -1.604245 .6652893 - q30 | -.4694777 .5715176 -0.82 0.411 -1.589632 .6506763 - q40 | -.4694777 .6186279 -0.76 0.448 -1.681966 .7430108 - q50 | -.2194777 .646033 -0.34 0.734 -1.485679 1.046724 - q60 | .0305223 .6531124 0.05 0.963 -1.249554 1.310599 - q70 | .7805223 .7412786 1.05 0.292 -.6723571 2.233402 - q80 | 1.030522 .9823262 1.05 0.294 -.8948016 2.955846 - q90 | 5.280522 2.406556 2.19 0.028 .5637601 9.997285 ---------------+---------------------------------------------------------------- -continuous | - mean | .5823871 1.557934 0.37 0.709 -2.471108 3.635882 - q10 | .5 .3782709 1.32 0.186 -.2413974 1.241397 - q20 | .5 .3512697 1.42 0.155 -.1884759 1.188476 - q30 | .75 .3574758 2.10 0.036 .0493603 1.45064 - q40 | .5 .3776082 1.32 0.185 -.2400984 1.240098 - q50 | .75 .4367249 1.72 0.086 -.1059651 1.605965 - q60 | 1 .4490358 2.23 0.026 .119906 1.880094 - q70 | 1.75 .7066347 2.48 0.013 .3650214 3.134979 - q80 | 1.75 1.072403 1.63 0.103 -.3518717 3.851872 - q90 | 4 3.057201 1.31 0.191 -1.992003 9.992003 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3889628 1.557282 0.25 0.803 -2.663254 3.441179 - q10 | .5 .336511 1.49 0.137 -.1595494 1.159549 - q20 | .25 .3248405 0.77 0.442 -.3866757 .8866757 - q30 | .25 .3260468 0.77 0.443 -.38904 .88904 - q40 | .25 .3431284 0.73 0.466 -.4225194 .9225194 - q50 | .5 .37714 1.33 0.185 -.2391809 1.239181 - q60 | 1 .4567181 2.19 0.029 .104849 1.895151 - q70 | 1.75 .6333686 2.76 0.006 .5086204 2.99138 - q80 | 1.75 1.081461 1.62 0.106 -.3696254 3.869625 - q90 | 4 3.075751 1.30 0.193 -2.028361 10.02836 -------------------------------------------------------------------------------- -(Effect of Treatment on the Treated Group) - -. cicgraph , name(r0) - -. -. * With weights -. gen tempweight = 1 - -. replace tempweight = 2 in 1 -(1 real change made) - -. cic all ly high after [fw=tempweight], did `vce' - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -did_model | - high#after | - 0 0 | 1.125615 .0314539 35.79 0.000 1.063967 1.187264 - 0 1 | 1.133273 .0330853 34.25 0.000 1.068427 1.198119 - 1 0 | 1.382094 .0395666 34.93 0.000 1.304545 1.459643 - 1 1 | 1.578992 .0409471 38.56 0.000 1.498737 1.659247 ---------------+---------------------------------------------------------------- -did | - did | .1892412 .06996 2.70 0.007 .0521221 .3263603 ---------------+---------------------------------------------------------------- -qdid | - q10 | -.0076573 .0479168 -0.16 0.873 -.1015724 .0862578 - q20 | .6854899 .3564816 1.92 0.054 -.0132013 1.384181 - q30 | .3978078 .2132269 1.87 0.062 -.0201092 .8157248 - q40 | .2800247 .1478888 1.89 0.058 -.009832 .5698815 - q50 | .2154863 .1043358 2.07 0.039 .0109918 .4199808 - q60 | .1746642 .1083831 1.61 0.107 -.0377628 .3870913 - q70 | .2436572 .08584 2.84 0.005 .0754139 .4119005 - q80 | .2800247 .0847045 3.31 0.001 .1140069 .4460426 - q90 | .2946236 .116534 2.53 0.011 .0662211 .5230261 ---------------+---------------------------------------------------------------- -continuous | - mean | .582249 .1670145 3.49 0.000 .2549065 .9095914 - q10 | 1.386294 .6368741 2.18 0.030 .1380441 2.634545 - q20 | 2.079442 .7210683 2.88 0.004 .6661736 3.492709 - q30 | 1.098612 .4096304 2.68 0.007 .2957516 1.901473 - q40 | .6931472 .2426331 2.86 0.004 .2175951 1.168699 - q50 | .5108256 .1533476 3.33 0.001 .2102698 .8113814 - q60 | .4054651 .1406339 2.88 0.004 .1298278 .6811025 - q70 | .2513145 .1132442 2.22 0.026 .02936 .473269 - q80 | .2876821 .1190856 2.42 0.016 .0542786 .5210855 - q90 | .2451224 .1349338 1.82 0.069 -.019343 .5095879 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .181266 .0712199 2.55 0.011 .0416776 .3208544 - q10 | 0 (omitted) - q20 | .6931472 .3725914 1.86 0.063 -.0371186 1.423413 - q30 | .4054651 .1954078 2.07 0.038 .0224728 .7884574 - q40 | .2876821 .140336 2.05 0.040 .0126285 .5627356 - q50 | .2231436 .1078155 2.07 0.038 .011829 .4344581 - q60 | .1823215 .0967969 1.88 0.060 -.0073969 .37204 - q70 | .2513145 .0995018 2.53 0.012 .0562945 .4463346 - q80 | .1823215 .1035888 1.76 0.078 -.0207088 .3853519 - q90 | .2451224 .1297697 1.89 0.059 -.0092215 .4994664 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .1351266 .1279625 1.06 0.291 -.1156752 .3859284 - q10 | 0 .3335456 0.00 1.000 -.6537373 .6537373 - q20 | .6931472 .4752019 1.46 0.145 -.2382315 1.624526 - q30 | .4054651 .2391229 1.70 0.090 -.0632072 .8741375 - q40 | .2876821 .1856513 1.55 0.121 -.0761878 .6515519 - q50 | .2231436 .142656 1.56 0.118 -.056457 .5027442 - q60 | .1823215 .1403181 1.30 0.194 -.0926968 .4573399 - q70 | .1177831 .1040061 1.13 0.257 -.0860652 .3216314 - q80 | .1823215 .1095487 1.66 0.096 -.03239 .3970331 - q90 | .1910553 .1308325 1.46 0.144 -.0653717 .4474823 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | .582249 .1670145 3.49 0.000 .2549065 .9095914 - q10 | 1.386294 .6368741 2.18 0.030 .1380441 2.634545 - q20 | 2.079442 .7210683 2.88 0.004 .6661736 3.492709 - q30 | 1.098612 .4096304 2.68 0.007 .2957516 1.901473 - q40 | .6931472 .2426331 2.86 0.004 .2175951 1.168699 - q50 | .5108256 .1533476 3.33 0.001 .2102698 .8113814 - q60 | .4054651 .1406339 2.88 0.004 .1298278 .6811025 - q70 | .2513145 .1132442 2.22 0.026 .02936 .473269 - q80 | .2876821 .1190856 2.42 0.016 .0542786 .5210855 - q90 | .2451224 .1349338 1.82 0.069 -.019343 .5095879 -------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Traditional DID model [did], [did_model] ( == 1 - high) -Quantile DID model [qdid] -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] - -. -. * With control variables and weights -. timer on 24 - -. cic all ly high after i.agegroup [fw=tempweight], did `vce' round(.25) - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 55 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -did_model | - high#after | - 0 0 | .9568555 .0550669 17.38 0.000 .8489264 1.064785 - 0 1 | .96071 .0616447 15.58 0.000 .8398886 1.081532 - 1 0 | 1.156585 .0692616 16.70 0.000 1.020834 1.292335 - 1 1 | 1.346214 .073062 18.43 0.000 1.203015 1.489413 - | - agegroup | - 0 | 0 (empty) - 1 | .0423491 .0673442 0.63 0.529 -.0896431 .1743413 - 2 | .1329622 .0748917 1.78 0.076 -.0138229 .2797473 - 3 | .2252535 .070097 3.21 0.001 .0878658 .3626411 - 4 | .3228527 .075459 4.28 0.000 .1749558 .4707497 - 5 | .285083 .0718821 3.97 0.000 .1441967 .4259693 - 6 | .3277557 .0687675 4.77 0.000 .1929738 .4625376 ---------------+---------------------------------------------------------------- -did | - did | .1857749 .0691832 2.69 0.007 .0501782 .3213716 ---------------+---------------------------------------------------------------- -qdid | - q10 | -.0034604 .1033778 -0.03 0.973 -.2060771 .1991563 - q20 | .2465396 .233256 1.06 0.291 -.2106338 .703713 - q30 | -.0034604 .1358909 -0.03 0.980 -.2698017 .2628809 - q40 | .2465396 .1335976 1.85 0.065 -.0153069 .5083861 - q50 | -.0034604 .1355625 -0.03 0.980 -.269158 .2622372 - q60 | -.0034604 .1306227 -0.03 0.979 -.2594761 .2525554 - q70 | .2465396 .1258635 1.96 0.050 -.0001482 .4932275 - q80 | .2465396 .131599 1.87 0.061 -.0113896 .5044688 - q90 | .4965396 .1569224 3.16 0.002 .1889774 .8041018 ---------------+---------------------------------------------------------------- -continuous | - mean | .4866499 .1180915 4.12 0.000 .2551948 .7181051 - q10 | 1.25 .540885 2.31 0.021 .189885 2.310115 - q20 | .5 .423664 1.18 0.238 -.3303662 1.330366 - q30 | .25 .2005019 1.25 0.212 -.1429765 .6429765 - q40 | .5 .205438 2.43 0.015 .0973489 .9026511 - q50 | .25 .1683313 1.49 0.137 -.0799233 .5799233 - q60 | .25 .1499529 1.67 0.095 -.0439022 .5439022 - q70 | .5 .1687971 2.96 0.003 .1691638 .8308362 - q80 | .25 .1759709 1.42 0.155 -.0948967 .5948967 - q90 | .5 .1729102 2.89 0.004 .1611023 .8388977 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .1779279 .0709685 2.51 0.012 .0388323 .3170235 - q10 | 0 .2070939 0.00 1.000 -.4058966 .4058966 - q20 | .5 .230383 2.17 0.030 .0484576 .9515424 - q30 | 0 .1512874 0.00 1.000 -.2965179 .2965179 - q40 | .25 .1277708 1.96 0.050 -.0004262 .5004262 - q50 | .25 .1328798 1.88 0.060 -.0104396 .5104396 - q60 | 0 .131167 0.00 1.000 -.2570825 .2570825 - q70 | .25 .130079 1.92 0.055 -.0049501 .5049501 - q80 | .25 .1323766 1.89 0.059 -.0094533 .5094533 - q90 | .25 .1599113 1.56 0.118 -.0634203 .5634203 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0707943 .0903935 0.78 0.434 -.1063736 .2479622 - q10 | 0 .1477426 0.00 1.000 -.2895703 .2895703 - q20 | .25 .3146122 0.79 0.427 -.3666286 .8666286 - q30 | -.25 .2026481 -1.23 0.217 -.6471831 .1471831 - q40 | 0 .1637299 0.00 1.000 -.3209047 .3209047 - q50 | 0 .15437 0.00 1.000 -.3025596 .3025596 - q60 | 0 .1677332 0.00 1.000 -.328751 .328751 - q70 | 0 .1820761 0.00 1.000 -.3568625 .3568625 - q80 | 0 .15437 0.00 1.000 -.3025596 .3025596 - q90 | .25 .1782628 1.40 0.161 -.0993887 .5993887 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | .4866499 .1180915 4.12 0.000 .2551948 .7181051 - q10 | 1.25 .540885 2.31 0.021 .189885 2.310115 - q20 | .5 .423664 1.18 0.238 -.3303662 1.330366 - q30 | .25 .2005019 1.25 0.212 -.1429765 .6429765 - q40 | .5 .205438 2.43 0.015 .0973489 .9026511 - q50 | .25 .1683313 1.49 0.137 -.0799233 .5799233 - q60 | .25 .1499529 1.67 0.095 -.0439022 .5439022 - q70 | .5 .1687971 2.96 0.003 .1691638 .8308362 - q80 | .25 .1759709 1.42 0.155 -.0948967 .5948967 - q90 | .5 .1729102 2.89 0.004 .1611023 .8388977 -------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Traditional DID model [did], [did_model] ( == 1 - high) -Quantile DID model [qdid] -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] - -. timer off 24 - -. timer list - 2: 11.62 / 1 = 11.6200 - 3: 12.47 / 1 = 12.4740 - 24: 7.32 / 1 = 7.3230 - -. -. // compare vce() option above to the bootstrap prefix -. set seed 1 - -. timer on 10 - -. cic all y high after, vce(bootstrap, reps(`Nreps')) - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.533038 0.70 0.483 -1.928592 4.080807 - q10 | .75 .3394104 2.21 0.027 .0847678 1.415232 - q20 | 1.75 .6084569 2.88 0.004 .5574463 2.942554 - q30 | 2 .6777883 2.95 0.003 .6715593 3.328441 - q40 | 2 .6627944 3.02 0.003 .7009467 3.299053 - q50 | 2 .5633487 3.55 0.000 .8958567 3.104143 - q60 | 2 .7128399 2.81 0.005 .6028595 3.397141 - q70 | 2 .7521995 2.66 0.008 .5257162 3.474284 - q80 | 3 1.216212 2.47 0.014 .6162689 5.383731 - q90 | 5 2.572443 1.94 0.052 -.0418954 10.0419 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.465503 0.27 0.789 -2.480298 3.264368 - q10 | 0 (omitted) - q20 | 1 .5304544 1.89 0.059 -.0396716 2.039672 - q30 | 1 .4968241 2.01 0.044 .0262427 1.973757 - q40 | 1 .4615628 2.17 0.030 .0953536 1.904646 - q50 | 1 .4245897 2.36 0.019 .1678196 1.83218 - q60 | 1 .5417031 1.85 0.065 -.0617185 2.061718 - q70 | 2 .748046 2.67 0.008 .5338567 3.466143 - q80 | 2 1.193576 1.68 0.094 -.3393655 4.339366 - q90 | 5 2.564617 1.95 0.051 -.0265573 10.02656 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.516733 0.05 0.963 -2.902919 3.042564 - q10 | 0 .4900774 0.00 1.000 -.9605341 .9605341 - q20 | 1 .6901861 1.45 0.147 -.3527398 2.35274 - q30 | 1 .6379734 1.57 0.117 -.2504049 2.250405 - q40 | 1 .642682 1.56 0.120 -.2596336 2.259634 - q50 | 1 .5994134 1.67 0.095 -.1748288 2.174829 - q60 | 1 .8380253 1.19 0.233 -.6424994 2.642499 - q70 | 1 .8080002 1.24 0.216 -.5836513 2.583651 - q80 | 2 1.422848 1.41 0.160 -.7887316 4.788732 - q90 | 4 2.664446 1.50 0.133 -1.222218 9.222218 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.533038 0.70 0.483 -1.928592 4.080807 - q10 | .75 .3394104 2.21 0.027 .0847678 1.415232 - q20 | 1.75 .6084569 2.88 0.004 .5574463 2.942554 - q30 | 2 .6777883 2.95 0.003 .6715593 3.328441 - q40 | 2 .6627944 3.02 0.003 .7009467 3.299053 - q50 | 2 .5633487 3.55 0.000 .8958567 3.104143 - q60 | 2 .7128399 2.81 0.005 .6028595 3.397141 - q70 | 2 .7521995 2.66 0.008 .5257162 3.474284 - q80 | 3 1.216212 2.47 0.014 .6162689 5.383731 - q90 | 5 2.572443 1.94 0.052 -.0418954 10.0419 -------------------------------------------------------------------------------- -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] - -. timer off 10 - -. timer list 10 - 10: 3.52 / 1 = 3.5200 - -. ereturn list - -scalars: - e(level) = 95 - e(N_reps) = 200 - e(N) = 5626 - e(N_misreps) = 0 - e(k_exp) = 0 - e(k_eexp) = 40 - e(N_strata) = 4 - e(version) = 3 - e(rank) = 29 - e(k_extra) = 0 - e(k_aux) = 0 - e(k_eq) = 4 - -macros: - e(title) : "Changes in Changes (CIC) Model" - e(cmd) : "cic" - e(cmdline) : "cic all y high after, vce(bootstrap, reps(200))" - e(estimator) : "all" - e(vce) : "bootstrap" - e(depvar) : "y" - e(footnote) : "Effect of Treatment on the Treated Group" - e(eqnames) : "continuous discrete_ci dci_lower_bnd dci_upper_bnd" - e(prefix) : "bootstrap" - e(exp1) : "[continuous]_b[mean]" - e(exp2) : "[continuous]_b[q10]" - e(exp3) : "[continuous]_b[q20]" - e(exp4) : "[continuous]_b[q30]" - e(exp5) : "[continuous]_b[q40]" - e(exp6) : "[continuous]_b[q50]" - e(exp7) : "[continuous]_b[q60]" - e(exp8) : "[continuous]_b[q70]" - e(exp9) : "[continuous]_b[q80]" - e(exp10) : "[continuous]_b[q90]" - e(exp11) : "[discrete_ci]_b[mean]" - e(exp12) : "[discrete_ci]_b[q10]" - e(exp13) : "[discrete_ci]_b[q20]" - e(exp14) : "[discrete_ci]_b[q30]" - e(exp15) : "[discrete_ci]_b[q40]" - e(exp16) : "[discrete_ci]_b[q50]" - e(exp17) : "[discrete_ci]_b[q60]" - e(exp18) : "[discrete_ci]_b[q70]" - e(exp19) : "[discrete_ci]_b[q80]" - e(exp20) : "[discrete_ci]_b[q90]" - e(exp21) : "[dci_lower_bnd]_b[mean]" - e(exp22) : "[dci_lower_bnd]_b[q10]" - e(exp23) : "[dci_lower_bnd]_b[q20]" - e(exp24) : "[dci_lower_bnd]_b[q30]" - e(exp25) : "[dci_lower_bnd]_b[q40]" - e(exp26) : "[dci_lower_bnd]_b[q50]" - e(exp27) : "[dci_lower_bnd]_b[q60]" - e(exp28) : "[dci_lower_bnd]_b[q70]" - e(exp29) : "[dci_lower_bnd]_b[q80]" - e(exp30) : "[dci_lower_bnd]_b[q90]" - e(exp31) : "[dci_upper_bnd]_b[mean]" - e(exp32) : "[dci_upper_bnd]_b[q10]" - e(exp33) : "[dci_upper_bnd]_b[q20]" - e(exp34) : "[dci_upper_bnd]_b[q30]" - e(exp35) : "[dci_upper_bnd]_b[q40]" - e(exp36) : "[dci_upper_bnd]_b[q50]" - e(exp37) : "[dci_upper_bnd]_b[q60]" - e(exp38) : "[dci_upper_bnd]_b[q70]" - e(exp39) : "[dci_upper_bnd]_b[q80]" - e(exp40) : "[dci_upper_bnd]_b[q90]" - e(command) : "cic" - e(strata) : "high y" - e(vcetype) : "Bootstrap" - e(properties) : "b V" - -matrices: - e(b) : 1 x 40 - e(V) : 40 x 40 - e(b_bs) : 1 x 40 - e(reps) : 1 x 40 - e(bias) : 1 x 40 - e(z0) : 1 x 40 - e(se) : 1 x 40 - e(ci_normal) : 2 x 40 - e(ci_percentile) : 2 x 40 - e(ci_bc) : 2 x 40 - -. estat bootstrap , all // estat bootstrap does work - -Changes in Changes (CIC) Model -Number of strata = 4 Number of obs = 5626 - Replications = 200 - ------------------------------------------------------------------------------- - | Observed Bootstrap - y | Coef. Bias Std. Err. [95% Conf. Interval] --------------+---------------------------------------------------------------- -continuous | - mean | 1.0761079 -.3158963 1.5330381 -1.928592 4.080807 (N) - | -2.680837 3.682333 (P) - | -1.73887 4.221036 (BC) - q10 | .75 -.21375 .33941042 .0847678 1.415232 (N) - | 0 .75 (P) - | . . (BC) - q20 | 1.75 -.6725 .60845694 .5574463 2.942554 (N) - | 0 1.75 (P) - | . . (BC) - q30 | 2 -.77 .6777883 .6715593 3.328441 (N) - | 0 2 (P) - | . . (BC) - q40 | 2 -.73 .66279445 .7009467 3.299053 (N) - | 0 2 (P) - | . . (BC) - q50 | 2 -.435 .56334875 .8958567 3.104143 (N) - | 0 2 (P) - | 3 3 (BC) - q60 | 2 -.62 .71283989 .6028595 3.397141 (N) - | 0 3 (P) - | 2 3 (BC) - q70 | 2 .045 .75219945 .5257162 3.474284 (N) - | 1 3 (P) - | 2 4 (BC) - q80 | 3 -.365 1.2162117 .6162689 5.383731 (N) - | 0 5 (P) - | 2 5 (BC) - q90 | 5 -.025 2.5724429 -.0418954 10.0419 (N) - | 0 9.5 (P) - | 1 11 (BC) --------------+---------------------------------------------------------------- -discrete_ci | - mean | .39203464 -.2011155 1.465503 -2.480298 3.264368 (N) - | -3.040391 2.988622 (P) - | -2.552153 3.346904 (BC) - q10 | 0 0 0 0 0 (N) - | 0 0 (P) - | . . (BC) - q20 | 1 -.495 .53045444 -.0396716 2.039672 (N) - | 0 1 (P) - | . . (BC) - q30 | 1 -.38 .49682408 .0262427 1.973757 (N) - | 0 1 (P) - | . . (BC) - q40 | 1 -.305 .46156278 .0953536 1.904646 (N) - | 0 1 (P) - | . . (BC) - q50 | 1 -.125 .42458966 .1678196 1.83218 (N) - | 0 2 (P) - | 1 2 (BC) - q60 | 1 -.055 .54170307 -.0617185 2.061718 (N) - | 0 2 (P) - | 1 2 (BC) - q70 | 2 -.385 .74804603 .5338567 3.466143 (N) - | 0 3 (P) - | 2 3 (BC) - q80 | 2 -.05 1.1935758 -.3393655 4.339366 (N) - | -.5 4 (P) - | 1 4 (BC) - q90 | 5 -.625 2.5646172 -.0265573 10.02656 (N) - | -1 9 (P) - | 1 12 (BC) --------------+---------------------------------------------------------------- -dci_lower_~d | - mean | .06982245 -.3937826 1.5167328 -2.902919 3.042564 (N) - | -3.797628 2.624866 (P) - | -2.660809 3.319576 (BC) - q10 | 0 -.395 .49007742 -.9605341 .9605341 (N) - | -1 0 (P) - | . . (BC) - q20 | 1 -.855 .69018605 -.3527398 2.35274 (N) - | -1 1 (P) - | . . (BC) - q30 | 1 -.755 .63797339 -.2504049 2.250405 (N) - | -1 1 (P) - | . . (BC) - q40 | 1 -.595 .64268204 -.2596336 2.259634 (N) - | -1 1 (P) - | . . (BC) - q50 | 1 -.65 .59941345 -.1748288 2.174829 (N) - | -1 1 (P) - | 2 2 (BC) - q60 | 1 -.535 .83802532 -.6424994 2.642499 (N) - | -1 2 (P) - | 1 2 (BC) - q70 | 1 -.02 .8080002 -.5836513 2.583651 (N) - | 0 2 (P) - | 1 3 (BC) - q80 | 2 -.825 1.4228484 -.7887316 4.788732 (N) - | -1 4 (P) - | 1 4 (BC) - q90 | 4 -.285 2.6644458 -1.222218 9.222218 (N) - | -1 8.5 (P) - | 0 10 (BC) --------------+---------------------------------------------------------------- -dci_upper_~d | - mean | 1.0761079 -.3158963 1.5330381 -1.928592 4.080807 (N) - | -2.680837 3.682333 (P) - | -1.73887 4.221036 (BC) - q10 | .75 -.21375 .33941042 .0847678 1.415232 (N) - | 0 .75 (P) - | . . (BC) - q20 | 1.75 -.6725 .60845694 .5574463 2.942554 (N) - | 0 1.75 (P) - | . . (BC) - q30 | 2 -.77 .6777883 .6715593 3.328441 (N) - | 0 2 (P) - | . . (BC) - q40 | 2 -.73 .66279445 .7009467 3.299053 (N) - | 0 2 (P) - | . . (BC) - q50 | 2 -.435 .56334875 .8958567 3.104143 (N) - | 0 2 (P) - | 3 3 (BC) - q60 | 2 -.62 .71283989 .6028595 3.397141 (N) - | 0 3 (P) - | 2 3 (BC) - q70 | 2 .045 .75219945 .5257162 3.474284 (N) - | 1 3 (P) - | 2 4 (BC) - q80 | 3 -.365 1.2162117 .6162689 5.383731 (N) - | 0 5 (P) - | 2 5 (BC) - q90 | 5 -.025 2.5724429 -.0418954 10.0419 (N) - | 0 9.5 (P) - | 1 11 (BC) ------------------------------------------------------------------------------- -(N) normal confidence interval -(P) percentile confidence interval -(BC) bias-corrected confidence interval - -. -. cic // test replay works - -Changes in Changes (CIC) Model - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - y | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.533038 0.70 0.483 -1.928592 4.080807 - q10 | .75 .3394104 2.21 0.027 .0847678 1.415232 - q20 | 1.75 .6084569 2.88 0.004 .5574463 2.942554 - q30 | 2 .6777883 2.95 0.003 .6715593 3.328441 - q40 | 2 .6627944 3.02 0.003 .7009467 3.299053 - q50 | 2 .5633487 3.55 0.000 .8958567 3.104143 - q60 | 2 .7128399 2.81 0.005 .6028595 3.397141 - q70 | 2 .7521995 2.66 0.008 .5257162 3.474284 - q80 | 3 1.216212 2.47 0.014 .6162689 5.383731 - q90 | 5 2.572443 1.94 0.052 -.0418954 10.0419 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.465503 0.27 0.789 -2.480298 3.264368 - q10 | 0 (omitted) - q20 | 1 .5304544 1.89 0.059 -.0396716 2.039672 - q30 | 1 .4968241 2.01 0.044 .0262427 1.973757 - q40 | 1 .4615628 2.17 0.030 .0953536 1.904646 - q50 | 1 .4245897 2.36 0.019 .1678196 1.83218 - q60 | 1 .5417031 1.85 0.065 -.0617185 2.061718 - q70 | 2 .748046 2.67 0.008 .5338567 3.466143 - q80 | 2 1.193576 1.68 0.094 -.3393655 4.339366 - q90 | 5 2.564617 1.95 0.051 -.0265573 10.02656 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.516733 0.05 0.963 -2.902919 3.042564 - q10 | 0 .4900774 0.00 1.000 -.9605341 .9605341 - q20 | 1 .6901861 1.45 0.147 -.3527398 2.35274 - q30 | 1 .6379734 1.57 0.117 -.2504049 2.250405 - q40 | 1 .642682 1.56 0.120 -.2596336 2.259634 - q50 | 1 .5994134 1.67 0.095 -.1748288 2.174829 - q60 | 1 .8380253 1.19 0.233 -.6424994 2.642499 - q70 | 1 .8080002 1.24 0.216 -.5836513 2.583651 - q80 | 2 1.422848 1.41 0.160 -.7887316 4.788732 - q90 | 4 2.664446 1.50 0.133 -1.222218 9.222218 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.533038 0.70 0.483 -1.928592 4.080807 - q10 | .75 .3394104 2.21 0.027 .0847678 1.415232 - q20 | 1.75 .6084569 2.88 0.004 .5574463 2.942554 - q30 | 2 .6777883 2.95 0.003 .6715593 3.328441 - q40 | 2 .6627944 3.02 0.003 .7009467 3.299053 - q50 | 2 .5633487 3.55 0.000 .8958567 3.104143 - q60 | 2 .7128399 2.81 0.005 .6028595 3.397141 - q70 | 2 .7521995 2.66 0.008 .5257162 3.474284 - q80 | 3 1.216212 2.47 0.014 .6162689 5.383731 - q90 | 5 2.572443 1.94 0.052 -.0418954 10.0419 -------------------------------------------------------------------------------- -(Effect of Treatment on the Treated Group) - -. est store a - -. -. timer on 12 - -. cap nois bootstrap, reps(`Nreps') strata(high after) : cic all y high after -(running cic on estimation sample) - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - y | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.688439 0.64 0.524 -2.233172 4.385387 - q10 | .75 .3574209 2.10 0.036 .0494679 1.450532 - q20 | 1.75 .5860341 2.99 0.003 .6013943 2.898606 - q30 | 2 .6780848 2.95 0.003 .6709782 3.329022 - q40 | 2 .6754675 2.96 0.003 .6761081 3.323892 - q50 | 2 .5840209 3.42 0.001 .8553401 3.14466 - q60 | 2 .7485329 2.67 0.008 .5329025 3.467098 - q70 | 2 .7399409 2.70 0.007 .5497424 3.450258 - q80 | 3 1.219183 2.46 0.014 .6104454 5.389555 - q90 | 5 2.777946 1.80 0.072 -.4446744 10.44467 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.654571 0.24 0.813 -2.850866 3.634935 - q10 | 0 (omitted) - q20 | 1 .5205332 1.92 0.055 -.0202263 2.020226 - q30 | 1 .5063417 1.97 0.048 .0075885 1.992411 - q40 | 1 .4930675 2.03 0.043 .0336054 1.966395 - q50 | 1 .437874 2.28 0.022 .1417827 1.858217 - q60 | 1 .5523818 1.81 0.070 -.0826484 2.082648 - q70 | 2 .7401616 2.70 0.007 .5493099 3.45069 - q80 | 2 1.151523 1.74 0.082 -.2569434 4.256943 - q90 | 5 2.779248 1.80 0.072 -.4472266 10.44723 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.68306 0.04 0.967 -3.228914 3.368559 - q10 | 0 .4996481 0.00 1.000 -.9792923 .9792923 - q20 | 1 .6886736 1.45 0.146 -.3497755 2.349775 - q30 | 1 .6285502 1.59 0.112 -.2319358 2.231936 - q40 | 1 .6678361 1.50 0.134 -.3089347 2.308935 - q50 | 1 .6038195 1.66 0.098 -.1834645 2.183464 - q60 | 1 .8904716 1.12 0.261 -.7452923 2.745292 - q70 | 1 .755815 1.32 0.186 -.4813701 2.48137 - q80 | 2 1.300937 1.54 0.124 -.5497897 4.54979 - q90 | 4 2.844262 1.41 0.160 -1.57465 9.57465 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.688439 0.64 0.524 -2.233172 4.385387 - q10 | .75 .3574209 2.10 0.036 .0494679 1.450532 - q20 | 1.75 .5860341 2.99 0.003 .6013943 2.898606 - q30 | 2 .6780848 2.95 0.003 .6709782 3.329022 - q40 | 2 .6754675 2.96 0.003 .6761081 3.323892 - q50 | 2 .5840209 3.42 0.001 .8553401 3.14466 - q60 | 2 .7485329 2.67 0.008 .5329025 3.467098 - q70 | 2 .7399409 2.70 0.007 .5497424 3.450258 - q80 | 3 1.219183 2.46 0.014 .6104454 5.389555 - q90 | 5 2.777946 1.80 0.072 -.4446744 10.44467 -------------------------------------------------------------------------------- -(Effect of Treatment on the Treated Group) - -. timer off 12 - -. timer list 12 - 12: 19.73 / 1 = 19.7350 - -. -. // test if selected vars works -. cap nois bootstrap [continuous]_b[mean], reps(20) strata(high after) : cic all y high after -(running cic on estimation sample) - -Bootstrap replications (20) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................... - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 20 - - command: cic all y high after - _bs_1: [continuous]_b[mean] - ------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] --------------+---------------------------------------------------------------- - _bs_1 | 1.076108 1.038631 1.04 0.300 -.9595708 3.111787 ------------------------------------------------------------------------------- - -. -. // test jacknife -. jacknife: cic all y high after if uniform()<.1 -(running cic on estimation sample) - -Jackknife replications (567) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 -.................................................. 250 -.................................................. 300 -.................................................. 350 -.................................................. 400 -.................................................. 450 -.................................................. 500 -.................................................. 550 -................. - -Changes in Changes (CIC) Model Number of obs = 567 - Replications = 567 - F( 5, 566) = . - Prob > F = . - -------------------------------------------------------------------------------- - | Jackknife - y | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 4.2 2.445168 1.72 0.086 -.6027103 9.00271 - q10 | 0 (omitted) - q20 | 0 (omitted) - q30 | 2 . . . . . - q40 | 1 6.622614 0.15 0.880 -12.0079 14.0079 - q50 | 0 11.68165 0.00 1.000 -22.94467 22.94467 - q60 | 0 (omitted) - q70 | 1 . . . . . - q80 | 0 7.060343 0.00 1.000 -13.86767 13.86767 - q90 | -1 19.28928 -0.05 0.959 -38.88731 36.88731 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | 3.689473 2.210697 1.67 0.096 -.6526978 8.031644 - q10 | 0 (omitted) - q20 | 0 (omitted) - q30 | 1 . . . . . - q40 | 0 6.622614 0.00 1.000 -13.0079 13.0079 - q50 | 0 7.318208 0.00 1.000 -14.37416 14.37416 - q60 | 0 (omitted) - q70 | 0 (omitted) - q80 | -1 6.298324 -0.16 0.874 -13.37094 11.37094 - q90 | -1 19.28928 -0.05 0.959 -38.88731 36.88731 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | 3.202315 2.89614 1.11 0.269 -2.48618 8.89081 - q10 | 0 (omitted) - q20 | 0 (omitted) - q30 | 1 . . . . . - q40 | -1 11.57354 -0.09 0.931 -23.73233 21.73233 - q50 | -1 7.318208 -0.14 0.891 -15.37416 13.37416 - q60 | -1 . . . . . - q70 | 0 (omitted) - q80 | -1 10.62002 -0.09 0.925 -21.85947 19.85947 - q90 | -1 19.28928 -0.05 0.959 -38.88731 36.88731 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 4.2 2.445168 1.72 0.086 -.6027103 9.00271 - q10 | 0 (omitted) - q20 | 0 (omitted) - q30 | 2 . . . . . - q40 | 1 6.622614 0.15 0.880 -12.0079 14.0079 - q50 | 0 11.68165 0.00 1.000 -22.94467 22.94467 - q60 | 0 (omitted) - q70 | 1 . . . . . - q80 | 0 7.060343 0.00 1.000 -13.86767 13.86767 - q90 | -1 19.28928 -0.05 0.959 -38.88731 36.88731 -------------------------------------------------------------------------------- -(Effect of Treatment on the Treated Group) - -. -. // check fweights are working -. // I should get the same results if I use fweights or if I expand the datset -. preserve - -. gen testweight =(uniform()<.95) + (uniform()<.20) - -. tab testweight - - testweight | Freq. Percent Cum. -------------+----------------------------------- - 0 | 204 3.63 3.63 - 1 | 4,372 77.71 81.34 - 2 | 1,050 18.66 100.00 -------------+----------------------------------- - Total | 5,626 100.00 - -. cic all y high after [fw=testweight], at(25 50 75 90) `vce' -(204 missing values generated) - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | .7729598 1.452663 0.53 0.595 -2.074208 3.620127 - q25 | 1 .490481 2.04 0.041 .0386749 1.961325 - q50 | 2 .4859586 4.12 0.000 1.047539 2.952461 - q75 | 3 .8366 3.59 0.000 1.360294 4.639706 - q90 | 6 2.703799 2.22 0.026 .7006518 11.29935 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .0239941 1.435558 0.02 0.987 -2.789649 2.837637 - q25 | 0 .4955835 0.00 1.000 -.9713258 .9713258 - q50 | 1 .4405342 2.27 0.023 .1365689 1.863431 - q75 | 2 .7746615 2.58 0.010 .4816913 3.518309 - q90 | 5 2.661842 1.88 0.060 -.2171141 10.21711 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | -.2503617 1.458184 -0.17 0.864 -3.10835 2.607627 - q25 | 0 .4525472 0.00 1.000 -.8869763 .8869763 - q50 | 1 .6014221 1.66 0.096 -.1787657 2.178766 - q75 | 1 .8882115 1.13 0.260 -.7408625 2.740862 - q90 | 5 2.744345 1.82 0.068 -.3788183 10.37882 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | .7729598 1.452663 0.53 0.595 -2.074208 3.620127 - q25 | 1 .490481 2.04 0.041 .0386749 1.961325 - q50 | 2 .4859586 4.12 0.000 1.047539 2.952461 - q75 | 3 .8366 3.59 0.000 1.360294 4.639706 - q90 | 6 2.703799 2.22 0.026 .7006518 11.29935 -------------------------------------------------------------------------------- -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] - -. drop if testweight==0 -(204 observations deleted) - -. expand testweight -(1050 observations created) - -. cic all y high after , at(25 50 75 90) `vce' - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 6472 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | .7729598 1.453899 0.53 0.595 -2.076629 3.622549 - q25 | 1 .5282102 1.89 0.058 -.0352729 2.035273 - q50 | 2 .4885627 4.09 0.000 1.042435 2.957565 - q75 | 3 .8136863 3.69 0.000 1.405204 4.594796 - q90 | 6 2.680541 2.24 0.025 .7462356 11.25376 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .0239941 1.441528 0.02 0.987 -2.801348 2.849336 - q25 | 0 .4549007 0.00 1.000 -.891589 .891589 - q50 | 1 .3825332 2.61 0.009 .2502487 1.749751 - q75 | 2 .7088635 2.82 0.005 .6106531 3.389347 - q90 | 5 2.67446 1.87 0.062 -.2418462 10.24185 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | -.2503617 1.466955 -0.17 0.864 -3.125542 2.624818 - q25 | 0 .4328241 0.00 1.000 -.8483196 .8483196 - q50 | 1 .6090606 1.64 0.101 -.1937368 2.193737 - q75 | 1 .847328 1.18 0.238 -.6607325 2.660732 - q90 | 5 2.802996 1.78 0.074 -.4937703 10.49377 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | .7729598 1.453899 0.53 0.595 -2.076629 3.622549 - q25 | 1 .5282102 1.89 0.058 -.0352729 2.035273 - q50 | 2 .4885627 4.09 0.000 1.042435 2.957565 - q75 | 3 .8136863 3.69 0.000 1.405204 4.594796 - q90 | 6 2.680541 2.24 0.025 .7462356 11.25376 -------------------------------------------------------------------------------- -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] - -. restore - -. -. // check other weights are working -. preserve - -. gen testweight = max(0,rnormal(1.25,.05)) - -. summ testweight - - Variable | Obs Mean Std. Dev. Min Max --------------+-------------------------------------------------------- - testweight | 5626 1.249935 .0505591 1.076696 1.421769 - -. cic all y high after [iw=testweight], at(25 50 75 90) `vce' -(When bootstrapping standard errors with iweights, the sub-option vce(bootstrap, size(7032.135)) was used by default, where 7032.135 is the sum of the iweights.) - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.206773 1.41383 0.85 0.393 -1.564283 3.977828 - q25 | 1 .5497244 1.82 0.069 -.07744 2.07744 - q50 | 2 .589502 3.39 0.001 .8445974 3.155403 - q75 | 2 .7680655 2.60 0.009 .4946193 3.505381 - q90 | 5 2.193131 2.28 0.023 .701542 9.298458 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .5242872 1.377101 0.38 0.703 -2.174781 3.223356 - q25 | 0 .3938918 0.00 1.000 -.7720138 .7720138 - q50 | 1 .3707591 2.70 0.007 .2733255 1.726674 - q75 | 2 .7071068 2.83 0.005 .6140962 3.385904 - q90 | 5 2.287919 2.19 0.029 .5157614 9.484239 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .2049088 1.418287 0.14 0.885 -2.574883 2.984701 - q25 | 0 .5620985 0.00 1.000 -1.101693 1.101693 - q50 | 1 .6051496 1.65 0.098 -.1860714 2.186071 - q75 | 1 .8309195 1.20 0.229 -.6285722 2.628572 - q90 | 4 2.300705 1.74 0.082 -.509298 8.509298 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.206773 1.41383 0.85 0.393 -1.564283 3.977828 - q25 | 1 .5497244 1.82 0.069 -.07744 2.07744 - q50 | 2 .589502 3.39 0.001 .8445974 3.155403 - q75 | 2 .7680655 2.60 0.009 .4946193 3.505381 - q90 | 5 2.193131 2.28 0.023 .701542 9.298458 -------------------------------------------------------------------------------- -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 all y high after [aw=testweight], at(25 50 75 90) `vce' -(sum of wgt is 7.0321e+03) -(When bootstrapping standard errors with aweights and pweights, the weights are normalized to mean=1 and the sub-option vce(bootstrap, size(5626)) sub-option was used by default, where 5626 is the number of obse -> rvations.) - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.206773 1.652651 0.73 0.465 -2.032363 4.445909 - q25 | 1 .5344595 1.87 0.061 -.0475214 2.047521 - q50 | 2 .5727479 3.49 0.000 .8774347 3.122565 - q75 | 2 .7899971 2.53 0.011 .4516341 3.548366 - q90 | 5 2.696434 1.85 0.064 -.2849126 10.28491 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .5242872 1.601213 0.33 0.743 -2.614033 3.662607 - q25 | 0 .4096512 0.00 1.000 -.8029015 .8029015 - q50 | 1 .4288292 2.33 0.020 .1595102 1.84049 - q75 | 2 .7696341 2.60 0.009 .4915448 3.508455 - q90 | 5 2.731981 1.83 0.067 -.3545838 10.35458 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .2049089 1.645168 0.12 0.901 -3.01956 3.429378 - q25 | 0 .566196 0.00 1.000 -1.109724 1.109724 - q50 | 1 .6228279 1.61 0.108 -.2207202 2.22072 - q75 | 1 .8822083 1.13 0.257 -.7290965 2.729096 - q90 | 4 2.794449 1.43 0.152 -1.477019 9.477019 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.206773 1.652651 0.73 0.465 -2.032363 4.445909 - q25 | 1 .5344595 1.87 0.061 -.0475214 2.047521 - q50 | 2 .5727479 3.49 0.000 .8774347 3.122565 - q75 | 2 .7899971 2.53 0.011 .4516341 3.548366 - q90 | 5 2.696434 1.85 0.064 -.2849126 10.28491 -------------------------------------------------------------------------------- -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] - -. cap nois cic all y high after [pw=testweight], at(25 50 75 90) `vce' -vce(bootstrap) is not allowed with pweights. -invalid syntax - -. cap nois cic all y high after [pw=testweight], at(25 50 75 90) vce(none) - -Changes in Changes (CIC) Model - Number of obs = 5,626 -------------------------------------------------------------------------------- - y | Coef. ---------------+---------------------------------------------------------------- -continuous | - mean | 1.206773 - q25 | 1 - q50 | 2 - q75 | 2 - q90 | 5 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .5242872 - q25 | 0 - q50 | 1 - q75 | 2 - q90 | 5 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .2049089 - q25 | 0 - q50 | 1 - q75 | 1 - q90 | 4 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.206773 - q25 | 1 - q50 | 2 - q75 | 2 - q90 | 5 -------------------------------------------------------------------------------- -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] - -. restore - -. -. // check it works with svy bootstrap. -. // This example is just quick-and-dirty. -. // It does not account for the fact that you might want to include strata(high after) in some applications. -. preserve - -. forvalues i = 1/100 { - 2. gen testweight`i' = max(0,rnormal(1.25,.05)) - 3. local testweightlist `testweightlist' testweight`i' - 4. } - -. bys high after: gen rownum=_n - -. xtile gid=rownum, nq(10) - -. svyset gid, bsrweight(`testweightlist') vce(bootstrap) - - pweight: - VCE: bootstrap - MSE: off - bsrweight: testweight1 testweight2 testweight3 testweight4 testweight5 testweight6 testweight7 testweight8 testweight9 testweight10 testweight11 testweight12 testweight13 testweight14 testweight15 - testweight16 testweight17 testweight18 testweight19 testweight20 testweight21 testweight22 testweight23 testweight24 testweight25 testweight26 testweight27 testweight28 testweight29 testweight30 - testweight31 testweight32 testweight33 testweight34 testweight35 testweight36 testweight37 testweight38 testweight39 testweight40 testweight41 testweight42 testweight43 testweight44 testweight45 - testweight46 testweight47 testweight48 testweight49 testweight50 testweight51 testweight52 testweight53 testweight54 testweight55 testweight56 testweight57 testweight58 testweight59 testweight60 - testweight61 testweight62 testweight63 testweight64 testweight65 testweight66 testweight67 testweight68 testweight69 testweight70 testweight71 testweight72 testweight73 testweight74 testweight75 - testweight76 testweight77 testweight78 testweight79 testweight80 testweight81 testweight82 testweight83 testweight84 testweight85 testweight86 testweight87 testweight88 testweight89 testweight90 - testweight91 testweight92 testweight93 testweight94 testweight95 testweight96 testweight97 testweight98 testweight99 testweight100 - Single unit: missing - Strata 1: - SU 1: gid - FPC 1: - -. svy : cic all y high after -(running cic on estimation sample) - -Bootstrap replications (100) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 - -Changes in Changes (CIC) Model Number of obs = 5626 - Population size = 5626 - Replications = 100 - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - y | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 .093635 11.49 0.000 .8925868 1.259629 - q10 | .75 . . . . . - q20 | 1.75 .14 12.50 0.000 1.475605 2.024395 - q30 | 2 . . . . . - q40 | 2 . . . . . - q50 | 2 . . . . . - q60 | 2 .0994987 20.10 0.000 1.804986 2.195014 - q70 | 2 .2712932 7.37 0.000 1.468275 2.531725 - q80 | 3 . . . . . - q90 | 5 .1705872 29.31 0.000 4.665655 5.334345 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 .0955731 4.10 0.000 .2047149 .5793544 - q10 | 0 (omitted) - q20 | 1 .14 7.14 0.000 .725605 1.274395 - q30 | 1 . . . . . - q40 | 1 . . . . . - q50 | 1 . . . . . - q60 | 1 . . . . . - q70 | 2 . . . . . - q80 | 2 . . . . . - q90 | 5 . . . . . ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 .1007595 0.69 0.488 -.1276625 .2673075 - q10 | 0 (omitted) - q20 | 1 .14 7.14 0.000 .725605 1.274395 - q30 | 1 . . . . . - q40 | 1 . . . . . - q50 | 1 .0994987 10.05 0.000 .804986 1.195014 - q60 | 1 . . . . . - q70 | 1 . . . . . - q80 | 2 . . . . . - q90 | 4 .1705872 23.45 0.000 3.665655 4.334345 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 .093635 11.49 0.000 .8925868 1.259629 - q10 | .75 . . . . . - q20 | 1.75 .14 12.50 0.000 1.475605 2.024395 - q30 | 2 . . . . . - q40 | 2 . . . . . - q50 | 2 . . . . . - q60 | 2 .0994987 20.10 0.000 1.804986 2.195014 - q70 | 2 .2712932 7.37 0.000 1.468275 2.531725 - q80 | 3 . . . . . - q90 | 5 .1705872 29.31 0.000 4.665655 5.334345 -------------------------------------------------------------------------------- - -. restore - -. -. -. // direct comparision of vce() options -. est restore a -(results a are active now) - -. cic - -Changes in Changes (CIC) Model - -Number of strata = 4 Number of obs = 5626 - Replications = 200 - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - y | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.533038 0.70 0.483 -1.928592 4.080807 - q10 | .75 .3394104 2.21 0.027 .0847678 1.415232 - q20 | 1.75 .6084569 2.88 0.004 .5574463 2.942554 - q30 | 2 .6777883 2.95 0.003 .6715593 3.328441 - q40 | 2 .6627944 3.02 0.003 .7009467 3.299053 - q50 | 2 .5633487 3.55 0.000 .8958567 3.104143 - q60 | 2 .7128399 2.81 0.005 .6028595 3.397141 - q70 | 2 .7521995 2.66 0.008 .5257162 3.474284 - q80 | 3 1.216212 2.47 0.014 .6162689 5.383731 - q90 | 5 2.572443 1.94 0.052 -.0418954 10.0419 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.465503 0.27 0.789 -2.480298 3.264368 - q10 | 0 (omitted) - q20 | 1 .5304544 1.89 0.059 -.0396716 2.039672 - q30 | 1 .4968241 2.01 0.044 .0262427 1.973757 - q40 | 1 .4615628 2.17 0.030 .0953536 1.904646 - q50 | 1 .4245897 2.36 0.019 .1678196 1.83218 - q60 | 1 .5417031 1.85 0.065 -.0617185 2.061718 - q70 | 2 .748046 2.67 0.008 .5338567 3.466143 - q80 | 2 1.193576 1.68 0.094 -.3393655 4.339366 - q90 | 5 2.564617 1.95 0.051 -.0265573 10.02656 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.516733 0.05 0.963 -2.902919 3.042564 - q10 | 0 .4900774 0.00 1.000 -.9605341 .9605341 - q20 | 1 .6901861 1.45 0.147 -.3527398 2.35274 - q30 | 1 .6379734 1.57 0.117 -.2504049 2.250405 - q40 | 1 .642682 1.56 0.120 -.2596336 2.259634 - q50 | 1 .5994134 1.67 0.095 -.1748288 2.174829 - q60 | 1 .8380253 1.19 0.233 -.6424994 2.642499 - q70 | 1 .8080002 1.24 0.216 -.5836513 2.583651 - q80 | 2 1.422848 1.41 0.160 -.7887316 4.788732 - q90 | 4 2.664446 1.50 0.133 -1.222218 9.222218 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.533038 0.70 0.483 -1.928592 4.080807 - q10 | .75 .3394104 2.21 0.027 .0847678 1.415232 - q20 | 1.75 .6084569 2.88 0.004 .5574463 2.942554 - q30 | 2 .6777883 2.95 0.003 .6715593 3.328441 - q40 | 2 .6627944 3.02 0.003 .7009467 3.299053 - q50 | 2 .5633487 3.55 0.000 .8958567 3.104143 - q60 | 2 .7128399 2.81 0.005 .6028595 3.397141 - q70 | 2 .7521995 2.66 0.008 .5257162 3.474284 - q80 | 3 1.216212 2.47 0.014 .6162689 5.383731 - q90 | 5 2.572443 1.94 0.052 -.0418954 10.0419 -------------------------------------------------------------------------------- -(Effect of Treatment on the Treated Group) - -. set seed 1 - -. cic all y high after, vce(boot, reps(`Nreps') sepercentile) - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model -Warning: More bootstrap repetitions might be needed with the -sepercentile- bootstrapping sub-option.. -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.623258 0.66 0.507 -2.105419 4.257635 - q10 | .75 .1913265 3.92 0.000 .3750069 1.124993 - q20 | 1.75 .4464286 3.92 0.000 .8750161 2.624984 - q30 | 2 .5102041 3.92 0.000 1.000018 2.999982 - q40 | 2 .5102041 3.92 0.000 1.000018 2.999982 - q50 | 2 .5102041 3.92 0.000 1.000018 2.999982 - q60 | 2 .7653061 2.61 0.009 .5000276 3.499972 - q70 | 2 .5102041 3.92 0.000 1.000018 2.999982 - q80 | 3 1.27551 2.35 0.019 .5000459 5.499954 - q90 | 5 2.423469 2.06 0.039 .2500873 9.749913 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.538013 0.25 0.799 -2.622416 3.406486 - q10 | 0 (omitted) - q20 | 1 .255102 3.92 0.000 .5000092 1.499991 - q30 | 1 .255102 3.92 0.000 .5000092 1.499991 - q40 | 1 .255102 3.92 0.000 .5000092 1.499991 - q50 | 1 .5102041 1.96 0.050 .0000184 1.999982 - q60 | 1 .5102041 1.96 0.050 .0000184 1.999982 - q70 | 2 .7653061 2.61 0.009 .5000276 3.499972 - q80 | 2 1.147959 1.74 0.081 -.2499587 4.249959 - q90 | 5 2.55102 1.96 0.050 .0000919 9.999908 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.638391 0.04 0.966 -3.141365 3.28101 - q10 | 0 .255102 0.00 1.000 -.4999908 .4999908 - q20 | 1 .5102041 1.96 0.050 .0000184 1.999982 - q30 | 1 .5102041 1.96 0.050 .0000184 1.999982 - q40 | 1 .5102041 1.96 0.050 .0000184 1.999982 - q50 | 1 .5102041 1.96 0.050 .0000184 1.999982 - q60 | 1 .7653061 1.31 0.191 -.4999724 2.499972 - q70 | 1 .5102041 1.96 0.050 .0000184 1.999982 - q80 | 2 1.27551 1.57 0.117 -.4999541 4.499954 - q90 | 4 2.423469 1.65 0.099 -.7499127 8.749913 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.623258 0.66 0.507 -2.105419 4.257635 - q10 | .75 .1913265 3.92 0.000 .3750069 1.124993 - q20 | 1.75 .4464286 3.92 0.000 .8750161 2.624984 - q30 | 2 .5102041 3.92 0.000 1.000018 2.999982 - q40 | 2 .5102041 3.92 0.000 1.000018 2.999982 - q50 | 2 .5102041 3.92 0.000 1.000018 2.999982 - q60 | 2 .7653061 2.61 0.009 .5000276 3.499972 - q70 | 2 .5102041 3.92 0.000 1.000018 2.999982 - q80 | 3 1.27551 2.35 0.019 .5000459 5.499954 - q90 | 5 2.423469 2.06 0.039 .2500873 9.749913 -------------------------------------------------------------------------------- -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 all y high after, vce(delta) - -Changes in Changes (CIC) Model - Number of obs = 5,626 -------------------------------------------------------------------------------- - y | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 1.487323 0.72 0.469 -1.839623 3.991839 - q10 | .75 . . . . . - q20 | 1.75 . . . . . - q30 | 2 . . . . . - q40 | 2 . . . . . - q50 | 2 . . . . . - q60 | 2 . . . . . - q70 | 2 . . . . . - q80 | 3 . . . . . - q90 | 5 . . . . . ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 1.32094 0.30 0.767 -2.197521 2.98159 - q10 | 0 (omitted) - q20 | 1 . . . . . - q30 | 1 . . . . . - q40 | 1 . . . . . - q50 | 1 . . . . . - q60 | 1 . . . . . - q70 | 2 . . . . . - q80 | 2 . . . . . - q90 | 5 . . . . . ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.233195 0.06 0.955 -2.347718 2.487363 - q10 | 0 (omitted) - q20 | 1 . . . . . - q30 | 1 . . . . . - q40 | 1 . . . . . - q50 | 1 . . . . . - q60 | 1 . . . . . - q70 | 1 . . . . . - q80 | 2 . . . . . - q90 | 4 . . . . . ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.235408 0.87 0.384 -1.345772 3.497988 - q10 | .75 . . . . . - q20 | 1.75 . . . . . - q30 | 2 . . . . . - q40 | 2 . . . . . - q50 | 2 . . . . . - q60 | 2 . . . . . - q70 | 2 . . . . . - q80 | 3 . . . . . - q90 | 5 . . . . . -------------------------------------------------------------------------------- -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 all y high after, vce(none) - -Changes in Changes (CIC) Model - Number of obs = 5,626 -------------------------------------------------------------------------------- - y | Coef. ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 - q10 | .75 - q20 | 1.75 - q30 | 2 - q40 | 2 - q50 | 2 - q60 | 2 - q70 | 2 - q80 | 3 - q90 | 5 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 - q10 | 0 - q20 | 1 - q30 | 1 - q40 | 1 - q50 | 1 - q60 | 1 - q70 | 2 - q80 | 2 - q90 | 5 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 - q10 | 0 - q20 | 1 - q30 | 1 - q40 | 1 - q50 | 1 - q60 | 1 - q70 | 1 - q80 | 2 - q90 | 4 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 - q10 | .75 - q20 | 1.75 - q30 | 2 - q40 | 2 - q50 | 2 - q60 | 2 - q70 | 2 - q80 | 3 - q90 | 5 -------------------------------------------------------------------------------- -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] - -. -. // test various combinations of estimators/vce/graphs with graphs -. cic all y high after , at(25 50 75) vce(bootstrap, reps(5)) - -Bootstrap replications (5) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -..... - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 5 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 .7386313 1.46 0.145 -.3715829 2.523799 - q25 | 1 .4472136 2.24 0.025 .1234775 1.876523 - q50 | 2 .4472136 4.47 0.000 1.123477 2.876523 - q75 | 2 .8944272 2.24 0.025 .2469549 3.753045 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | .3920346 .7330585 0.53 0.593 -1.044734 1.828803 - q25 | 0 .4472136 0.00 1.000 -.8765225 .8765225 - q50 | 1 . . . . . - q75 | 2 .5477226 3.65 0.000 .9264835 3.073516 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 .7798026 0.09 0.929 -1.458563 1.598208 - q25 | 0 .4472136 0.00 1.000 -.8765225 .8765225 - q50 | 1 .5477226 1.83 0.068 -.0735165 2.073516 - q75 | 1 .7071068 1.41 0.157 -.3859038 2.385904 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 .7386313 1.46 0.145 -.3715829 2.523799 - q25 | 1 .4472136 2.24 0.025 .1234775 1.876523 - q50 | 2 .4472136 4.47 0.000 1.123477 2.876523 - q75 | 2 .8944272 2.24 0.025 .2469549 3.753045 -------------------------------------------------------------------------------- -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] - -. cicgraph, name(all) - -. cic dci y high after , at(25 50 75) vce(bootstrap, reps(5)) - -Bootstrap replications (5) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -..... - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 5 - - command: cic - ------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] --------------+---------------------------------------------------------------- - mean | .3920346 1.53625 0.26 0.799 -2.618959 3.403029 - q25 | 0 .4472136 0.00 1.000 -.8765225 .8765225 - q50 | 1 .7071068 1.41 0.157 -.3859038 2.385904 - q75 | 2 1.095445 1.83 0.068 -.147033 4.147033 ------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Discrete CIC model (under the conditional independence assumption) [discrete_ci] - -. cicgraph, name(dci) - -. cic continuous y high after , at(25 50 75) vce(bootstrap, reps(5)) - -Bootstrap replications (5) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -..... - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 5 - - command: cic - ------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] --------------+---------------------------------------------------------------- - mean | 1.076108 1.727004 0.62 0.533 -2.308757 4.460973 - q25 | 1 .622495 1.61 0.108 -.2200677 2.220068 - q50 | 2 .5477226 3.65 0.000 .9264835 3.073516 - q75 | 2 1.095445 1.83 0.068 -.147033 4.147033 ------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Continuous CIC model [continuous] - -. cic bounds y high after , at(25 50 75) vce(bootstrap, reps(5)) did - -Bootstrap replications (5) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -..... - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 5626 - Replications = 5 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -did_model | - high#after | - 0 0 | 6.271554 .2229747 28.13 0.000 5.834532 6.708577 - 0 1 | 7.037328 .2569194 27.39 0.000 6.533775 7.540881 - 1 0 | 11.1766 .4983522 22.43 0.000 10.19985 12.15335 - 1 1 | 12.89363 1.08195 11.92 0.000 10.77304 15.01421 ---------------+---------------------------------------------------------------- -did | - did | .9512506 1.4811 0.64 0.521 -1.951651 3.854152 ---------------+---------------------------------------------------------------- -qdid | - q25 | -.7657738 .2529685 -3.03 0.002 -1.261583 -.2699648 - q50 | .2342262 .4611809 0.51 0.612 -.6696718 1.138124 - q75 | 1.234226 .6846223 1.80 0.071 -.107609 2.576061 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | .0698225 1.893509 0.04 0.971 -3.641387 3.781031 - q25 | 0 .83666 0.00 1.000 -1.639824 1.639824 - q50 | 1 .83666 1.20 0.232 -.6398235 2.639824 - q75 | 1 .83666 1.20 0.232 -.6398235 2.639824 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | 1.076108 1.850775 0.58 0.561 -2.551345 4.703561 - q25 | 1 .75 1.33 0.182 -.469973 2.469973 - q50 | 2 .5477226 3.65 0.000 .9264835 3.073516 - q75 | 2 .7071068 2.83 0.005 .6140962 3.385904 -------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Traditional DID model [did], [did_model] ( == 1 - high) -Quantile DID model [qdid] -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] - -. cicgraph, name(bounds) eq(qdid dci_lower_bnd) - -. cic continuous y high after , at(25 50 75) vce(none) - -Changes in Changes (CIC) Model - Number of obs = 5,626 ------------------------------------------------------------------------------- - y | Coef. --------------+---------------------------------------------------------------- -continuous | - mean | 1.076108 - q25 | 1 - q50 | 2 - q75 | 2 ------------------------------------------------------------------------------- -Effect of Treatment on the Treated Group -Continuous CIC model [continuous] - -. cicgraph,name(novce) - -. -. -. -. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -. * The following code can be used to test the program using another -. * "fake" data set -. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -. sysuse nlsw88, clear -(NLSW, 1988 extract) - -. set seed 1 - -. gen TREAT1 = uniform() < .5 - -. replace wage = wage + TREAT1 -(1100 real changes made) - -. gen POST1 = uniform() < .5 - -. replace wage = wage - POST1 -(1128 real changes made) - -. -. // bootstrap the sample conditional on Ngt for g; t = 0; 1 -. cic all wage TREAT1 POST1 i.occupation, at(10(10)90 99.5) - -Changes in Changes (CIC) Model - Number of obs = 2,237 ------------------------------------------------------------------------------------------ - wage | Coef. -------------------------+---------------------------------------------------------------- -did_model | - TREAT1#POST1 | - 0 0 | 10.72951 - 0 1 | 9.516252 - 1 0 | 12.18243 - 1 1 | 10.53795 - | - occupation | -Professional/technical | 0 - Managers/admin | .1792631 - Sales | -3.585525 - Clerical/unskilled | -2.243058 - Craftsmen | -3.587501 - Operatives | -5.094676 - Transport | -7.541208 - Laborers | -5.831176 - Farmers | -2.464722 - Farm laborers | -7.606139 - Service | -4.65619 - Household workers | -4.233994 - Other | -1.9284 -------------------------+---------------------------------------------------------------- -did | - did | -.4312209 -------------------------+---------------------------------------------------------------- -qdid | - q10 | -.2342982 - q20 | .181781 - q30 | .0960022 - q40 | .0602816 - q50 | .194561 - q60 | .0974314 - q70 | -.0925108 - q80 | -.2336244 - q90 | -.4648989 - q99_5 | -5.409595 -------------------------+---------------------------------------------------------------- -continuous | - mean | -.3609319 - q10 | -.1573928 - q20 | .2940639 - q30 | .0157719 - q40 | -.0588057 - q50 | .0963566 - q60 | -.1656024 - q70 | .0501099 - q80 | .2746353 - q90 | .397624 - q99_5 | -4.074348 -------------------------+---------------------------------------------------------------- -discrete_ci | - mean | -.3609319 - q10 | -.1573928 - q20 | .2940639 - q30 | .0157719 - q40 | -.0588057 - q50 | .0963566 - q60 | -.1656024 - q70 | .0501099 - q80 | .2746353 - q90 | .397624 - q99_5 | -4.074348 -------------------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | -.3609319 - q10 | -.1573928 - q20 | .2940639 - q30 | .0157719 - q40 | -.0588057 - q50 | .0963566 - q60 | -.1656024 - q70 | .0501099 - q80 | .2746353 - q90 | .397624 - q99_5 | -4.074348 -------------------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | -.3609319 - q10 | -.1573928 - q20 | .2940639 - q30 | .0157719 - q40 | -.0588057 - q50 | .0963566 - q60 | -.1656024 - q70 | .0501099 - q80 | .2746353 - q90 | .397624 - q99_5 | -4.074348 ------------------------------------------------------------------------------------------ -Effect of Treatment on the Treated Group -Traditional DID model [did], [did_model] ( == 1 - TREAT1) -Quantile DID model [qdid] -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] - -. -. -. -. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -. * The following code can be used to test the program using "fake" data -. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -. clear - -. set obs 4 -obs was 0, now 4 - -. gen post = inlist(_n,1,3) - -. gen treat = inlist(_n,1,2) - -. local n_g=500 - -. expand `n_g' -(1996 observations created) - -. bys p t: gen y = _n / `n_g' - -. gen d = 1.75 - 1.5 * y if t==0 & p==0 -(1500 missing values generated) - -. replace d = 0.75 - 0.5 * y if t==0 & p==1 -(500 real changes made) - -. replace d = 0.80 - 0.4 * y if t==1 & p==0 -(500 real changes made) - -. replace d = 0.50 - 1.0 * y if t==1 & p==1 -(500 real changes made) - -. replace d = round(d,.01) -(1852 real changes made) - -. cic all d treat post, at(10(10)90) vce(b) - -Bootstrap replications (200) -----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 -.................................................. 50 -.................................................. 100 -.................................................. 150 -.................................................. 200 - -Changes in Changes (CIC) Model - -Bootstrap results - -Number of strata = 4 Number of obs = 2000 - Replications = 200 - - command: cic - -------------------------------------------------------------------------------- - | Observed Bootstrap Normal-based - | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- -continuous | - mean | -.36726 .0174178 -21.09 0.000 -.4013982 -.3331218 - q10 | -.71 .016156 -43.95 0.000 -.7416651 -.6783349 - q20 | -.63 .0226717 -27.79 0.000 -.6744358 -.5855642 - q30 | -.54 .0249701 -21.63 0.000 -.5889406 -.4910594 - q40 | -.45 .026186 -17.18 0.000 -.5013236 -.3986764 - q50 | -.37 .0266426 -13.89 0.000 -.4222185 -.3177815 - q60 | -.28 .0271345 -10.32 0.000 -.3331826 -.2268174 - q70 | -.19 .0258095 -7.36 0.000 -.2405856 -.1394144 - q80 | -.11 .0223426 -4.92 0.000 -.1537907 -.0662092 - q90 | -.02 .0197293 -1.01 0.311 -.0586686 .0186687 ---------------+---------------------------------------------------------------- -discrete_ci | - mean | -.367505 .017467 -21.04 0.000 -.4017397 -.3332703 - q10 | -.71 .0159572 -44.49 0.000 -.7412756 -.6787244 - q20 | -.63 .0227235 -27.72 0.000 -.6745373 -.5854627 - q30 | -.54 .0251468 -21.47 0.000 -.5892867 -.4907133 - q40 | -.45 .0259605 -17.33 0.000 -.5008816 -.3991184 - q50 | -.37 .0263984 -14.02 0.000 -.4217399 -.3182601 - q60 | -.28 .0268065 -10.45 0.000 -.3325398 -.2274601 - q70 | -.19 .0256658 -7.40 0.000 -.240304 -.1396959 - q80 | -.11 .0224633 -4.90 0.000 -.1540273 -.0659727 - q90 | -.02 .020119 -0.99 0.320 -.0594325 .0194325 ---------------+---------------------------------------------------------------- -dci_lower_bnd | - mean | -.37036 .0175221 -21.14 0.000 -.4047028 -.3360172 - q10 | -.72 .0159934 -45.02 0.000 -.7513465 -.6886535 - q20 | -.63 .0225495 -27.94 0.000 -.6741962 -.5858038 - q30 | -.54 .0247396 -21.83 0.000 -.5884888 -.4915112 - q40 | -.46 .0264716 -17.38 0.000 -.5118833 -.4081167 - q50 | -.37 .0261422 -14.15 0.000 -.4212379 -.3187621 - q60 | -.28 .0273976 -10.22 0.000 -.3336984 -.2263016 - q70 | -.2 .02586 -7.73 0.000 -.2506847 -.1493153 - q80 | -.11 .0229581 -4.79 0.000 -.1549971 -.0650029 - q90 | -.02 .0199607 -1.00 0.316 -.0591222 .0191223 ---------------+---------------------------------------------------------------- -dci_upper_bnd | - mean | -.36726 .0174178 -21.09 0.000 -.4013982 -.3331218 - q10 | -.71 .016156 -43.95 0.000 -.7416651 -.6783349 - q20 | -.63 .0226717 -27.79 0.000 -.6744358 -.5855642 - q30 | -.54 .0249701 -21.63 0.000 -.5889406 -.4910594 - q40 | -.45 .026186 -17.18 0.000 -.5013236 -.3986764 - q50 | -.37 .0266426 -13.89 0.000 -.4222185 -.3177815 - q60 | -.28 .0271345 -10.32 0.000 -.3331826 -.2268174 - q70 | -.19 .0258095 -7.36 0.000 -.2405856 -.1394144 - q80 | -.11 .0223426 -4.92 0.000 -.1537907 -.0662092 - q90 | -.02 .0197293 -1.01 0.311 -.0586686 .0186687 -------------------------------------------------------------------------------- -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] - -. -. cicgraph , name(r1) - -. cicgraph , ci(ci_percentile) name(r2) - -. -. -. -. -. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -. * The following code tests various sub-functions -. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -. -. /* * * * * BEGIN MATA BLOCK * * * * */ -. version 11.2 - -. mata: -------------------------------------------------- mata (type end to exit) ----------------------------------------------------------------------------------------------------------------------------------------- -: mata set matastrict on - -: mata set matafavor speed - -: mata set matalnum on /* drop this later */ - -: -: "check prob" - check prob - -: prob((1\1\2\3),(1\2\3\4\5)) - 1 - +-------+ - 1 | .5 | - 2 | .25 | - 3 | .25 | - 4 | 0 | - 5 | 0 | - +-------+ - -: prob((1\1\2\3),(1\2\3\4\5),(1\1\2\1)) - 1 - +------+ - 1 | .4 | - 2 | .4 | - 3 | .2 | - 4 | 0 | - 5 | 0 | - +------+ - -: prob((1\ 2\3),(1\2\3\4\5),(2 \2\1)) - 1 - +------+ - 1 | .4 | - 2 | .4 | - 3 | .2 | - 4 | 0 | - 5 | 0 | - +------+ - -: prob((1\ 2\3),(1\2\3\4\5),(1.5\1.5\.75)) - 1 - +------+ - 1 | .4 | - 2 | .4 | - 3 | .2 | - 4 | 0 | - 5 | 0 | - +------+ - -: -: "check cdfinv & cdfinv_brckt" - check cdfinv & cdfinv_brckt - -: P = (.1\.3\.6\.7\1.0) - -: YS = (1\2\3\4\5) - -: /* 1 = */ cdfinv(.05 , P, YS) - 1 - -: /* 1 = */ cdfinv(.1 , P, YS) - 1 - -: /* 2 = */ cdfinv(.2 , P, YS) - 2 - -: /* 2 = */ cdfinv(.2999, P, YS) - 2 - -: /* 2 = */ cdfinv(.3 , P, YS) - 2 - -: /* 3 = */ cdfinv(.3001, P, YS) - 3 - -: /* 5 = */ cdfinv(.9999, P, YS) - 5 - -: /* 5 = */ cdfinv(1 , P, YS) - 5 - -: -: /* -499 = */ cdfinv_brckt(.05 , P, YS) - -499 - -: /* 1 = */ cdfinv_brckt(.1 , P, YS) - 1 - -: /* 1 = */ cdfinv_brckt(.2 , P, YS) - 1 - -: /* 1 = */ cdfinv_brckt(.2999, P, YS) - 1 - -: /* 2 = */ cdfinv_brckt(.3 , P, YS) - 2 - -: /* 2 = */ cdfinv_brckt(.3001, P, YS) - 2 - -: /* 4 = */ cdfinv_brckt(.9999, P, YS) - 4 - -: /* 5 = */ cdfinv_brckt(1 , P, YS) - 5 - -: -: -: // YS -: // bs_draw_nowgt(YS) -: // bs_draw_nowgt(YS,(10\1\1\1\0)) -: -: -: // check draw sample -: YS = (1\2\3\4\5\6\7\8) - -: N00=N01=N10=N11=2 - -: for (i=1; i<=1000; i++) { -> bs_draw = bs_draw_wgt((1\2),(3\4),(5\6),(7\8),N00, N01, N10, N11) -> if (i==1) bs_draw -> if (i==1) avg = bs_draw' -> else avg = (avg \ bs_draw') -> } - 1 - +-----+ - 1 | 1 | - 2 | 1 | - 3 | 0 | - 4 | 2 | - 5 | 1 | - 6 | 1 | - 7 | 1 | - 8 | 1 | - +-----+ - -: meanvariance(avg)' - 1 2 3 4 5 6 7 8 9 - +----------------------------------------------------------------------------------------------------------------------------------------+ - 1 | .963 .5221531532 -.5221531532 -.0140510511 .0140510511 .029955956 -.029955956 -.0094534535 .0094534535 | - 2 | 1.037 -.5221531532 .5221531532 .0140510511 -.0140510511 -.029955956 .029955956 .0094534535 -.0094534535 | - 3 | .999 -.0140510511 .0140510511 .5195185185 -.5195185185 .000998999 -.000998999 -.007019019 .007019019 | - 4 | 1.001 .0140510511 -.0140510511 -.5195185185 .5195185185 -.000998999 .000998999 .007019019 -.007019019 | - 5 | .998 .029955956 -.029955956 .000998999 -.000998999 .5185145145 -.5185145145 -.010034034 .010034034 | - 6 | 1.002 -.029955956 .029955956 -.000998999 .000998999 -.5185145145 .5185145145 .010034034 -.010034034 | - 7 | .988 -.0094534535 .0094534535 -.007019019 .007019019 -.010034034 .010034034 .4943503504 -.4943503504 | - 8 | 1.012 .0094534535 -.0094534535 .007019019 -.007019019 .010034034 -.010034034 -.4943503504 .4943503504 | - +----------------------------------------------------------------------------------------------------------------------------------------+ - -: colmin(avg)' - 1 - +-----+ - 1 | 0 | - 2 | 0 | - 3 | 0 | - 4 | 0 | - 5 | 0 | - 6 | 0 | - 7 | 0 | - 8 | 0 | - +-----+ - -: colmax(avg)' - 1 - +-----+ - 1 | 2 | - 2 | 2 | - 3 | 2 | - 4 | 2 | - 5 | 2 | - 6 | 2 | - 7 | 2 | - 8 | 2 | - +-----+ - -: -: popsize=rows(YS) - -: tempwgt = (1\9\1\9\1\9\1\9) - -: cumsum00 = quadrunningsum(tempwgt[1\2]) - -: cumsum01 = quadrunningsum(tempwgt[3\4]) - -: cumsum10 = quadrunningsum(tempwgt[5\6]) - -: cumsum11 = quadrunningsum(tempwgt[7\8]) - -: popsize00 = round(cumsum00[N00]) // the number of obs. in each group is rounded to the nearest integer - -: popsize01 = round(cumsum01[N01]) - -: popsize10 = round(cumsum10[N10]) - -: popsize11 = round(cumsum11[N11]) - -: cumsum00 = cumsum00/cumsum00[N00] // normalize to sum to one within groups - -: cumsum01 = cumsum01/cumsum01[N01] - -: cumsum10 = cumsum10/cumsum10[N10] - -: cumsum11 = cumsum11/cumsum11[N11] - -: -: cumsum00 - 1 - +------+ - 1 | .1 | - 2 | 1 | - +------+ - -: popsize00 - 10 - -: -: for (i=1; i<=1000; i++) { -> bs_draw = bs_draw_wgt((1\2),(3\4),(5\6),(7\8),N00, N01, N10, N11, cumsum00, cumsum01, cumsum10, cumsum11, popsize00, popsize01, popsize10, popsize11) -> if (i==1) bs_draw -> if (i==1) avg = bs_draw' -> else avg = (avg \ bs_draw') -> } - 1 - +-----+ - 1 | 2 | - 2 | 8 | - 3 | 1 | - 4 | 9 | - 5 | 1 | - 6 | 9 | - 7 | 3 | - 8 | 7 | - +-----+ - -: meanvariance(avg)' - 1 2 3 4 5 6 7 8 9 - +----------------------------------------------------------------------------------------------------------------------------------------+ - 1 | .988 .8447007007 -.8447007007 .0128928929 -.0128928929 .0078638639 -.0078638639 .0398118118 -.0398118118 | - 2 | 9.012 -.8447007007 .8447007007 -.0128928929 .0128928929 -.0078638639 .0078638639 -.0398118118 .0398118118 | - 3 | .99 .0128928929 -.0128928929 .8527527528 -.8527527528 .0299099099 -.0299099099 .0198298298 -.0198298298 | - 4 | 9.01 -.0128928929 .0128928929 -.8527527528 .8527527528 -.0299099099 .0299099099 -.0198298298 .0198298298 | - 5 | .988 .0078638639 -.0078638639 .0299099099 -.0299099099 .9367927928 -.9367927928 -.0482762763 .0482762763 | - 6 | 9.012 -.0078638639 .0078638639 -.0299099099 .0299099099 -.9367927928 .9367927928 .0482762763 -.0482762763 | - 7 | .981 .0398118118 -.0398118118 .0198298298 -.0198298298 -.0482762763 .0482762763 .8855245245 -.8855245245 | - 8 | 9.019 -.0398118118 .0398118118 -.0198298298 .0198298298 .0482762763 -.0482762763 -.8855245245 .8855245245 | - +----------------------------------------------------------------------------------------------------------------------------------------+ - -: colmin(avg)' - 1 - +-----+ - 1 | 0 | - 2 | 6 | - 3 | 0 | - 4 | 6 | - 5 | 0 | - 6 | 5 | - 7 | 0 | - 8 | 5 | - +-----+ - -: colmax(avg)' - 1 - +------+ - 1 | 4 | - 2 | 10 | - 3 | 4 | - 4 | 10 | - 5 | 5 | - 6 | 10 | - 7 | 5 | - 8 | 10 | - +------+ - -: -: popsize=1000 - -: cumsum00 = quadrunningsum(tempwgt[1\2]) - -: cumsum01 = quadrunningsum(tempwgt[3\4]) - -: cumsum10 = quadrunningsum(tempwgt[5\6]) - -: cumsum11 = quadrunningsum(tempwgt[7\8]) - -: popsize00 = round(cumsum00[N00]/colsum(tempwgt)*popsize) // the number of obs. in each group is rounded to the nearest integer - -: popsize01 = round(cumsum00[N00]/colsum(tempwgt)*popsize) - -: popsize10 = round(cumsum00[N00]/colsum(tempwgt)*popsize) - -: popsize11 = round(cumsum00[N00]/colsum(tempwgt)*popsize) - -: cumsum00 = cumsum00/cumsum00[N00] // normalize to sum to one within groups - -: cumsum01 = cumsum01/cumsum01[N01] - -: cumsum10 = cumsum10/cumsum10[N10] - -: cumsum11 = cumsum11/cumsum11[N11] - -: -: -: cumsum00 - 1 - +------+ - 1 | .1 | - 2 | 1 | - +------+ - -: popsize00 - 250 - -: -: for (i=1; i<=100; i++) { -> bs_draw = bs_draw_wgt((1\2),(3\4),(5\6),(7\8),N00, N01, N10, N11, cumsum00, cumsum01, cumsum10, cumsum11, popsize00, popsize01, popsize10, popsize11) -> if (i==1) bs_draw -> if (i==1) avg = bs_draw' -> else avg = (avg \ bs_draw') -> } - 1 - +-------+ - 1 | 24 | - 2 | 226 | - 3 | 18 | - 4 | 232 | - 5 | 29 | - 6 | 221 | - 7 | 22 | - 8 | 228 | - +-------+ - -: meanvariance(avg)' - 1 2 3 4 5 6 7 8 9 - +----------------------------------------------------------------------------------------------------------------------------------------+ - 1 | 25.11 21.45242424 -21.45242424 -1.823737374 1.823737374 1.520606061 -1.520606061 -.2982828283 .2982828283 | - 2 | 224.89 -21.45242424 21.45242424 1.823737374 -1.823737374 -1.520606061 1.520606061 .2982828283 -.2982828283 | - 3 | 26.05 -1.823737374 1.823737374 23.60353535 -23.60353535 .097979798 -.097979798 .2611111111 -.2611111111 | - 4 | 223.95 1.823737374 -1.823737374 -23.60353535 23.60353535 -.097979798 .097979798 -.2611111111 .2611111111 | - 5 | 24.86 1.520606061 -1.520606061 .097979798 -.097979798 23.03070707 -23.03070707 -.5129292929 .5129292929 | - 6 | 225.14 -1.520606061 1.520606061 -.097979798 .097979798 -23.03070707 23.03070707 .5129292929 -.5129292929 | - 7 | 25.23 -.2982828283 .2982828283 .2611111111 -.2611111111 -.5129292929 .5129292929 20.46171717 -20.46171717 | - 8 | 224.77 .2982828283 -.2982828283 -.2611111111 .2611111111 .5129292929 -.5129292929 -20.46171717 20.46171717 | - +----------------------------------------------------------------------------------------------------------------------------------------+ - -: colmin(avg)' - 1 - +-------+ - 1 | 14 | - 2 | 214 | - 3 | 16 | - 4 | 212 | - 5 | 14 | - 6 | 215 | - 7 | 13 | - 8 | 215 | - +-------+ - -: colmax(avg)' - 1 - +-------+ - 1 | 36 | - 2 | 236 | - 3 | 38 | - 4 | 234 | - 5 | 35 | - 6 | 236 | - 7 | 35 | - 8 | 237 | - +-------+ - -: -: cumdfinv((1::10), .94 ) - 10 - -: cumdfinv((1::10), .94, J(10,1,1)) - 10 - -: cumdfinv((1::10), .9 ) - 9 - -: cumdfinv((1::10), .9 , J(10,1,1)) - 9 - -: -: cumdfinv((1::9) , .94 ,(2\J(8,1,1))) - 9 - -: cumdfinv((1::9) , .84 ,(J(8,1,1)\2)) - 9 - -: cumdfinv((1::9) , .9 ,(2\J(8,1,1))) - 8 - -: cumdfinv((1::9) , .8 ,(J(8,1,1)\2)) - 8 - -: -: // test fden w/ this vector -: Y= ( 1.11 \ 1.1 \ 1.2 \ 1.3 \ 5 \ 5.1 \ 5.2 \ 10 \ 10 \ 10 ) - -: -: // the following three should all equal 0.072278 -: fden(1.1,Y) // no weights - .0722784261 - -: fden(1.1,Y, J(10,1,1) ) // weight = 1 - .0722784261 - -: fden(1.1,Y[1..8], (J(7,1,1) \ 3) ) // weight = 1, except handle three "10" at bottom - .0722784261 - -: -: // the following two should equal 0.076557 -: fden(1.1,(Y\Y)) // stack Y on top of itself - .0765567951 - -: fden(1.1,Y, J(10,1,2)) // weight = 2 - .0765567951 - -: -: -: -: mata describe - - # bytes type name and extent -------------------------------------------------------------------------------- - 140 real colvector bs_draw_nowgt() - 2,596 real colvector bs_draw_wgt() - 416 void bs_se() - 276 real scalar cdf() - 324 real scalar cdf_bar() - 252 real scalar cdfinv() - 408 real scalar cdfinv_brckt() - 3,508 struct scalar cic() - 2,976 struct matrix cic_all() - 15,176 void cic_caller() - 1,340 real vector cic_con() - 1,948 real vector cic_dci() - 1,380 real vector cic_lower() - 276 structdef scalar cic_result() - 1,344 real vector cic_upper() - 832 real scalar cumdfinv() - 1,384 struct scalar did() - 192 structdef scalar did_result() - 768 real scalar fden() - 520 real vector prob() - 1,160 real rowvector qdid() - 8,364 real rowvector se_cic() - 8 real scalar N00 - 8 real scalar N01 - 8 real scalar N10 - 8 real scalar N11 - 40 real colvector P[5] - 80 real colvector Y[10] - 64 real colvector YS[8] - 6,400 real matrix avg[100,8] - 64 real colvector bs_draw[8] - 16 real colvector cumsum00[2] - 16 real colvector cumsum01[2] - 16 real colvector cumsum10[2] - 16 real colvector cumsum11[2] - 8 real scalar i - 8 real scalar popsize - 8 real scalar popsize00 - 8 real scalar popsize01 - 8 real scalar popsize10 - 8 real scalar popsize11 - 64 real colvector tempwgt[8] -------------------------------------------------------------------------------- - -: -: end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -. /* * * * * END OF MATA BLOCK * * * * */ -. -. -. * test cic_vce_parse -. cic_vce_parse, vce(boot, reps(1000) saving(myfile.dta, replace) sepercent) - -. return list - -scalars: - r(sepercentile) = 1 - r(dots) = 1 - r(bssize) = 0 - r(bsreps) = 1000 - -macros: - r(saving) : "myfile.dta, replace" - r(vce) : "bootstrap" - -. cap nois cic_vce_parse, vce(none, reps(25)) -suboptions are not allowed with vce(none) -invalid syntax - -. return list - -. cic_vce_parse, vce(boot, reps(25) mse accel(myvector) saving("c:\temp\test.dta", replace)) - -. return list - -scalars: - r(sepercentile) = 0 - r(dots) = 1 - r(bssize) = 0 - r(bsreps) = 25 - -macros: - r(bsopts) : "mse accel(myvector)" - r(saving) : ""c:\temp\test.dta", replace" - r(vce) : "bootstrap" - -. -. log close - name: - log: C:\Users\kkranker\Documents\Dissertation\Stata-Changes-in-Changes\cic_benchmark_testing.log - log type: text - closed on: 5 Jan 2015, 13:56:38 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/cicgraph.ado b/cicgraph.ado deleted file mode 100644 index e18ccfa..0000000 --- a/cicgraph.ado +++ /dev/null @@ -1,143 +0,0 @@ -*! *! version $Id$ -*! Plot Changes-in-Changes Model Estimates -*! -*! Following cic, this program creates a twoway plot of the model estimates. -*! -*! $Date$ - -program define cicgraph, sortpreserve rclass - - // parse arguements - syntax [, /// - Ci(name) /// Matrix name with intervals to use {normal|percentile|bc|bca|*} /// - /// ci() expecting normal, percentile, bc, or bca. However cicgraph will still - /// work if there is a conforming matrix named e(ci_`ci'). - /// cicgraph might give strange error messages if e(ci_`ci') - /// ci(none) suppresses confidence intervals - /// by default, -normal- is used if matrix e(ci_normal) exists. - /// if it e(ci_normal) not exist, options e(ci_percentile) if available - /// This will work whether or not you include "ci_" (e.g., "ci_normal" and "normal" are both valid) - Equations(namelist) /// {continuous, discrete_ci, dci_lower_bnd, dci_upper_bnd, and/or qdid} - /// default is all the equations available - Name(string) /// graph names; default is name(cicgraph) - /// if >1 name in equations(), name is treated as a prefix. - /// default is name(cicgraph, replace) - *] - - cap assert ("`e(cmd)'"=="cic") - if _rc { - di as error "cicgraph was written as a post-estimation command for cic." - error 301 - } - - // pull coefficients - tempname b int - tempvar coef eqn p pctile mean meanll meanul meanaxis - matrix `b' = e(b) - matrix `b' = `b'' - svmat `b' , names("`coef'") - - // cic option - if mi("`ci'") { - cap qui di colsof(e(ci_normal)) - if !_rc local ci "normal" - else { - cap qui di colsof(e(ci_percentile)) - if !_rc local ci "ci_percentile" - } - } - if regexm("`ci'","^ci_(.*)") local ci = regexs(1) // if someone types ci_normal instead of normal, drop the "ci_" - cap qui di colsof(e(ci_normal)) - if !mi("`ci'") { - if !inlist("`ci'","normal","percentile","bc","bca") di as txt "ci() expecting normal, percentile, bc, or bca. However it will work if there is a conforming matrix named e(ci_`ci')" - matrix `int' = e(ci_`ci') - matrix `int' = `int'' - local level = e(level) - svmat `int', - } - else { - qui gen `int'1=. - qui gen `int'2=. - } - - // size of e(b) - local rows = rowsof(`b') - if (c(N) < `rows') set obs `rows' - if !mi("`ci'") { - if (rowsof(`int')!=rowsof(`b') | colsof(`int')!=2) { - di as error "e(ci_`ci') has the incorrect number of rows or columns." - error 198 - } - } - - // labels - local names : rownames `b' - local eqns : roweq `b' - local ylab : var lab `e(depvar)' - if mi(`"`ylab'"') local ylab = e(depvar) - - // add temporary variables containing e(b)' equation names and quantiles - qui { - gen `eqn' = "" - gen `p' = "" - gen `pctile' = . - forvalues i = 1/`rows' { - local thiseqn : word `i' of `eqns' - local thisname : word `i' of `names' - replace `eqn' = "`thiseqn'" in `i' - replace `p' = "`thisname'" in `i' - if regexm("`thisname'","^q([0-9]*)_?([0-9]*)") replace `pctile' = real(regexs(1)+"."+regexs(2)) in `i' - } - - bys `eqn' (`p'): gen `mean' = `coef'[1] if inlist(_n,1,_N) - by `eqn' : gen `meanll' = `int'1[1] if inlist(_n,1,_N) - by `eqn' : gen `meanul' = `int'2[1] if inlist(_n,1,_N) - gen `meanaxis' = 0 - replace `meanaxis' = 100 if `p'!="mean" - } - - // graph results - if mi("`equations'") { - local equations : list uniq eqns - local equations : subinstr local equations "did_model" "" - local equations : subinstr local equations "did" "" - } - if mi("`name'") local name "cicgraph, replace" - _parse comma name name_rhs: name - local c=1 - foreach eqnname of local equations { - if "`eqnname'"=="continuous" local eqnlabel "Continuous CIC model" - else if "`eqnname'"=="discrete_ci" local eqnlabel "Discrete CIC model (under the conditional independence assumption)" - else if "`eqnname'"=="dci_lower_bnd" local eqnlabel "Lower bound for the discrete CIC model (without conditional independence)" - else if "`eqnname'"=="dci_upper_bnd" local eqnlabel "Upper bound for the discrete CIC model (without conditional independence)" - else if "`eqnname'"=="qdid" local eqnlabel "Quantile DID model" - else { - di as error "eqnname() should be continuous, discrete_ci, dci_lower_bnd, dci_upper_bnd, and/or qdid" - error 198 - } - if wordcount(`"`equations'"') == 1 local graphname `name' - else local graphname `name'`c' - local graphnamelist `graphnamelist' `graphname' - - if !mi("`ci'") local addlegendlabels label(4 "`level'% CI") label(2 "`level'% CI") - if !mi("`ci'") local addlegendorder "4 2" - - graph twoway /// - (scatter `mean' `meanaxis', sort pstyle(p2) connect(L) msymbol(none) lwidth(*1.25)) /// - (scatter `meanll' `meanaxis', sort pstyle(p2) connect(L) msymbol(none) lwidth(*.85) lpattern(dash)) /// - (scatter `meanul' `meanaxis', sort pstyle(p2) connect(L) msymbol(none) lwidth(*.85) lpattern(dash)) /// - (rcap `int'1 `int'2 `pctile', sort pstyle(p1) lcolor(*.85) lwidth(*.85)) /// - (scatter `coef' `pctile', sort pstyle(p1) msize(*1.15) connect(L)) /// - if `eqn'=="`eqnname'", /// - legend(order(5 1 `addlegendorder') cols(2) label(5 "CIC at quantiles") label(1 "Mean CIC") `addlegendlabels' ) /// - xtitle( "Quantile" ) ytitle(`"`ylab'"') note( "`eqnlabel'" "`=e(footnote)'" ) /// - name(`graphname' `name_rhs') `options' - local ++c - } - return local cmd cicgraph - return local name `graphnamelist' - return local equations `equations' - if mi("`ci'") return local ci none - else return local ci ci_`ci' - -end // end of cicgraph program definition