I have a question regarding the estimation of the following dataset example using Triple-difference approach (DDD).
The data is at the zip code level and it is monthly, Policy is a dummy that represents the treatment. I have already done first with the Difference-in-difference (DD), however, I need to proceed by doing a further analysis using DDD - a more robust analysis.
For this reason, I have generated the "type" variable, it is external_control when the observation is not eligible for the former treatment-policy. Its is "internal_control" when the observation is eligible but at the time being is not treated, and finally, it is "intervention" when the observation is treated by the policy. Accordingly, I generated another variable "group":
group = 2 if type=intervention, group = 1 if type=internal_control, group = 0 if type=external_control.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long zipcode float month_year double KW str16 type float policy byte group 95375 685 0 "intervention" 1 2 92548 685 0 "internal_control" 0 1 92372 685 0 "internal_control" 0 1 95672 685 140.68499946594238 "intervention" 1 2 95466 685 0 "intervention" 1 2 93528 685 0 "internal_control" 0 1 93601 685 8.79800033569336 "intervention" 1 2 93922 685 0 "intervention" 1 2 94028 685 33.49499988555908 "intervention" 1 2 94534 685 126.48621940612793 "intervention" 1 2 91607 685 30.348711252212524 "external_control" 0 0 95553 685 0 "intervention" 1 2 93512 685 0 "internal_control" 0 1 92301 685 64.225510597229 "internal_control" 0 1 95660 685 14.420000076293945 "external_control" 0 0 94904 685 36.52600049972534 "intervention" 1 2 94965 685 34.36799955368042 "intervention" 1 2 93458 685 15.401999711990356 "intervention" 1 2 92706 685 35.67346930503845 "internal_control" 0 1 95227 685 0 "intervention" 1 2 92620 685 59.6791832447052 "internal_control" 0 1 95377 685 442.9059989452362 "intervention" 1 2 90036 685 7.9307615756988525 "external_control" 0 0 94080 685 48.83591949939728 "intervention" 1 2 91342 685 62.96466612815857 "external_control" 0 0 93461 685 14.80299973487854 "intervention" 1 2 90048 685 0 "external_control" 0 0 92662 685 0 "internal_control" 0 1 90007 685 0 "external_control" 0 0 94037 685 17.33199977874756 "intervention" 1 2 92821 685 56.36734580993652 "internal_control" 0 1 95681 685 13.910399913787842 "intervention" 1 2 93117 685 20.075510025024414 "internal_control" 0 1 93304 685 192.63462042808533 "intervention" 1 2 93265 685 0 "internal_control" 0 1 94960 685 51.72599983215332 "intervention" 1 2 92885 685 0 "internal_control" 0 1 93613 685 0 "intervention" 1 2 92285 685 5.472448825836182 "internal_control" 0 1 90277 685 0 "internal_control" 0 1 93656 685 34.532999992370605 "intervention" 1 2 95830 685 0 "external_control" 0 0 91733 685 18.720408082008362 "internal_control" 0 1 91980 685 0 "intervention" 1 2 92118 685 32.87000012397766 "intervention" 1 2 94404 685 14.189000129699707 "intervention" 1 2 96092 685 0 "intervention" 1 2 90712 685 40.00612187385559 "internal_control" 0 1 90604 685 33.68877601623535 "internal_control" 0 1 95968 685 0 "intervention" 1 2 91401 685 42.66478776931763 "external_control" 0 0 94513 685 630.3171362876892 "intervention" 1 2 92571 685 84.76112246513367 "internal_control" 0 1 95686 685 13.11400032043457 "intervention" 1 2 92114 685 192.9940001964569 "intervention" 1 2 94599 685 0 "intervention" 1 2 93022 685 11.495306015014648 "internal_control" 0 1 95673 685 6.75 "external_control" 0 0 90732 685 2.393043279647827 "external_control" 0 0 94528 685 0 "intervention" 1 2 94596 685 44.368000507354736 "intervention" 1 2 91768 685 20.00408148765564 "internal_control" 0 1 93651 685 37.15499973297119 "intervention" 1 2 95490 685 30.928000450134277 "intervention" 1 2 94510 685 133.95400094985962 "intervention" 1 2 94576 685 0 "intervention" 1 2 93035 685 2.7989795207977295 "internal_control" 0 1 92405 685 0 "internal_control" 0 1 94938 685 13.229000091552734 "intervention" 1 2 95462 685 0 "intervention" 1 2 90247 685 6.747385025024414 "external_control" 0 0 91341 685 0 "external_control" 0 0 90044 685 12.56632661819458 "internal_control" 0 1 94060 685 0 "intervention" 1 2 95442 685 13.11400032043457 "intervention" 1 2 95776 685 115.13599967956543 "intervention" 1 2 92128 685 120.19500064849854 "intervention" 1 2 95835 685 62.93000030517578 "external_control" 0 0 92107 685 28.505000114440918 "intervention" 1 2 92286 685 0 "internal_control" 0 1 91914 685 93.15900111198425 "intervention" 1 2 95341 685 66.40899991989136 "intervention" 1 2 90620 685 55.31632649898529 "internal_control" 0 1 95747 685 9.119999885559082 "external_control" 0 0 93665 685 0 "intervention" 1 2 90039 685 10.423200368881226 "external_control" 0 0 92358 685 0 "internal_control" 0 1 92029 685 69.27099919319153 "intervention" 1 2 92131 685 109.60199904441833 "intervention" 1 2 93309 685 350.9520585536957 "intervention" 1 2 92391 685 0 "internal_control" 0 1 95076 685 203.99089860916138 "intervention" 1 2 90047 685 2.2812252044677734 "external_control" 0 0 95689 685 0 "intervention" 1 2 91903 685 0 "intervention" 1 2 95429 685 0 "intervention" 1 2 91360 685 63.26020359992981 "internal_control" 0 1 95443 685 0 "intervention" 1 2 92318 685 0 "internal_control" 0 1 91043 685 0 "external_control" 0 0 end format %tm month_year
The code for the regression is the following:
Code:
areg KW i.group##i.month_year, absorb(zipcode) vce(cluster zipcode)
These are the results I've got (I copied the top of the table, it is too long).
Code:
Linear regression, absorbing indicators Number of obs = 162,837 F( 195, 1636) = 5.59 Prob > F = 0.0000 R-squared = 0.6349 Adj R-squared = 0.6308 Root MSE = 52.7078 (Std. Err. adjusted for 1,637 clusters in zipcode) ---------------------------------------------------------------------------------- | Robust KW | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- group | 1 | 19.78687 17.77348 1.11 0.266 -15.0743 54.64805 2 | 81.18978 18.61215 4.36 0.000 44.68362 117.6959 | month_year | 613 | -9.709224 1.87834 -5.17 0.000 -13.39343 -6.025019 614 | -9.793017 1.85809 -5.27 0.000 -13.4375 -6.148532 615 | -9.176429 1.801469 -5.09 0.000 -12.70986 -5.643 616 | -9.713974 1.879218 -5.17 0.000 -13.3999 -6.028048 617 | -10.19106 1.855138 -5.49 0.000 -13.82975 -6.552364 618 | -10.46462 1.802974 -5.80 0.000 -14.001 -6.928243 619 | -10.56595 1.799568 -5.87 0.000 -14.09565 -7.036248 620 | -10.34246 1.790839 -5.78 0.000 -13.85504 -6.829885 621 | -9.194101 1.858878 -4.95 0.000 -12.84013 -5.548069 622 | -9.516614 1.764614 -5.39 0.000 -12.97776 -6.055473 623 | -8.583446 1.797179 -4.78 0.000 -12.10846 -5.058431 624 | -8.908334 1.826273 -4.88 0.000 -12.49041 -5.326254 625 | -8.511821 1.87907 -4.53 0.000 -12.19746 -4.826185 626 | -8.291232 1.833748 -4.52 0.000 -11.88797 -4.694491 627 | -8.814385 1.883945 -4.68 0.000 -12.50958 -5.119187 628 | -8.386843 1.916563 -4.38 0.000 -12.14602 -4.627666 629 | -7.259493 1.91653 -3.79 0.000 -11.0186 -3.500383 630 | -5.683113 1.842685 -3.08 0.002 -9.297383 -2.068842 631 | -5.969775 1.882968 -3.17 0.002 -9.663056 -2.276494 632 | -8.050178 1.886243 -4.27 0.000 -11.74988 -4.350473 633 | -6.047538 1.858343 -3.25 0.001 -9.69252 -2.402556 634 | -6.705906 1.912269 -3.51 0.000 -10.45666 -2.955152 635 | -6.982718 1.873548 -3.73 0.000 -10.65752 -3.307913 636 | -5.083596 1.968996 -2.58 0.010 -8.945614 -1.221578 637 | -5.894662 1.894577 -3.11 0.002 -9.610715 -2.178609 638 | -4.332852 1.922864 -2.25 0.024 -8.104388 -.5613173 639 | -4.46051 1.923896 -2.32 0.021 -8.234068 -.6869521 640 | -3.201176 1.81978 -1.76 0.079 -6.77052 .368167 641 | -5.304715 1.751898 -3.03 0.003 -8.740914 -1.868516 642 | -3.48501 1.98086 -1.76 0.079 -7.370299 .4002779 643 | -3.472132 1.827947 -1.90 0.058 -7.057495 .1132309 644 | -2.47412 1.979342 -1.25 0.211 -6.356432 1.408192 645 | -1.075496 1.841447 -0.58 0.559 -4.687337 2.536345 646 | -1.921002 1.668663 -1.15 0.250 -5.193943 1.351939 647 | -4.460459 1.827435 -2.44 0.015 -8.044817 -.8761016 648 | -5.510771 1.792628 -3.07 0.002 -9.02686 -1.994683 649 | -6.207759 1.757153 -3.53 0.000 -9.654265 -2.761253 650 | -5.720581 1.778435 -3.22 0.001 -9.208831 -2.232331 651 | -6.142653 1.821566 -3.37 0.001 -9.7155 -2.569807 652 | -5.165048 1.720986 -3.00 0.003 -8.540617 -1.789479 653 | -4.755501 1.767026 -2.69 0.007 -8.221373 -1.289629 654 | -4.223139 1.891008 -2.23 0.026 -7.932192 -.5140868 655 | -3.786432 1.674504 -2.26 0.024 -7.070829 -.5020356 656 | -4.291579 1.810879 -2.37 0.018 -7.843464 -.7396938 657 | .0243527 1.747577 0.01 0.989 -3.403371 3.452077 658 | -4.429971 1.780343 -2.49 0.013 -7.921963 -.9379797 659 | -.7805256 1.717185 -0.45 0.650 -4.148639 2.587588 660 | -1.79829 1.640555 -1.10 0.273 -5.016099 1.41952 661 | -3.334676 1.757149 -1.90 0.058 -6.781174 .1118217 662 | -1.374288 1.73327 -0.79 0.428 -4.77395 2.025374 663 | -2.521707 1.827527 -1.38 0.168 -6.106246 1.062831 664 | -1.405988 1.763144 -0.80 0.425 -4.864246 2.052269 665 | -2.558417 1.591964 -1.61 0.108 -5.68092 .5640857 666 | .5553597 1.683002 0.33 0.741 -2.745706 3.856425 667 | .0921778 1.70504 0.05 0.957 -3.252114 3.43647 668 | 1.659971 1.944641 0.85 0.393 -2.154277 5.474218 669 | 5.473787 2.058764 2.66 0.008 1.435696 9.511878 670 | 1.421905 1.905533 0.75 0.456 -2.315636 5.159447 671 | -1.513268 1.477842 -1.02 0.306 -4.41193 1.385393 672 | 6.208554 2.318427 2.68 0.007 1.661155 10.75595 673 | 4.328484 1.939832 2.23 0.026 .5236687 8.133299 674 | 14.60716 2.498076 5.85 0.000 9.707395 19.50692 675 | 4.702135 2.184754 2.15 0.032 .4169267 8.987344 676 | 4.774556 2.085728 2.29 0.022 .6835776 8.865534 677 | 6.17547 1.997837 3.09 0.002 2.256882 10.09406 678 | 7.218157 2.001361 3.61 0.000 3.292657 11.14366 679 | 5.14194 2.082598 2.47 0.014 1.057101 9.22678 680 | 7.176063 2.117355 3.39 0.001 3.02305 11.32908 681 | 4.098332 1.912385 2.14 0.032 .3473503 7.849313 682 | 1.030497 2.122172 0.49 0.627 -3.131962 5.192957 683 | .6291901 1.747925 0.36 0.719 -2.799217 4.057597 684 | 2.021725 2.062812 0.98 0.327 -2.024305 6.067756 685 | -1.092542 1.80771 -0.60 0.546 -4.638213 2.453128 686 | .745465 2.001033 0.37 0.710 -3.17939 4.67032 687 | -.3008112 2.031493 -0.15 0.882 -4.285412 3.68379 688 | -1.51757 1.878999 -0.81 0.419 -5.203067 2.167927 689 | -2.042243 1.901675 -1.07 0.283 -5.772216 1.68773 690 | -4.849388 2.009062 -2.41 0.016 -8.789992 -.9087847 691 | -5.584768 1.942681 -2.87 0.004 -9.395172 -1.774363 692 | -5.759677 2.007093 -2.87 0.004 -9.69642 -1.822933 693 | -5.326835 2.160914 -2.47 0.014 -9.565285 -1.088385 694 | -6.443076 2.105239 -3.06 0.002 -10.57232 -2.313829 695 | -5.346594 2.196706 -2.43 0.015 -9.655245 -1.037942 696 | -41.18969 3.424068 -12.03 0.000 -47.90571 -34.47368 697 | -32.32202 2.989421 -10.81 0.000 -38.18552 -26.45853 698 | -15.91413 2.662976 -5.98 0.000 -21.13733 -10.69093 699 | -29.34415 2.843017 -10.32 0.000 -34.92048 -23.76781 700 | -25.46491 2.890268 -8.81 0.000 -31.13393 -19.7959 701 | -29.54396 2.82975 -10.44 0.000 -35.09428 -23.99365 702 | -26.1919 2.927681 -8.95 0.000 -31.93429 -20.4495 703 | -23.67841 2.967047 -7.98 0.000 -29.49802 -17.8588 704 | -29.2838 2.950284 -9.93 0.000 -35.07053 -23.49707 705 | -21.98371 2.990262 -7.35 0.000 -27.84886 -16.11857 706 | -25.78715 3.008403 -8.57 0.000 -31.68788 -19.88643 707 | -23.37021 2.989053 -7.82 0.000 -29.23299 -17.50744 708 | -24.03746 3.116945 -7.71 0.000 -30.15109 -17.92384 709 | -31.69875 3.067936 -10.33 0.000 -37.71625 -25.68125 710 | -30.5053 2.915949 -10.46 0.000 -36.22469 -24.78592 | group#month_year | 0 696 | 0 (empty) 0 697 | 0 (empty) 0 698 | 0 (empty) 0 699 | 0 (empty) 0 700 | 0 (empty) 0 701 | 0 (empty) 0 702 | 0 (empty) 0 703 | 0 (empty) 0 704 | 0 (empty) 0 705 | 0 (empty) 0 706 | 0 (empty) 0 707 | 0 (empty) 0 708 | 0 (empty) 0 709 | 0 (empty) 0 710 | 0 (empty) 1 613 | 8.618822 1.920265 4.49 0.000 4.852385 12.38526 1 614 | 8.607829 1.935573 4.45 0.000 4.811367 12.40429 1 615 | 7.050914 1.876403 3.76 0.000 3.370509 10.73132 1 616 | 7.80943 1.93644 4.03 0.000 4.011267 11.60759 1 617 | 9.855735 1.906573 5.17 0.000 6.116154 13.59532 1 618 | 9.496242 1.880159 5.05 0.000 5.808471 13.18401 1 619 | 10.32441 1.857848 5.56 0.000 6.680403 13.96842 1 620 | 10.20991 1.848021 5.52 0.000 6.585172 13.83464 1 621 | 11.73477 1.996565 5.88 0.000 7.818674 15.65086 1 622 | 12.87114 2.670153 4.82 0.000 7.633863 18.10842 1 623 | 10.54546 1.873703 5.63 0.000 6.870355 14.22057 1 624 | 11.02017 1.952604 5.64 0.000 7.190303 14.85004 1 625 | 9.794515 1.944352 5.04 0.000 5.980833 13.6082 1 626 | 8.738982 1.931825 4.52 0.000 4.949872 12.52809 1 627 | 9.536612 1.970285 4.84 0.000 5.672064 13.40116 1 628 | 10.56996 2.022151 5.23 0.000 6.603688 14.53624 1 629 | 9.413572 2.315108 4.07 0.000 4.872683 13.95446 1 630 | 11.21834 2.190186 5.12 0.000 6.922472 15.5142 1 631 | 12.18328 2.013576 6.05 0.000 8.233819 16.13273 1 632 | 11.72858 1.960202 5.98 0.000 7.883815 15.57335 1 633 | 14.5551 2.024044 7.19 0.000 10.58511 18.52509 1 634 | 14.29892 2.036 7.02 0.000 10.30548 18.29237 1 635 | 15.77939 2.084958 7.57 0.000 11.68992 19.86886 1 636 | 13.77069 2.104433 6.54 0.000 9.643019 17.89835 1 637 | 12.59858 2.006257 6.28 0.000 8.663476 16.53368 1 638 | 15.43534 2.111142 7.31 0.000 11.29451 19.57617 1 639 | 18.40747 2.14239 8.59 0.000 14.20535 22.60959 1 640 | 14.69243 2.003658 7.33 0.000 10.76243 18.62244 1 641 | 14.87658 1.898356 7.84 0.000 11.15312 18.60004 1 642 | 17.11706 2.173193 7.88 0.000 12.85453 21.37959 1 643 | 19.74597 2.15975 9.14 0.000 15.50981 23.98214 1 644 | 23.4088 2.624029 8.92 0.000 18.26199 28.55561 1 645 | 22.80477 2.250085 10.14 0.000 18.39142 27.21812 1 646 | 32.63556 2.360752 13.82 0.000 28.00515 37.26598 1 647 | 33.97466 2.357375 14.41 0.000 29.35087 38.59845 1 648 | 32.116 2.316632 13.86 0.000 27.57213 36.65988 1 649 | 25.20706 2.081852 12.11 0.000 21.12369 29.29044 1 650 | 26.78872 2.11963 12.64 0.000 22.63125 30.9462 1 651 | 31.99761 2.28171 14.02 0.000 27.52224 36.47299 1 652 | 32.1206 2.328634 13.79 0.000 27.55319 36.68802 1 653 | 36.09742 2.468513 14.62 0.000 31.25564 40.9392 1 654 | 38.07656 2.671813 14.25 0.000 32.83602 43.31709 1 655 | 38.65105 2.61935 14.76 0.000 33.51342 43.78868 1 656 | 41.51344 2.788847 14.89 0.000 36.04336 46.98353 1 657 | 36.83556 2.673103 13.78 0.000 31.59249 42.07862 1 658 | 40.21516 2.712422 14.83 0.000 34.89498 45.53535 1 659 | 53.41049 3.227517 16.55 0.000 47.07999 59.741 1 660 | 50.19
Please, I would like to know if the code is correct and do I have do use another code to get the DDD coefficient?
Best regards,
Ali
0 Response to Triple-Difference (DDD) Estimation and coefficients
Post a Comment