Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • DiD command in stata

    Hi, I have panel data and trying to run a DiD regression using the statistics command in stata. I have done it but an error message keeps appearing. This is the message:
    Click image for larger version

Name:	3.png
Views:	1
Size:	3.4 KB
ID:	1663865

    Is this due to the potential dummy variable trap? Because I have dates for 1 month. Then the firm is either treated throughout the 30 days or not.
    Currently, I am inputting:

    xtdidregress (happy) (treat), group(firm) time(date) vce(robust)

  • #2
    DiD requires data from before and after treatment

    Comment


    • #3
      i see thank you. I have a balanced in which the firms are either treated or not in the 30 days. I know I can still run a regression for DiD but would would it be then?

      Comment


      • #4
        if you have data from before and after treatment, make sure the treatment variable is 1 only for treated firms after treatment

        Comment


        • #5
          Yes, that is what I have.
          I ran the following regression:
          xtreg happy i.date##i.treat, fe robust
          margins date, dydx(treat) noestimcheck
          I got the following output:

          . xtreg movement_ch i.date##i.treat, fe vce(cluster firm)
          note: 1.treat omitted because of collinearity.

          Fixed-effects (within) regression Number of obs = 64,128
          Group variable: firm Number of groups = 668

          R-squared: Obs per group:
          Within = 0.5659 min = 96
          Between = 0.0003 avg = 96.0
          Overall = 0.4313 max = 96

          F(190,667) = 619.17
          corr(u_i, Xb) = -0.0091 Prob > F = 0.0000

          (Std. err. adjusted for 668 clusters in firm)
          ------------------------------------------------------------------------------
          | Robust
          movement_ch | Coefficient std. err. t P>|t| [95% conf. interval]
          -------------+----------------------------------------------------------------
          date |
          22190 | -.0117339 .0036363 -3.23 0.001 -.0188739 -.0045938
          22191 | .0061952 .0048685 1.27 0.204 -.0033642 .0157547
          22192 | -.0075834 .0054592 -1.39 0.165 -.0183027 .003136
          22193 | -.0246947 .0043844 -5.63 0.000 -.0333037 -.0160857
          22194 | -.0254833 .0041861 -6.09 0.000 -.0337028 -.0172638
          22195 | -.0339461 .0038213 -8.88 0.000 -.0414493 -.0264428
          22196 | -.0187918 .0031872 -5.90 0.000 -.0250498 -.0125337
          22197 | -.0308207 .0039396 -7.82 0.000 -.0385562 -.0230851
          22198 | -.0226277 .0058717 -3.85 0.000 -.034157 -.0110984
          22199 | -.0224438 .0058888 -3.81 0.000 -.0340066 -.010881
          22200 | -.0686675 .0048555 -14.14 0.000 -.0782015 -.0591336
          22201 | -.0387865 .0043222 -8.97 0.000 -.0472731 -.0302998
          22202 | -.0319462 .0038592 -8.28 0.000 -.0395238 -.0243687
          22203 | -.019572 .0033171 -5.90 0.000 -.0260853 -.0130587
          22204 | -.0458368 .0040686 -11.27 0.000 -.0538257 -.037848
          22205 | -.0118971 .0052492 -2.27 0.024 -.022204 -.0015902
          22206 | -.0092345 .0054684 -1.69 0.092 -.0199719 .0015029
          22207 | -.0519531 .004755 -10.93 0.000 -.0612896 -.0426165
          22208 | -.0558492 .0043931 -12.71 0.000 -.0644753 -.0472231
          22209 | -.0545306 .0038288 -14.24 0.000 -.0620485 -.0470128
          22210 | -.038902 .003583 -10.86 0.000 -.0459372 -.0318667
          22211 | -.0578857 .0038195 -15.16 0.000 -.0653854 -.0503859
          22212 | -.0378233 .0052664 -7.18 0.000 -.048164 -.0274825
          22213 | -.0556134 .0052973 -10.50 0.000 -.0660147 -.0452121
          22214 | -.0705166 .0046715 -15.09 0.000 -.0796893 -.061344
          22215 | -.0756699 .0051615 -14.66 0.000 -.0858047 -.0655351
          22216 | -.0735554 .0044029 -16.71 0.000 -.0822007 -.0649101
          22217 | -.0775573 .0037962 -20.43 0.000 -.0850112 -.0701033
          22218 | -.0386952 .003858 -10.03 0.000 -.0462706 -.0311199
          22219 | -.0120354 .0045457 -2.65 0.008 -.0209609 -.0031098
          22220 | -.0376253 .0052698 -7.14 0.000 -.0479726 -.027278
          22221 | -.0546584 .0046533 -11.75 0.000 -.0637953 -.0455215
          22222 | -.0119833 .004516 -2.65 0.008 -.0208505 -.003116
          22223 | -.0603627 .0039999 -15.09 0.000 -.0682167 -.0525087
          22224 | -.0473259 .0031872 -14.85 0.000 -.053584 -.0410678
          22225 | -.0622291 .0039075 -15.93 0.000 -.0699015 -.0545567
          22226 | -.047348 .004546 -10.42 0.000 -.0562742 -.0384217
          22227 | -.0461815 .0050803 -9.09 0.000 -.0561569 -.0362061
          22228 | -.0645733 .0049721 -12.99 0.000 -.0743362 -.0548104
          22229 | -.0635766 .0047364 -13.42 0.000 -.0728765 -.0542766
          22230 | -.1086741 .0045589 -23.84 0.000 -.1176256 -.0997226
          22231 | -.1020283 .0039647 -25.73 0.000 -.1098131 -.0942435
          22232 | -.084939 .0040942 -20.75 0.000 -.0929781 -.0768999
          22233 | -.0980612 .0054813 -17.89 0.000 -.1088239 -.0872985
          22234 | -.10577 .0060594 -17.46 0.000 -.1176678 -.0938723
          22235 | -.0776466 .0047393 -16.38 0.000 -.0869524 -.0683408
          22236 | -.0714797 .0048872 -14.63 0.000 -.0810759 -.0618835
          22237 | -.084377 .0043147 -19.56 0.000 -.0928491 -.0759049
          22238 | -.0651048 .0037058 -17.57 0.000 -.0723812 -.0578284
          22239 | -.0794405 .0043188 -18.39 0.000 -.0879206 -.0709604
          22240 | -.0892378 .0057397 -15.55 0.000 -.1005079 -.0779677
          22241 | -.1147094 .0059885 -19.15 0.000 -.1264681 -.1029507
          22242 | -.070078 .0053572 -13.08 0.000 -.0805971 -.059559
          22243 | -.0597455 .0053587 -11.15 0.000 -.0702675 -.0492236
          22244 | -.0316702 .004837 -6.55 0.000 -.0411679 -.0221726
          22245 | -.364146 .0048262 -75.45 0.000 -.3736224 -.3546696
          22246 | -.2139293 .0046396 -46.11 0.000 -.2230393 -.2048193
          22247 | -.1434266 .0054904 -26.12 0.000 -.1542072 -.132646
          22248 | -.0974948 .0060987 -15.99 0.000 -.1094699 -.0855198
          22249 | -.1049967 .0051781 -20.28 0.000 -.115164 -.0948293
          22250 | -.0660503 .0058076 -11.37 0.000 -.0774537 -.0546469
          22251 | -.0901983 .0041591 -21.69 0.000 -.0983647 -.0820319
          22252 | -.0576052 .0040886 -14.09 0.000 -.0656334 -.0495771
          22253 | -.0878984 .0040813 -21.54 0.000 -.0959121 -.0798846
          22254 | -.0934529 .0053136 -17.59 0.000 -.1038862 -.0830195
          22255 | -.1115524 .00604 -18.47 0.000 -.1234122 -.0996927
          22256 | -.0947357 .0047825 -19.81 0.000 -.1041262 -.0853452
          22257 | -.0852183 .0047106 -18.09 0.000 -.0944678 -.0759688
          22258 | -.0856866 .0043742 -19.59 0.000 -.0942755 -.0770976
          22259 | -.0686329 .0035578 -19.29 0.000 -.0756188 -.0616471
          22260 | -.091803 .0044439 -20.66 0.000 -.1005288 -.0830773
          22261 | -.0848228 .0053538 -15.84 0.000 -.0953352 -.0743104
          22262 | -.1058546 .0064841 -16.33 0.000 -.1185862 -.0931229
          22263 | -.1093315 .0056155 -19.47 0.000 -.1203578 -.0983053
          22264 | -.0706573 .0050862 -13.89 0.000 -.0806441 -.0606704
          22265 | -.1316232 .0060743 -21.67 0.000 -.1435502 -.1196962
          22266 | -.0895425 .0052969 -16.90 0.000 -.0999431 -.0791419
          22267 | -.0763088 .0044973 -16.97 0.000 -.0851394 -.0674783
          22268 | -.0522904 .0049384 -10.59 0.000 -.061987 -.0425938
          22269 | -.0722278 .0053503 -13.50 0.000 -.0827333 -.0617223
          22270 | -.0389771 .0052212 -7.47 0.000 -.049229 -.0287251
          22271 | -.0230712 .0045737 -5.04 0.000 -.0320518 -.0140906
          22272 | -.0010417 .0050472 -0.21 0.837 -.010952 .0088685
          22273 | -.1285618 .0043548 -29.52 0.000 -.1371125 -.1200111
          22274 | -.481358 .0048315 -99.63 0.000 -.4908447 -.4718712
          22275 | -.2047548 .0053326 -38.40 0.000 -.2152254 -.1942841
          22276 | -.1378026 .0053101 -25.95 0.000 -.1482291 -.127376
          22277 | -.1084895 .0051853 -20.92 0.000 -.1186711 -.098308
          22278 | -.1135309 .0050113 -22.65 0.000 -.1233707 -.1036911
          22279 | -.1227531 .0051642 -23.77 0.000 -.1328932 -.112613
          22280 | -.0820567 .0042048 -19.51 0.000 -.090313 -.0738004
          22281 | -.3877996 .0059284 -65.41 0.000 -.3994403 -.376159
          22282 | -.1751182 .0068653 -25.51 0.000 -.1885985 -.1616379
          22283 | -.1382504 .0057396 -24.09 0.000 -.1495203 -.1269805
          22284 | -.0712775 .0048138 -14.81 0.000 -.0807295 -.0618256
          |
          1.treat | 0 (omitted)
          |
          date#treat |
          22190 1 | -.0103737 .0049077 -2.11 0.035 -.0200101 -.0007373
          22191 1 | -.0101262 .0063709 -1.59 0.112 -.0226357 .0023833
          22192 1 | -.0044279 .0074543 -0.59 0.553 -.0190646 .0102088
          22193 1 | -.0121281 .0065307 -1.86 0.064 -.0249513 .0006951
          22194 1 | -.0087692 .0058952 -1.49 0.137 -.0203447 .0028062
          22195 1 | -.0163783 .0054397 -3.01 0.003 -.0270593 -.0056974
          22196 1 | -.0029138 .0044857 -0.65 0.516 -.0117215 .0058939
          22197 1 | -.0130168 .0053979 -2.41 0.016 -.0236157 -.0024179
          22198 1 | -.0137071 .0077322 -1.77 0.077 -.0288896 .0014753
          22199 1 | -.0107476 .0087325 -1.23 0.219 -.0278941 .006399
          22200 1 | -.0148477 .0070438 -2.11 0.035 -.0286784 -.001017
          22201 1 | -.0133479 .0061587 -2.17 0.031 -.0254408 -.0012551
          22202 1 | -.0172506 .0058342 -2.96 0.003 -.0287062 -.005795
          22203 1 | -.0027392 .004681 -0.59 0.559 -.0119306 .0064521
          22204 1 | -.0122303 .0053842 -2.27 0.023 -.0228024 -.0016582
          22205 1 | -.013572 .0071838 -1.89 0.059 -.0276777 .0005336
          22206 1 | -.0063438 .0076328 -0.83 0.406 -.0213311 .0086434
          22207 1 | -.0138562 .0067661 -2.05 0.041 -.0271417 -.0005707
          22208 1 | -.0099377 .006598 -1.51 0.132 -.022893 .0030176
          22209 1 | -.0127609 .0056425 -2.26 0.024 -.0238401 -.0016818
          22210 1 | -.0051835 .0053016 -0.98 0.329 -.0155933 .0052264
          22211 1 | -.0206262 .0054864 -3.76 0.000 -.0313989 -.0098535
          22212 1 | -.0104425 .0071414 -1.46 0.144 -.0244648 .0035799
          22213 1 | -.0152608 .0078666 -1.94 0.053 -.030707 .0001854
          22214 1 | -.0218191 .0071155 -3.07 0.002 -.0357905 -.0078477
          22215 1 | -.0185402 .0078314 -2.37 0.018 -.0339173 -.0031631
          22216 1 | -.0175623 .0065492 -2.68 0.008 -.0304217 -.0047028
          22217 1 | -.0146424 .0051181 -2.86 0.004 -.024692 -.0045927
          22218 1 | -.0160528 .0053781 -2.98 0.003 -.0266129 -.0054927
          22219 1 | -.0113074 .0063345 -1.79 0.075 -.0237455 .0011306
          22220 1 | -.0121444 .0076517 -1.59 0.113 -.0271687 .0028798
          22221 1 | -.015694 .0068201 -2.30 0.022 -.0290855 -.0023025
          22222 1 | -.0114927 .0063873 -1.80 0.072 -.0240344 .001049
          22223 1 | -.0173198 .0056385 -3.07 0.002 -.0283911 -.0062485
          22224 1 | -.0025581 .0045688 -0.56 0.576 -.011529 .0064129
          22225 1 | -.0137782 .0053594 -2.57 0.010 -.0243016 -.0032549
          22226 1 | -.009298 .0062419 -1.49 0.137 -.0215541 .0029581
          22227 1 | -.0074904 .0070061 -1.07 0.285 -.0212469 .0062662
          22228 1 | -.0132087 .0071908 -1.84 0.067 -.0273281 .0009106
          22229 1 | -.0104683 .006703 -1.56 0.119 -.0236298 .0026933
          22230 1 | -.0177245 .0064879 -2.73 0.006 -.0304636 -.0049854
          22231 1 | -.0008606 .0054653 -0.16 0.875 -.0115919 .0098707
          22232 1 | -.0126195 .0057273 -2.20 0.028 -.0238652 -.0013738
          22233 1 | -.0045465 .0074669 -0.61 0.543 -.0192081 .010115
          22234 1 | -.0139692 .0084783 -1.65 0.100 -.0306165 .0026782
          22235 1 | -.0119234 .0069744 -1.71 0.088 -.0256179 .001771
          22236 1 | -.0102942 .0070353 -1.46 0.144 -.0241081 .0035198
          22237 1 | -.0088444 .0061503 -1.44 0.151 -.0209207 .0032319
          22238 1 | -.0056243 .0050648 -1.11 0.267 -.0155692 .0043206
          22239 1 | -.008949 .00608 -1.47 0.142 -.0208872 .0029892
          22240 1 | -.0000589 .0078617 -0.01 0.994 -.0154956 .0153778
          22241 1 | -.0069736 .0087554 -0.80 0.426 -.0241652 .0102179
          22242 1 | -.0192946 .0077663 -2.48 0.013 -.034544 -.0040452
          22243 1 | -.0134066 .0076373 -1.76 0.080 -.0284027 .0015895
          22244 1 | -.0175341 .0069132 -2.54 0.011 -.0311084 -.0039599
          22245 1 | -.0040729 .0067131 -0.61 0.544 -.0172542 .0091083
          22246 1 | -.0092793 .0063108 -1.47 0.142 -.0216707 .0031121
          22247 1 | -.0104058 .0074624 -1.39 0.164 -.0250584 .0042468
          22248 1 | -.0135413 .0085469 -1.58 0.114 -.0303234 .0032408
          22249 1 | -.0129602 .0072651 -1.78 0.075 -.0272255 .0013051
          22250 1 | -.0209287 .0079362 -2.64 0.009 -.0365117 -.0053457
          22251 1 | -.0196172 .0060601 -3.24 0.001 -.0315165 -.007718
          22252 1 | -.0113494 .005546 -2.05 0.041 -.0222391 -.0004596
          22253 1 | -.0179151 .0057024 -3.14 0.002 -.029112 -.0067182
          22254 1 | -.0086215 .0074029 -1.16 0.245 -.0231572 .0059143
          22255 1 | -.0014953 .008377 -0.18 0.858 -.0179439 .0149532
          22256 1 | -.0115046 .0072514 -1.59 0.113 -.025743 .0027338
          22257 1 | -.0070427 .0070161 -1.00 0.316 -.0208191 .0067337
          22258 1 | -.012663 .0062203 -2.04 0.042 -.0248766 -.0004493
          22259 1 | -.0002986 .0050216 -0.06 0.953 -.0101588 .0095615
          22260 1 | -.0121874 .006034 -2.02 0.044 -.0240353 -.0003395
          22261 1 | -.003374 .0074019 -0.46 0.649 -.0179078 .0111599
          22262 1 | -.0184383 .00887 -2.08 0.038 -.0358547 -.0010219
          22263 1 | -.0148609 .0080017 -1.86 0.064 -.0305724 .0008506
          22264 1 | -.0121513 .0074266 -1.64 0.102 -.0267336 .0024309
          22265 1 | -.0266981 .0090346 -2.96 0.003 -.0444377 -.0089584
          22266 1 | -.0119126 .0078075 -1.53 0.128 -.0272427 .0034176
          22267 1 | -.0121467 .0059913 -2.03 0.043 -.0239109 -.0003826
          22268 1 | -.0047228 .0067649 -0.70 0.485 -.0180059 .0085604
          22269 1 | -.0020996 .0077531 -0.27 0.787 -.0173231 .0131239
          22270 1 | -.0049637 .0074523 -0.67 0.506 -.0195964 .0096691
          22271 1 | -.006379 .0068374 -0.93 0.351 -.0198044 .0070464
          22272 1 | -.0139923 .0075882 -1.84 0.066 -.0288919 .0009074
          22273 1 | -.0013843 .0062288 -0.22 0.824 -.0136147 .0108461
          22274 1 | -.0063288 .0068417 -0.93 0.355 -.0197626 .007105
          22275 1 | -.0108742 .0071681 -1.52 0.130 -.024949 .0032006
          22276 1 | -.007296 .0074072 -0.98 0.325 -.0218403 .0072483
          22277 1 | -.0116437 .0075577 -1.54 0.124 -.0264836 .0031961
          22278 1 | -.0102686 .0072544 -1.42 0.157 -.0245128 .0039756
          22279 1 | -.0111294 .0071788 -1.55 0.122 -.0252251 .0029663
          22280 1 | -.0034829 .0060894 -0.57 0.568 -.0154396 .0084737
          22281 1 | -.0191858 .0083582 -2.30 0.022 -.0355973 -.0027742
          22282 1 | -.0058934 .0090505 -0.65 0.515 -.0236644 .0118775
          22283 1 | -.0121037 .0079886 -1.52 0.130 -.0277896 .0035822
          22284 1 | -.0119443 .0067849 -1.76 0.079 -.0252665 .001378
          |
          _cons | .0041367 .0023565 1.76 0.080 -.0004904 .0087637
          -------------+----------------------------------------------------------------
          sigma_u | .05373217
          sigma_e | .0643553
          rho | .41076238 (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          Just wanted to add its for 96 days

          Comment


          • #6
            Can you show the result of

            Code:
            format date %td
            tab date treat
            ?

            Comment


            • #7
              also, if you're using xtreg it should be,
              Code:
              xtset firm
              xtreg movement_ch treat i.date, fe vce(cluster firm)

              Comment


              • #8
                This is list:
                | treat
                date | 0 1 | Total
                -----------+----------------------+----------
                01oct2020 | 328 340 | 668
                02oct2020 | 328 340 | 668
                03oct2020 | 328 340 | 668
                04oct2020 | 328 340 | 668
                05oct2020 | 328 340 | 668
                06oct2020 | 328 340 | 668
                07oct2020 | 328 340 | 668
                08oct2020 | 328 340 | 668
                09oct2020 | 328 340 | 668
                10oct2020 | 328 340 | 668
                11oct2020 | 328 340 | 668
                12oct2020 | 328 340 | 668
                13oct2020 | 328 340 | 668
                14oct2020 | 328 340 | 668
                15oct2020 | 328 340 | 668
                16oct2020 | 328 340 | 668
                17oct2020 | 328 340 | 668
                18oct2020 | 328 340 | 668
                19oct2020 | 328 340 | 668
                20oct2020 | 328 340 | 668
                21oct2020 | 328 340 | 668
                22oct2020 | 328 340 | 668
                23oct2020 | 328 340 | 668
                24oct2020 | 328 340 | 668
                25oct2020 | 328 340 | 668
                26oct2020 | 328 340 | 668
                27oct2020 | 328 340 | 668
                28oct2020 | 328 340 | 668
                29oct2020 | 328 340 | 668
                30oct2020 | 328 340 | 668
                31oct2020 | 328 340 | 668
                01nov2020 | 328 340 | 668
                02nov2020 | 328 340 | 668
                03nov2020 | 328 340 | 668
                04nov2020 | 328 340 | 668
                05nov2020 | 328 340 | 668
                06nov2020 | 328 340 | 668
                07nov2020 | 328 340 | 668
                08nov2020 | 328 340 | 668
                09nov2020 | 328 340 | 668
                10nov2020 | 328 340 | 668
                11nov2020 | 328 340 | 668
                12nov2020 | 328 340 | 668
                13nov2020 | 328 340 | 668
                14nov2020 | 328 340 | 668
                15nov2020 | 328 340 | 668
                16nov2020 | 328 340 | 668
                17nov2020 | 328 340 | 668
                18nov2020 | 328 340 | 668
                19nov2020 | 328 340 | 668
                20nov2020 | 328 340 | 668
                21nov2020 | 328 340 | 668
                22nov2020 | 328 340 | 668
                23nov2020 | 328 340 | 668
                24nov2020 | 328 340 | 668
                25nov2020 | 328 340 | 668
                26nov2020 | 328 340 | 668
                27nov2020 | 328 340 | 668
                28nov2020 | 328 340 | 668
                29nov2020 | 328 340 | 668
                30nov2020 | 328 340 | 668
                01dec2020 | 328 340 | 668
                02dec2020 | 328 340 | 668
                03dec2020 | 328 340 | 668
                04dec2020 | 328 340 | 668
                05dec2020 | 328 340 | 668
                06dec2020 | 328 340 | 668
                07dec2020 | 328 340 | 668
                08dec2020 | 328 340 | 668
                09dec2020 | 328 340 | 668
                10dec2020 | 328 340 | 668
                11dec2020 | 328 340 | 668
                12dec2020 | 328 340 | 668
                13dec2020 | 328 340 | 668
                14dec2020 | 328 340 | 668
                15dec2020 | 328 340 | 668
                16dec2020 | 328 340 | 668
                17dec2020 | 328 340 | 668
                18dec2020 | 328 340 | 668
                19dec2020 | 328 340 | 668
                20dec2020 | 328 340 | 668
                21dec2020 | 328 340 | 668
                22dec2020 | 328 340 | 668
                23dec2020 | 328 340 | 668
                24dec2020 | 328 340 | 668
                25dec2020 | 328 340 | 668
                26dec2020 | 328 340 | 668
                27dec2020 | 328 340 | 668
                28dec2020 | 328 340 | 668
                29dec2020 | 328 340 | 668
                30dec2020 | 328 340 | 668
                31dec2020 | 328 340 | 668
                01jan2021 | 328 340 | 668
                02jan2021 | 328 340 | 668
                03jan2021 | 328 340 | 668
                04jan2021 | 328 340 | 668
                -----------+----------------------+----------
                Total | 31,488 32,640 | 64,128

                Comment


                • #9
                  As for xtreg command. I ran it and got the following:

                  xtreg movement treat i.date, fe vce(cluster firm)
                  note: treat omitted because of collinearity.

                  Fixed-effects (within) regression Number of obs = 64,128
                  Group variable: firm Number of groups = 668

                  R-squared: Obs per group:
                  Within = 0.5651 min = 96
                  Between = . avg = 96.0
                  Overall = 0.4340 max = 96

                  F(95,667) = 955.35
                  corr(u_i, Xb) = -0.0000 Prob > F = 0.0000

                  (Std. err. adjusted for 668 clusters in firm)
                  ------------------------------------------------------------------------------
                  | Robust
                  movement_ch | Coefficient std. err. t P>|t| [95% conf. interval]
                  -------------+----------------------------------------------------------------
                  treat | 0 (omitted)
                  |
                  date |
                  22190 | -.0170139 .0024563 -6.93 0.000 -.021837 -.0121908
                  22191 | .0010412 .00318 0.33 0.743 -.0052029 .0072853
                  22192 | -.0098371 .0037211 -2.64 0.008 -.0171436 -.0025306
                  22193 | -.0308676 .0032776 -9.42 0.000 -.0373034 -.0244319
                  22194 | -.0299466 .0029504 -10.15 0.000 -.0357397 -.0241535
                  22195 | -.0422824 .0027374 -15.45 0.000 -.0476572 -.0369075
                  22196 | -.0202748 .0022418 -9.04 0.000 -.0246768 -.0158729
                  22197 | -.037446 .002706 -13.84 0.000 -.0427593 -.0321327
                  22198 | -.0296044 .0038623 -7.66 0.000 -.0371882 -.0220206
                  22199 | -.0279141 .0043758 -6.38 0.000 -.0365061 -.0193222
                  22200 | -.0762247 .0035347 -21.56 0.000 -.0831652 -.0692842
                  22201 | -.0455803 .0030892 -14.75 0.000 -.0516461 -.0395145
                  22202 | -.0407265 .002941 -13.85 0.000 -.0465012 -.0349518
                  22203 | -.0209662 .0023396 -8.96 0.000 -.02556 -.0163724
                  22204 | -.0520618 .0026941 -19.32 0.000 -.0573518 -.0467718
                  22205 | -.018805 .0035951 -5.23 0.000 -.0258641 -.011746
                  22206 | -.0124634 .0038144 -3.27 0.001 -.019953 -.0049738
                  22207 | -.0590057 .0033925 -17.39 0.000 -.0656669 -.0523444
                  22208 | -.0609073 .0033094 -18.40 0.000 -.0674054 -.0544093
                  22209 | -.0610257 .0028344 -21.53 0.000 -.0665911 -.0554603
                  22210 | -.0415403 .0026553 -15.64 0.000 -.046754 -.0363265
                  22211 | -.068384 .0027721 -24.67 0.000 -.073827 -.062941
                  22212 | -.0431383 .0035687 -12.09 0.000 -.0501456 -.036131
                  22213 | -.0633809 .0039486 -16.05 0.000 -.0711341 -.0556276
                  22214 | -.0816222 .0035894 -22.74 0.000 -.0886701 -.0745742
                  22215 | -.0851065 .003939 -21.61 0.000 -.0928409 -.0773722
                  22216 | -.0824943 .0032959 -25.03 0.000 -.0889659 -.0760227
                  22217 | -.08501 .0025687 -33.09 0.000 -.0900536 -.0799663
                  22218 | -.0468658 .002704 -17.33 0.000 -.0521753 -.0415564
                  22219 | -.0177906 .0031713 -5.61 0.000 -.0240176 -.0115637
                  22220 | -.0438066 .0038344 -11.42 0.000 -.0513354 -.0362777
                  22221 | -.0626464 .0034258 -18.29 0.000 -.0693731 -.0559197
                  22222 | -.0178328 .0031996 -5.57 0.000 -.0241153 -.0115504
                  22223 | -.0691782 .0028372 -24.38 0.000 -.0747491 -.0636073
                  22224 | -.0486279 .0022847 -21.28 0.000 -.053114 -.0441419
                  22225 | -.069242 .0026884 -25.76 0.000 -.0745207 -.0639633
                  22226 | -.0520805 .0031209 -16.69 0.000 -.0582085 -.0459525
                  22227 | -.049994 .0035008 -14.28 0.000 -.0568678 -.0431202
                  22228 | -.0712963 .0036052 -19.78 0.000 -.0783753 -.0642173
                  22229 | -.0689047 .0033558 -20.53 0.000 -.0754939 -.0623156
                  22230 | -.1176955 .0032609 -36.09 0.000 -.1240984 -.1112927
                  22231 | -.1024663 .0027285 -37.55 0.000 -.1078239 -.0971088
                  22232 | -.0913621 .0028713 -31.82 0.000 -.0969999 -.0857243
                  22233 | -.1003753 .0037271 -26.93 0.000 -.1076937 -.093057
                  22234 | -.1128801 .0042437 -26.60 0.000 -.1212127 -.1045475
                  22235 | -.0837154 .0034976 -23.94 0.000 -.090583 -.0768478
                  22236 | -.0767192 .0035234 -21.77 0.000 -.0836376 -.0698009
                  22237 | -.0888787 .003079 -28.87 0.000 -.0949244 -.082833
                  22238 | -.0679674 .0025301 -26.86 0.000 -.0729353 -.0629995
                  22239 | -.0839954 .0030427 -27.61 0.000 -.0899698 -.0780211
                  22240 | -.0892678 .0039239 -22.75 0.000 -.0969725 -.0815631
                  22241 | -.1182588 .0043823 -26.99 0.000 -.1268636 -.1096541
                  22242 | -.0798987 .0039022 -20.48 0.000 -.0875608 -.0722365
                  22243 | -.0665693 .0038263 -17.40 0.000 -.0740823 -.0590562
                  22244 | -.0405948 .0034725 -11.69 0.000 -.0474132 -.0337764
                  22245 | -.3662191 .0033535 -109.21 0.000 -.3728037 -.3596344
                  22246 | -.2186523 .0031541 -69.32 0.000 -.2248455 -.2124592
                  22247 | -.1487229 .0037289 -39.88 0.000 -.1560448 -.1414011
                  22248 | -.1043871 .0042776 -24.40 0.000 -.1127863 -.0959879
                  22249 | -.1115932 .0036381 -30.67 0.000 -.1187367 -.1044497
                  22250 | -.0767026 .0039814 -19.27 0.000 -.0845203 -.068885
                  22251 | -.1001831 .0030552 -32.79 0.000 -.1061821 -.0941842
                  22252 | -.0633819 .0027758 -22.83 0.000 -.0688322 -.0579315
                  22253 | -.0970169 .0028694 -33.81 0.000 -.1026509 -.0913828
                  22254 | -.097841 .003701 -26.44 0.000 -.1051081 -.0905739
                  22255 | -.1123135 .0041832 -26.85 0.000 -.1205274 -.1040997
                  22256 | -.1005913 .0036389 -27.64 0.000 -.1077364 -.0934462
                  22257 | -.0888029 .0035149 -25.26 0.000 -.0957045 -.0819014
                  22258 | -.0921318 .0031186 -29.54 0.000 -.0982553 -.0860084
                  22259 | -.0687849 .0025092 -27.41 0.000 -.0737118 -.0638581
                  22260 | -.0980062 .0030199 -32.45 0.000 -.1039359 -.0920766
                  22261 | -.0865401 .0036963 -23.41 0.000 -.0937979 -.0792823
                  22262 | -.1152394 .0044413 -25.95 0.000 -.12396 -.1065187
                  22263 | -.1168955 .0040099 -29.15 0.000 -.1247691 -.1090219
                  22264 | -.0768421 .0037227 -20.64 0.000 -.0841517 -.0695324
                  22265 | -.145212 .0045519 -31.90 0.000 -.1541499 -.1362742
                  22266 | -.0956058 .0039138 -24.43 0.000 -.1032907 -.0879209
                  22267 | -.0824913 .0029963 -27.53 0.000 -.0883747 -.0766079
                  22268 | -.0546942 .0033777 -16.19 0.000 -.0613265 -.0480619
                  22269 | -.0732965 .0038778 -18.90 0.000 -.0809107 -.0656822
                  22270 | -.0415035 .0037264 -11.14 0.000 -.0488205 -.0341865
                  22271 | -.026318 .0034254 -7.68 0.000 -.0330438 -.0195921
                  22272 | -.0081635 .0038094 -2.14 0.032 -.0156434 -.0006837
                  22273 | -.1292664 .003114 -41.51 0.000 -.1353807 -.1231521
                  22274 | -.4845792 .0034212 -141.64 0.000 -.4912968 -.4778616
                  22275 | -.2102895 .0035813 -58.72 0.000 -.2173215 -.2032575
                  22276 | -.1415161 .0037023 -38.22 0.000 -.1487857 -.1342465
                  22277 | -.114416 .0037874 -30.21 0.000 -.1218526 -.1069794
                  22278 | -.1187575 .0036335 -32.68 0.000 -.1258919 -.111623
                  22279 | -.1284178 .0035915 -35.76 0.000 -.1354698 -.1213657
                  22280 | -.0838294 .0030462 -27.52 0.000 -.0898107 -.0778481
                  22281 | -.3975649 .0041927 -94.82 0.000 -.4057973 -.3893324
                  22282 | -.1781178 .0045118 -39.48 0.000 -.1869769 -.1692588
                  22283 | -.144411 .0039966 -36.13 0.000 -.1522583 -.1365636
                  22284 | -.0773569 .0033979 -22.77 0.000 -.0840289 -.070685
                  |
                  _cons | .0041367 .0023643 1.75 0.081 -.0005058 .0087791
                  -------------+----------------------------------------------------------------
                  sigma_u | .05334815
                  sigma_e | .06436563
                  rho | .40721731 (fraction of variance due to u_i)
                  ------------------------------------------------------------------------------

                  I am wondering how I would interpret this? Are the results significant? How does this relate to the difference in difference?

                  Comment


                  • #10
                    As Øyvind Snilsberg states in #2, you require a pre-period in DID. From the results of the tabulation #8, it appears that the treatment is initiated at the start of the period. So DID may not be the way to go here.

                    Comment


                    • #11
                      Right, so would I use a simple regression, like this:
                      regress movement_ch i.date##i.treat i.date,robust

                      Comment


                      • #12
                        You can do a descriptive analysis examining differences in means between the two groups of firms and controlling for time effects.

                        Code:
                        regress movement treated i.date, cluster(firm)
                        Last edited by Andrew Musau; 11 May 2022, 05:39.

                        Comment


                        • #13
                          regress movement i.date##i.treated i.date,robust
                          I thought with the regression I suggested the date and treat interaction term would give the difference as well. Then the i.date would be the time fixed effect. I thought this would work then. Could I do then:
                          regress movement i.date##i.treated i.date,cluster(firm)

                          Could I also run:
                          regress movement i.date##i.treated i.date treat,cluster(firm)

                          I am wondering what the difference would be between these then?
                          Last edited by Taiba Chau; 11 May 2022, 06:32.

                          Comment


                          • #14
                            To follow up on Andrew’s comment: with a balanced panel and estimating one effect, it’s the same as collapsing the panel to a cross section by averaging within each firm. Do you have control variables?

                            Comment


                            • #15
                              You can interact the group indicator with the time indicators. Then the coefficient of an interaction will represent the difference in the effect from the reference time period.

                              Code:
                              regress movement i.date##i.treated,cluster(firm)
                              The coefficient on treated will be the effect in the reference period and the interactions as detailed above. No need to add "i.date" or "i.treat" separately as the double hash in the factor variable notation already does this. See

                              Code:
                              help fvvarlist

                              Note: Crossed with #14. As firm fixed effects cannot be added, I agree with Jeff's comment to include control variables to capture as much of the heterogeneity as possible.
                              Last edited by Andrew Musau; 11 May 2022, 07:49.

                              Comment

                              Working...
                              X