Dear Statalist community,
I'm using the difference-in-difference technique to investigate the impact of a law reform (effective as of October 2012) intended to lower entry barriers for setting up a new business.
The treatment group consists of Dutch firms, whereas the control group are Belgian firms. Both the pre-treatment and post-period are precisely 12 months. My data is repeated cross-sections as it consists of the daily number of new firms. I use the nbreg command because my data is heavily dispersed count data.
IndustryOutput is a production index that controls for economic conditions.
My current analysis appears to show that the law change has had a positive effect on the number of new firms and now I am doing robustness checks.
Now, similar to Branstetter et al. (2014), I wish to estimate the monthly values of the coefficient of interest (PostXTreated) in the pre-treatment period to show that there hasn't been an existing trend leading up to the introduction of the law change. Please find below the graph used in that paper as a visual representation, note that this graph includes both leads and lags.

My question: How do I code this in Stata?
Do I use monthly time dummies for each month in the pre-treatment period and interact those with the dummy Treated (which indicates the treated group)? If so, shouldn't I omit one month dummy which would serve as a reference and to avoid perfect collinearity?
Thank you for your time.
Leon
A sample of my data is attached here:
I'm using the difference-in-difference technique to investigate the impact of a law reform (effective as of October 2012) intended to lower entry barriers for setting up a new business.
The treatment group consists of Dutch firms, whereas the control group are Belgian firms. Both the pre-treatment and post-period are precisely 12 months. My data is repeated cross-sections as it consists of the daily number of new firms. I use the nbreg command because my data is heavily dispersed count data.
Code:
drop pick gen PostreformXTreated = Postreform*Treated gen month_date = month(Date) nbreg Nfirms Postreform Treated PostreformXTreated IndustryOutput i.month_date, irr
My current analysis appears to show that the law change has had a positive effect on the number of new firms and now I am doing robustness checks.
Now, similar to Branstetter et al. (2014), I wish to estimate the monthly values of the coefficient of interest (PostXTreated) in the pre-treatment period to show that there hasn't been an existing trend leading up to the introduction of the law change. Please find below the graph used in that paper as a visual representation, note that this graph includes both leads and lags.
My question: How do I code this in Stata?
Do I use monthly time dummies for each month in the pre-treatment period and interact those with the dummy Treated (which indicates the treated group)? If so, shouldn't I omit one month dummy which would serve as a reference and to avoid perfect collinearity?
Thank you for your time.
Leon
A sample of my data is attached here:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int(Date Nfirms) double IndustryOutput byte(Treated Postreform pick) 18904 26 97.9 1 0 1 18911 18 97.9 1 0 1 18914 23 97.9 1 0 1 18915 6 97.9 1 0 1 18917 13 97.9 1 0 1 18921 26 97.9 1 0 1 18925 31 97.9 1 0 1 18932 70 98.1 1 0 1 18935 21 98.1 1 0 1 18938 27 98.1 1 0 1 18946 28 98.1 1 0 1 18949 34 98.1 1 0 1 18952 22 98.1 1 0 1 18954 32 98.1 1 0 1 18956 31 98.1 1 0 1 18973 18 100.2 1 0 1 18974 22 100.2 1 0 1 18976 24 100.2 1 0 1 18980 25 100.2 1 0 1 18981 24 100.2 1 0 1 18996 56 99.9 1 0 1 18997 59 99.9 1 0 1 19001 71 99.9 1 0 1 19010 68 99.9 1 0 1 19013 1 99.9 1 0 1 19015 63 99.9 1 0 1 19019 61 99.9 1 0 1 19022 71 99.9 1 0 1 19023 63 99.9 1 0 1 19024 132 97.7 1 0 1 19027 1 97.7 1 0 1 19028 1 97.7 1 0 1 19031 51 97.7 1 0 1 19035 1 97.7 1 0 1 19038 55 97.7 1 0 1 19043 50 97.7 1 0 1 19045 69 97.7 1 0 1 19046 53 97.7 1 0 1 19048 1 97.7 1 0 1 19051 58 97.7 1 0 1 19052 62 97.7 1 0 1 19061 46 102 1 0 1 19067 56 102 1 0 1 19076 0 102 1 0 1 19093 43 98.3 1 0 1 19102 53 98.3 1 0 1 19108 54 98.3 1 0 1 19110 71 98.3 1 0 1 19113 0 98.3 1 0 1 19117 36 98.1 1 0 1 19120 44 98.1 1 0 1 19121 42 98.1 1 0 1 19128 68 98.1 1 0 1 19129 72 98.1 1 0 1 19134 58 98.1 1 0 1 19135 60 98.1 1 0 1 19137 66 98.1 1 0 1 19139 4 98.1 1 0 1 19149 39 98.7 1 0 1 19157 45 98.7 1 0 1 19159 63 98.7 1 0 1 19164 32 98.7 1 0 1 19167 2 98.7 1 0 1 19168 1 98.7 1 0 1 19170 52 98.7 1 0 1 19179 56 97 1 0 1 19181 4 97 1 0 1 19185 44 97 1 0 1 19186 46 97 1 0 1 19193 45 97 1 0 1 19194 46 97 1 0 1 19197 22 97 1 0 1 19198 43 97 1 0 1 19199 22 97 1 0 1 19202 1 97 1 0 1 19205 44 97 1 0 1 19208 26 98.8 1 0 1 19214 38 98.8 1 0 1 19218 23 98.8 1 0 1 19219 55 98.8 1 0 1 19220 31 98.8 1 0 1 19222 30 98.8 1 0 1 19225 29 98.8 1 0 1 19229 32 98.8 1 0 1 19230 1 98.8 1 0 1 19232 36 98.8 1 0 1 19237 50 97.6 1 0 1 19240 29 97.6 1 0 1 19243 27 97.6 1 0 1 19244 2 97.6 1 0 1 19245 1 97.6 1 0 1 19249 28 97.6 1 0 1 19251 11 97.6 1 0 1 19253 28 97.6 1 0 1 19261 32 97.6 1 0 1 19270 62 96.4 1 1 1 19272 1 96.4 1 1 1 19276 52 96.4 1 1 1 19281 47 96.4 1 1 1 19283 55 96.4 1 1 1 19285 59 96.4 1 1 1 19289 36 96.4 1 1 1 19297 38 96.4 1 1 1 19299 54 98.4 1 1 1 19302 55 98.4 1 1 1 19305 56 98.4 1 1 1 19307 3 98.4 1 1 1 19314 5 98.4 1 1 1 19317 42 98.4 1 1 1 19320 43 98.4 1 1 1 19321 2 98.4 1 1 1 19325 48 98.4 1 1 1 19326 64 98.4 1 1 1 19328 14 99.4 1 1 1 19332 36 99.4 1 1 1 19340 34 99.4 1 1 1 19351 15 99.4 1 1 1 19356 15 99.4 1 1 1 19360 137 96.6 1 1 1 19362 96 96.6 1 1 1 19367 87 96.6 1 1 1 19371 1 96.6 1 1 1 19373 60 96.6 1 1 1 19379 65 96.6 1 1 1 19381 82 96.6 1 1 1 19382 80 96.6 1 1 1 19388 75 96.6 1 1 1 19389 79 96.6 1 1 1 19393 58 96.1 1 1 1 19401 64 96.1 1 1 1 19408 73 96.1 1 1 1 19409 60 96.1 1 1 1 19410 76 96.1 1 1 1 19411 79 96.1 1 1 1 19412 1 96.1 1 1 1 19418 131 96.9 1 1 1 19419 0 96.9 1 1 1 19420 1 96.9 1 1 1 19421 83 96.9 1 1 1 19422 66 96.9 1 1 1 19423 60 96.9 1 1 1 19424 66 96.9 1 1 1 19428 64 96.9 1 1 1 19430 62 96.9 1 1 1 19432 86 96.9 1 1 1 19438 81 96.9 1 1 1 19456 51 97 1 1 1 19459 74 97 1 1 1 19460 226 97 1 1 1 19466 71 97 1 1 1 19467 83 97 1 1 1 19470 64 97 1 1 1 19471 62 97 1 1 1 19472 60 97 1 1 1 19474 102 97 1 1 1 19478 1 97 1 1 1 19481 66 96.2 1 1 1 19484 50 96.2 1 1 1 19485 41 96.2 1 1 1 19486 56 96.2 1 1 1 19487 1 96.2 1 1 1 19495 70 96.2 1 1 1 19498 1 96.2 1 1 1 19506 77 96.2 1 1 1 19507 75 96.2 1 1 1 19510 32 97.4 1 1 1 19513 67 97.4 1 1 1 19515 73 97.4 1 1 1 19516 64 97.4 1 1 1 19517 3 97.4 1 1 1 19519 53 97.4 1 1 1 19522 71 97.4 1 1 1 19530 74 97.4 1 1 1 19533 77 97.4 1 1 1 19535 112 97.4 1 1 1 19544 62 96.6 1 1 1 19548 57 96.6 1 1 1 19555 50 96.6 1 1 1 19557 73 96.6 1 1 1 19558 60 96.6 1 1 1 19565 48 96.6 1 1 1 19566 3 96.6 1 1 1 19568 29 96.6 1 1 1 19569 34 96.6 1 1 1 19572 41 97.2 1 1 1 19576 35 97.2 1 1 1 19578 32 97.2 1 1 1 19584 38 97.2 1 1 1 19592 49 97.2 1 1 1 19598 43 97.2 1 1 1 19600 61 97.2 1 1 1 19602 13 97.5 1 1 1 19603 43 97.5 1 1 1 19611 41 97.5 1 1 1 19614 39 97.5 1 1 1 19616 1 97.5 1 1 1 19618 49 97.5 1 1 1 19620 53 97.5 1 1 1 19621 49 97.5 1 1 1 18903 2 96.7 0 0 1 18904 0 96.7 0 0 1 18905 2 96.7 0 0 1 18906 1 96.7 0 0 1 18908 0 96.7 0 0 1 18913 0 96.7 0 0 1 18914 1 96.7 0 0 1 18917 0 96.7 0 0 1 18928 1 96.7 0 0 1 18931 0 96.7 0 0 1 18935 0 96.7 0 0 1 18940 1 96.7 0 0 1 18941 1 96.7 0 0 1 18947 0 96.7 0 0 1 18948 0 96.7 0 0 1 18952 1 96.7 0 0 1 18956 2 96.7 0 0 1 18959 1 96.7 0 0 1 18966 0 96.8 0 0 1 18977 0 96.8 0 0 1 18982 0 96.8 0 0 1 18984 0 96.8 0 0 1 18991 0 96.8 0 0 1 18992 0 96.8 0 0 1 18993 1 97.6 0 0 1 18996 41 97.6 0 0 1 18997 47 97.6 0 0 1 19002 49 97.6 0 0 1 19006 0 97.6 0 0 1 19012 38 97.6 0 0 1 19017 42 97.6 0 0 1 19018 50 97.6 0 0 1 19023 35 97.6 0 0 1 19024 48 99.8 0 0 1 19025 41 99.8 0 0 1 19027 1 99.8 0 0 1 19032 18 99.8 0 0 1 19033 39 99.8 0 0 1 19036 31 99.8 0 0 1 19038 41 99.8 0 0 1 19039 39 99.8 0 0 1 19040 45 99.8 0 0 1 19047 24 99.8 0 0 1 19051 39 99.8 0 0 1 19054 30 102.4 0 0 1 19055 2 102.4 0 0 1 19058 31 102.4 0 0 1 19059 32 102.4 0 0 1 19060 25 102.4 0 0 1 19066 39 102.4 0 0 1 19067 29 102.4 0 0 1 19069 1 102.4 0 0 1 19072 30 102.4 0 0 1 19074 26 102.4 0 0 1 19078 12 102.4 0 0 1 19080 41 102.4 0 0 1 19086 29 95.7 0 0 1 19095 28 95.7 0 0 1 19100 18 95.7 0 0 1 19102 19 95.7 0 0 1 19103 16 95.7 0 0 1 19105 0 95.7 0 0 1 19106 15 95.7 0 0 1 19107 12 95.7 0 0 1 19108 18 95.7 0 0 1 19109 15 95.7 0 0 1 19117 12 97.9 0 0 1 19118 1 97.9 0 0 1 19121 23 97.9 0 0 1 19138 14 97.9 0 0 1 19139 0 97.9 0 0 1 19141 0 97.9 0 0 1 19150 8 98.2 0 0 1 19153 1 98.2 0 0 1 19155 8 98.2 0 0 1 19156 9 98.2 0 0 1 19157 6 98.2 0 0 1 19162 17 98.2 0 0 1 19163 8 98.2 0 0 1 19165 5 98.2 0 0 1 19172 9 98.2 0 0 1 19175 0 97.8 0 0 1 19179 6 97.8 0 0 1 19180 2 97.8 0 0 1 19181 0 97.8 0 0 1 19183 1 97.8 0 0 1 19192 4 97.8 0 0 1 19193 6 97.8 0 0 1 19201 3 97.8 0 0 1 19205 3 97.8 0 0 1 19207 3 99.7 0 0 1 19212 3 99.7 0 0 1 19227 1 99.7 0 0 1 19230 0 99.7 0 0 1 19232 1 99.7 0 0 1 19233 3 99.7 0 0 1 19235 2 99.7 0 0 1 19242 2 99.7 0 0 1 19245 0 99.7 0 0 1 19246 1 99.7 0 0 1 19247 3 99.7 0 0 1 19249 0 99.7 0 0 1 19253 4 99.7 0 0 1 19260 1 99.7 0 0 1 19261 2 99.7 0 0 1 19263 1 99.7 0 0 1 19264 0 99.7 0 0 1 19269 0 96.3 0 1 1 19270 1 96.3 0 1 1 19271 0 96.3 0 1 1 19277 1 96.3 0 1 1 19284 0 96.3 0 1 1 19289 1 96.3 0 1 1 19290 1 96.3 0 1 1 19292 2 96.3 0 1 1 19295 0 96.3 0 1 1 19297 2 96.3 0 1 1 19298 0 95.1 0 1 1 19303 0 95.1 0 1 1 19304 0 95.1 0 1 1 19309 0 95.1 0 1 1 19310 0 95.1 0 1 1 19316 0 95.1 0 1 1 19317 0 95.1 0 1 1 19321 0 95.1 0 1 1 19323 0 95.1 0 1 1 19332 0 96.3 0 1 1 19335 0 96.3 0 1 1 19338 1 96.3 0 1 1 19339 0 96.3 0 1 1 19345 0 96.3 0 1 1 19351 0 96.3 0 1 1 19357 0 96.3 0 1 1 19360 32 95.1 0 1 1 19361 50 95.1 0 1 1 19362 37 95.1 0 1 1 19366 35 95.1 0 1 1 19368 50 95.1 0 1 1 19370 2 95.1 0 1 1 19371 1 95.1 0 1 1 19374 48 95.1 0 1 1 19382 44 95.1 0 1 1 19393 36 93.9 0 1 1 19395 48 93.9 0 1 1 19400 20 93.9 0 1 1 19404 12 93.9 0 1 1 19407 32 93.9 0 1 1 19410 46 93.9 0 1 1 19411 32 93.9 0 1 1 19416 38 93.9 0 1 1 19419 1 96.5 0 1 1 19421 22 96.5 0 1 1 19425 35 96.5 0 1 1 19426 0 96.5 0 1 1 19433 1 96.5 0 1 1 19438 21 96.5 0 1 1 19441 0 96.5 0 1 1 19445 38 96.5 0 1 1 19452 26 97.4 0 1 1 19459 15 97.4 0 1 1 19467 20 97.4 0 1 1 19468 1 97.4 0 1 1 19472 14 97.4 0 1 1 19477 22 97.4 0 1 1 19482 0 99.3 0 1 1 19491 13 99.3 0 1 1 19492 10 99.3 0 1 1 19500 10 99.3 0 1 1 19501 15 99.3 0 1 1 19509 8 99.3 0 1 1 19513 3 98.3 0 1 1 19523 4 98.3 0 1 1 19529 1 98.3 0 1 1 19532 0 98.3 0 1 1 19534 8 98.3 0 1 1 19541 4 99.4 0 1 1 19545 0 99.4 0 1 1 19548 6 99.4 0 1 1 19549 2 99.4 0 1 1 19550 2 99.4 0 1 1 19551 7 99.4 0 1 1 19553 1 99.4 0 1 1 19555 5 99.4 0 1 1 19556 3 99.4 0 1 1 19558 1 99.4 0 1 1 19565 2 99.4 0 1 1 19566 0 99.4 0 1 1 19572 0 97.5 0 1 1 19575 4 97.5 0 1 1 19576 4 97.5 0 1 1 19580 0 97.5 0 1 1 19582 1 97.5 0 1 1 19586 0 97.5 0 1 1 19591 1 97.5 0 1 1 19593 1 97.5 0 1 1 19602 0 96.4 0 1 1 19606 1 96.4 0 1 1 19611 5 96.4 0 1 1 19613 3 96.4 0 1 1 19614 0 96.4 0 1 1 19618 0 96.4 0 1 1 end format %td Date
Comment