Announcement

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

  • Two way fixed effect

    Hi, I am working with balanced firm-level panel data. That is observing 668 firms across 96 days. Over that 96 days, firms are either treated or not for the whole period.
    I want to analyse this running a two way fixed effects. So far I have run the regression:

    regress movement i.date##i.treated,cluster(firm).
    I also tried:

    xtreg movement i.date##i.treated,fe

    Both of these I similar estimates, except the constants are different. Also in the second regression, the estimate for treated is omitted. I do not know why there is a difference between the two? Any help would be appreciated! Thanks

  • #2
    Taiba:
    your regressions are pretty different. The first one, from one side, neglects the panel structure of your dataset, since you did not include your -panelvar- as predictor, while, from the other one, acknowledge the panel structure of your dataset via clustered standard errors.
    in addition, your second code relies on the -fe- estimator, which wipes out time-invariant variables: this is one of the possible reasons why that estimate is omitted.
    Last but no least, as per FAQ please post what you typed and what Stata gave you back. Thanks.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi, for the first regression i got:


      Linear regression Number of obs = 64,128
      F(191, 667) = 619.29
      Prob > F = 0.0000
      R-squared = 0.4347
      Root MSE = .08335

      (Std. err. adjusted for 668 clusters in firm)
      ------------------------------------------------------------------------------
      | Robust
      movement | Coefficient std. err. t P>|t| [95% conf. interval]
      -------------+----------------------------------------------------------------
      date |
      22190 | -.0117339 .0036364 -3.23 0.001 -.018874 -.0045938
      22191 | .0061952 .0048685 1.27 0.204 -.0033643 .0157547
      22192 | -.0075834 .0054593 -1.39 0.165 -.0183028 .0031361
      22193 | -.0246947 .0043845 -5.63 0.000 -.0333037 -.0160856
      22194 | -.0254833 .0041861 -6.09 0.000 -.0337028 -.0172637
      22195 | -.0339461 .0038214 -8.88 0.000 -.0414494 -.0264427
      22196 | -.0187918 .0031872 -5.90 0.000 -.0250499 -.0125337
      22197 | -.0308207 .0039396 -7.82 0.000 -.0385563 -.0230851
      22198 | -.0226277 .0058718 -3.85 0.000 -.0341571 -.0110983
      22199 | -.0224438 .0058888 -3.81 0.000 -.0340067 -.0108809
      22200 | -.0686675 .0048556 -14.14 0.000 -.0782015 -.0591335
      22201 | -.0387865 .0043222 -8.97 0.000 -.0472732 -.0302997
      22202 | -.0319462 .0038592 -8.28 0.000 -.0395239 -.0243686
      22203 | -.019572 .0033172 -5.90 0.000 -.0260853 -.0130586
      22204 | -.0458368 .0040686 -11.27 0.000 -.0538257 -.0378479
      22205 | -.0118971 .0052492 -2.27 0.024 -.022204 -.0015902
      22206 | -.0092345 .0054685 -1.69 0.092 -.019972 .001503
      22207 | -.0519531 .004755 -10.93 0.000 -.0612897 -.0426164
      22208 | -.0558492 .0043932 -12.71 0.000 -.0644753 -.0472231
      22209 | -.0545306 .0038288 -14.24 0.000 -.0620486 -.0470127
      22210 | -.038902 .003583 -10.86 0.000 -.0459373 -.0318666
      22211 | -.0578857 .0038196 -15.16 0.000 -.0653855 -.0503859
      22212 | -.0378233 .0052665 -7.18 0.000 -.0481641 -.0274824
      22213 | -.0556134 .0052973 -10.50 0.000 -.0660148 -.045212
      22214 | -.0705166 .0046716 -15.09 0.000 -.0796894 -.0613439
      22215 | -.0756699 .0051616 -14.66 0.000 -.0858048 -.065535
      22216 | -.0735554 .004403 -16.71 0.000 -.0822008 -.06491
      22217 | -.0775573 .0037963 -20.43 0.000 -.0850113 -.0701032
      22218 | -.0386952 .0038581 -10.03 0.000 -.0462706 -.0311198
      22219 | -.0120354 .0045457 -2.65 0.008 -.020961 -.0031098
      22220 | -.0376253 .0052698 -7.14 0.000 -.0479727 -.0272779
      22221 | -.0546584 .0046534 -11.75 0.000 -.0637954 -.0455214
      22222 | -.0119833 .004516 -2.65 0.008 -.0208506 -.0031159
      22223 | -.0603627 .004 -15.09 0.000 -.0682168 -.0525087
      22224 | -.0473259 .0031872 -14.85 0.000 -.0535841 -.0410678
      22225 | -.0622291 .0039075 -15.93 0.000 -.0699016 -.0545567
      22226 | -.047348 .0045461 -10.42 0.000 -.0562743 -.0384216
      22227 | -.0461815 .0050804 -9.09 0.000 -.056157 -.036206
      22228 | -.0645733 .0049722 -12.99 0.000 -.0743363 -.0548103
      22229 | -.0635766 .0047364 -13.42 0.000 -.0728766 -.0542765
      22230 | -.1086741 .0045589 -23.84 0.000 -.1176257 -.0997225
      22231 | -.1020283 .0039647 -25.73 0.000 -.1098132 -.0942435
      22232 | -.084939 .0040942 -20.75 0.000 -.0929781 -.0768999
      22233 | -.0980612 .0054814 -17.89 0.000 -.108824 -.0872984
      22234 | -.10577 .0060594 -17.46 0.000 -.1176679 -.0938722
      22235 | -.0776466 .0047394 -16.38 0.000 -.0869524 -.0683407
      22236 | -.0714797 .0048873 -14.63 0.000 -.0810759 -.0618834
      22237 | -.084377 .0043148 -19.56 0.000 -.0928491 -.0759049
      22238 | -.0651048 .0037058 -17.57 0.000 -.0723812 -.0578283
      22239 | -.0794405 .0043188 -18.39 0.000 -.0879207 -.0709603
      22240 | -.0892378 .0057398 -15.55 0.000 -.100508 -.0779676
      22241 | -.1147094 .0059886 -19.15 0.000 -.1264681 -.1029506
      22242 | -.070078 .0053573 -13.08 0.000 -.0805972 -.0595589
      22243 | -.0597455 .0053587 -11.15 0.000 -.0702676 -.0492235
      22244 | -.0316702 .0048371 -6.55 0.000 -.0411679 -.0221725
      22245 | -.364146 .0048263 -75.45 0.000 -.3736225 -.3546695
      22246 | -.2139293 .0046397 -46.11 0.000 -.2230394 -.2048192
      22247 | -.1434266 .0054905 -26.12 0.000 -.1542072 -.1326459
      22248 | -.0974948 .0060988 -15.99 0.000 -.10947 -.0855197
      22249 | -.1049967 .0051781 -20.28 0.000 -.1151641 -.0948293
      22250 | -.0660503 .0058077 -11.37 0.000 -.0774538 -.0546468
      22251 | -.0901983 .0041591 -21.69 0.000 -.0983648 -.0820318
      22252 | -.0576052 .0040887 -14.09 0.000 -.0656335 -.049577
      22253 | -.0878984 .0040813 -21.54 0.000 -.0959122 -.0798846
      22254 | -.0934529 .0053136 -17.59 0.000 -.1038863 -.0830194
      22255 | -.1115524 .0060401 -18.47 0.000 -.1234123 -.0996926
      22256 | -.0947357 .0047825 -19.81 0.000 -.1041262 -.0853451
      22257 | -.0852183 .0047107 -18.09 0.000 -.0944678 -.0759688
      22258 | -.0856866 .0043743 -19.59 0.000 -.0942756 -.0770976
      22259 | -.0686329 .0035578 -19.29 0.000 -.0756188 -.061647
      22260 | -.091803 .004444 -20.66 0.000 -.1005289 -.0830772
      22261 | -.0848228 .0053539 -15.84 0.000 -.0953353 -.0743103
      22262 | -.1058546 .0064841 -16.33 0.000 -.1185863 -.0931228
      22263 | -.1093315 .0056156 -19.47 0.000 -.1203579 -.0983052
      22264 | -.0706573 .0050862 -13.89 0.000 -.0806442 -.0606703
      22265 | -.1316232 .0060743 -21.67 0.000 -.1435503 -.1196961
      22266 | -.0895425 .0052969 -16.90 0.000 -.0999432 -.0791419
      22267 | -.0763088 .0044973 -16.97 0.000 -.0851395 -.0674782
      22268 | -.0522904 .0049384 -10.59 0.000 -.0619871 -.0425937
      22269 | -.0722278 .0053504 -13.50 0.000 -.0827334 -.0617222
      22270 | -.0389771 .0052212 -7.47 0.000 -.0492291 -.0287251
      22271 | -.0230712 .0045737 -5.04 0.000 -.0320518 -.0140905
      22272 | -.0010417 .0050472 -0.21 0.837 -.010952 .0088686
      22273 | -.1285618 .0043548 -29.52 0.000 -.1371126 -.120011
      22274 | -.481358 .0048315 -99.63 0.000 -.4908448 -.4718711
      22275 | -.2047548 .0053326 -38.40 0.000 -.2152255 -.194284
      22276 | -.1378026 .0053102 -25.95 0.000 -.1482292 -.1273759
      22277 | -.1084895 .0051854 -20.92 0.000 -.1186712 -.0983079
      22278 | -.1135309 .0050113 -22.65 0.000 -.1233708 -.103691
      22279 | -.1227531 .0051643 -23.77 0.000 -.1328933 -.112613
      22280 | -.0820567 .0042049 -19.51 0.000 -.090313 -.0738003
      22281 | -.3877996 .0059285 -65.41 0.000 -.3994404 -.3761589
      22282 | -.1751182 .0068654 -25.51 0.000 -.1885986 -.1616378
      22283 | -.1382504 .0057396 -24.09 0.000 -.1495204 -.1269804
      22284 | -.0712775 .0048138 -14.81 0.000 -.0807296 -.0618255
      |
      1.treated | .0129712 .0062936 2.06 0.040 .0006135 .0253289
      |
      date#treated |
      22190 1 | -.0103737 .0049077 -2.11 0.035 -.0200102 -.0007372
      22191 1 | -.0101262 .006371 -1.59 0.112 -.0226357 .0023834
      22192 1 | -.0044279 .0074543 -0.59 0.553 -.0190647 .0102089
      22193 1 | -.0121281 .0065307 -1.86 0.064 -.0249514 .0006952
      22194 1 | -.0087692 .0058953 -1.49 0.137 -.0203448 .0028063
      22195 1 | -.0163783 .0054397 -3.01 0.003 -.0270594 -.0056973
      22196 1 | -.0029138 .0044857 -0.65 0.516 -.0117216 .005894
      22197 1 | -.0130168 .0053979 -2.41 0.016 -.0236158 -.0024179
      22198 1 | -.0137071 .0077323 -1.77 0.077 -.0288897 .0014754
      22199 1 | -.0107476 .0087326 -1.23 0.219 -.0278943 .0063991
      22200 1 | -.0148477 .0070439 -2.11 0.035 -.0286785 -.0010169
      22201 1 | -.0133479 .0061588 -2.17 0.031 -.0254408 -.0012551
      22202 1 | -.0172506 .0058342 -2.96 0.003 -.0287063 -.0057949
      22203 1 | -.0027392 .0046811 -0.59 0.559 -.0119307 .0064522
      22204 1 | -.0122303 .0053843 -2.27 0.023 -.0228025 -.0016581
      22205 1 | -.013572 .0071839 -1.89 0.059 -.0276778 .0005337
      22206 1 | -.0063438 .0076329 -0.83 0.406 -.0213312 .0086436
      22207 1 | -.0138562 .0067662 -2.05 0.041 -.0271419 -.0005706
      22208 1 | -.0099377 .006598 -1.51 0.132 -.0228931 .0030177
      22209 1 | -.0127609 .0056425 -2.26 0.024 -.0238401 -.0016817
      22210 1 | -.0051835 .0053016 -0.98 0.329 -.0155934 .0052264
      22211 1 | -.0206262 .0054864 -3.76 0.000 -.0313989 -.0098534
      22212 1 | -.0104425 .0071415 -1.46 0.144 -.0244649 .00358
      22213 1 | -.0152608 .0078666 -1.94 0.053 -.0307071 .0001855
      22214 1 | -.0218191 .0071155 -3.07 0.002 -.0357906 -.0078476
      22215 1 | -.0185402 .0078314 -2.37 0.018 -.0339174 -.003163
      22216 1 | -.0175623 .0065492 -2.68 0.008 -.0304218 -.0047027
      22217 1 | -.0146424 .0051182 -2.86 0.004 -.0246921 -.0045927
      22218 1 | -.0160528 .0053782 -2.98 0.003 -.026613 -.0054926
      22219 1 | -.0113074 .0063346 -1.79 0.075 -.0237456 .0011307
      22220 1 | -.0121444 .0076517 -1.59 0.113 -.0271688 .0028799
      22221 1 | -.015694 .0068202 -2.30 0.022 -.0290856 -.0023024
      22222 1 | -.0114927 .0063874 -1.80 0.072 -.0240345 .0010491
      22223 1 | -.0173198 .0056385 -3.07 0.002 -.0283912 -.0062485
      22224 1 | -.0025581 .0045688 -0.56 0.576 -.0115291 .0064129
      22225 1 | -.0137782 .0053594 -2.57 0.010 -.0243016 -.0032548
      22226 1 | -.009298 .0062419 -1.49 0.137 -.0215542 .0029582
      22227 1 | -.0074904 .0070061 -1.07 0.285 -.021247 .0062663
      22228 1 | -.0132087 .0071909 -1.84 0.067 -.0273282 .0009107
      22229 1 | -.0104683 .0067031 -1.56 0.119 -.0236299 .0026934
      22230 1 | -.0177245 .0064879 -2.73 0.006 -.0304637 -.0049853
      22231 1 | -.0008606 .0054654 -0.16 0.875 -.011592 .0098708
      22232 1 | -.0126195 .0057273 -2.20 0.028 -.0238652 -.0013737
      22233 1 | -.0045465 .007467 -0.61 0.543 -.0192082 .0101151
      22234 1 | -.0139692 .0084783 -1.65 0.100 -.0306166 .0026783
      22235 1 | -.0119234 .0069745 -1.71 0.088 -.025618 .0017711
      22236 1 | -.0102942 .0070353 -1.46 0.144 -.0241082 .0035199
      22237 1 | -.0088444 .0061504 -1.44 0.151 -.0209208 .003232
      22238 1 | -.0056243 .0050649 -1.11 0.267 -.0155693 .0043207
      22239 1 | -.008949 .00608 -1.47 0.142 -.0208873 .0029893
      22240 1 | -.0000589 .0078618 -0.01 0.994 -.0154957 .0153779
      22241 1 | -.0069736 .0087555 -0.80 0.426 -.0241653 .010218
      22242 1 | -.0192946 .0077664 -2.48 0.013 -.0345441 -.0040451
      22243 1 | -.0134066 .0076374 -1.76 0.080 -.0284028 .0015896
      22244 1 | -.0175341 .0069132 -2.54 0.011 -.0311085 -.0039598
      22245 1 | -.0040729 .0067131 -0.61 0.544 -.0172543 .0091084
      22246 1 | -.0092793 .0063108 -1.47 0.142 -.0216708 .0031122
      22247 1 | -.0104058 .0074624 -1.39 0.164 -.0250585 .0042469
      22248 1 | -.0135413 .008547 -1.58 0.114 -.0303235 .003241
      22249 1 | -.0129602 .0072652 -1.78 0.075 -.0272256 .0013052
      22250 1 | -.0209287 .0079363 -2.64 0.009 -.0365118 -.0053456
      22251 1 | -.0196172 .0060602 -3.24 0.001 -.0315166 -.0077179
      22252 1 | -.0113494 .0055461 -2.05 0.041 -.0222392 -.0004595
      22253 1 | -.0179151 .0057025 -3.14 0.002 -.0291121 -.0067182
      22254 1 | -.0086215 .0074029 -1.16 0.245 -.0231573 .0059144
      22255 1 | -.0014953 .0083771 -0.18 0.858 -.017944 .0149534
      22256 1 | -.0115046 .0072515 -1.59 0.113 -.0257431 .0027339
      22257 1 | -.0070427 .0070162 -1.00 0.316 -.0208192 .0067338
      22258 1 | -.012663 .0062203 -2.04 0.042 -.0248767 -.0004492
      22259 1 | -.0002986 .0050217 -0.06 0.953 -.0101588 .0095616
      22260 1 | -.0121874 .006034 -2.02 0.044 -.0240354 -.0003394
      22261 1 | -.003374 .007402 -0.46 0.649 -.017908 .01116
      22262 1 | -.0184383 .00887 -2.08 0.038 -.0358549 -.0010218
      22263 1 | -.0148609 .0080017 -1.86 0.064 -.0305726 .0008507
      22264 1 | -.0121513 .0074266 -1.64 0.102 -.0267337 .0024311
      22265 1 | -.0266981 .0090347 -2.96 0.003 -.0444379 -.0089582
      22266 1 | -.0119126 .0078075 -1.53 0.128 -.0272428 .0034177
      22267 1 | -.0121467 .0059914 -2.03 0.043 -.023911 -.0003825
      22268 1 | -.0047228 .006765 -0.70 0.485 -.018006 .0085605
      22269 1 | -.0020996 .0077532 -0.27 0.787 -.0173232 .0131241
      22270 1 | -.0049637 .0074524 -0.67 0.506 -.0195966 .0096692
      22271 1 | -.006379 .0068374 -0.93 0.351 -.0198045 .0070465
      22272 1 | -.0139923 .0075883 -1.84 0.066 -.028892 .0009075
      22273 1 | -.0013843 .0062288 -0.22 0.824 -.0136148 .0108462
      22274 1 | -.0063288 .0068417 -0.93 0.355 -.0197627 .0071051
      22275 1 | -.0108742 .0071682 -1.52 0.130 -.0249491 .0032007
      22276 1 | -.007296 .0074073 -0.98 0.325 -.0218404 .0072485
      22277 1 | -.0116437 .0075578 -1.54 0.124 -.0264837 .0031962
      22278 1 | -.0102686 .0072545 -1.42 0.157 -.0245129 .0039757
      22279 1 | -.0111294 .0071788 -1.55 0.122 -.0252252 .0029664
      22280 1 | -.0034829 .0060894 -0.57 0.568 -.0154396 .0084738
      22281 1 | -.0191858 .0083583 -2.30 0.022 -.0355974 -.0027741
      22282 1 | -.0058934 .0090506 -0.65 0.515 -.0236645 .0118776
      22283 1 | -.0121037 .0079887 -1.52 0.130 -.0277897 .0035823
      22284 1 | -.0119443 .0067849 -1.76 0.079 -.0252666 .0013781
      |
      _cons | -.0024655 .0045525 -0.54 0.588 -.0114044 .0064735
      ------------------------------------------------------------------------------



      Comment


      • #4
        For the second regression, I got:

        . xtreg movement i.date##i.treated,fe
        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,63270) = 434.05
        corr(u_i, Xb) = -0.0091 Prob > F = 0.0000

        ------------------------------------------------------------------------------
        movement | Coefficient Std. err. t P>|t| [95% conf. interval]
        -------------+----------------------------------------------------------------
        date |
        22190 | -.0117339 .0050253 -2.33 0.020 -.0215835 -.0018843
        22191 | .0061952 .0050253 1.23 0.218 -.0036544 .0160448
        22192 | -.0075834 .0050253 -1.51 0.131 -.017433 .0022663
        22193 | -.0246947 .0050253 -4.91 0.000 -.0345443 -.0148451
        22194 | -.0254833 .0050253 -5.07 0.000 -.0353329 -.0156337
        22195 | -.0339461 .0050253 -6.76 0.000 -.0437957 -.0240965
        22196 | -.0187918 .0050253 -3.74 0.000 -.0286414 -.0089422
        22197 | -.0308207 .0050253 -6.13 0.000 -.0406703 -.0209711
        22198 | -.0226277 .0050253 -4.50 0.000 -.0324773 -.0127781
        22199 | -.0224438 .0050253 -4.47 0.000 -.0322934 -.0125942
        22200 | -.0686675 .0050253 -13.66 0.000 -.0785171 -.0588179
        22201 | -.0387865 .0050253 -7.72 0.000 -.0486361 -.0289369
        22202 | -.0319462 .0050253 -6.36 0.000 -.0417959 -.0220966
        22203 | -.019572 .0050253 -3.89 0.000 -.0294216 -.0097224
        22204 | -.0458368 .0050253 -9.12 0.000 -.0556864 -.0359872
        22205 | -.0118971 .0050253 -2.37 0.018 -.0217467 -.0020475
        22206 | -.0092345 .0050253 -1.84 0.066 -.0190841 .0006151
        22207 | -.0519531 .0050253 -10.34 0.000 -.0618027 -.0421035
        22208 | -.0558492 .0050253 -11.11 0.000 -.0656988 -.0459996
        22209 | -.0545306 .0050253 -10.85 0.000 -.0643802 -.044681
        22210 | -.038902 .0050253 -7.74 0.000 -.0487516 -.0290523
        22211 | -.0578857 .0050253 -11.52 0.000 -.0677353 -.0480361
        22212 | -.0378233 .0050253 -7.53 0.000 -.0476729 -.0279737
        22213 | -.0556134 .0050253 -11.07 0.000 -.065463 -.0457638
        22214 | -.0705166 .0050253 -14.03 0.000 -.0803663 -.060667
        22215 | -.0756699 .0050253 -15.06 0.000 -.0855195 -.0658203
        22216 | -.0735554 .0050253 -14.64 0.000 -.083405 -.0637058
        22217 | -.0775573 .0050253 -15.43 0.000 -.0874069 -.0677077
        22218 | -.0386952 .0050253 -7.70 0.000 -.0485448 -.0288456
        22219 | -.0120354 .0050253 -2.39 0.017 -.021885 -.0021858
        22220 | -.0376253 .0050253 -7.49 0.000 -.0474749 -.0277757
        22221 | -.0546584 .0050253 -10.88 0.000 -.064508 -.0448088
        22222 | -.0119833 .0050253 -2.38 0.017 -.0218329 -.0021337
        22223 | -.0603627 .0050253 -12.01 0.000 -.0702123 -.0505131
        22224 | -.0473259 .0050253 -9.42 0.000 -.0571755 -.0374763
        22225 | -.0622291 .0050253 -12.38 0.000 -.0720787 -.0523795
        22226 | -.047348 .0050253 -9.42 0.000 -.0571976 -.0374984
        22227 | -.0461815 .0050253 -9.19 0.000 -.0560311 -.0363319
        22228 | -.0645733 .0050253 -12.85 0.000 -.0744229 -.0547237
        22229 | -.0635766 .0050253 -12.65 0.000 -.0734262 -.053727
        22230 | -.1086741 .0050253 -21.63 0.000 -.1185237 -.0988245
        22231 | -.1020283 .0050253 -20.30 0.000 -.1118779 -.0921787
        22232 | -.084939 .0050253 -16.90 0.000 -.0947886 -.0750894
        22233 | -.0980612 .0050253 -19.51 0.000 -.1079108 -.0882116
        22234 | -.10577 .0050253 -21.05 0.000 -.1156196 -.0959204
        22235 | -.0776466 .0050253 -15.45 0.000 -.0874962 -.067797
        22236 | -.0714797 .0050253 -14.22 0.000 -.0813293 -.0616301
        22237 | -.084377 .0050253 -16.79 0.000 -.0942266 -.0745274
        22238 | -.0651048 .0050253 -12.96 0.000 -.0749544 -.0552552
        22239 | -.0794405 .0050253 -15.81 0.000 -.0892901 -.0695909
        22240 | -.0892378 .0050253 -17.76 0.000 -.0990874 -.0793882
        22241 | -.1147094 .0050253 -22.83 0.000 -.124559 -.1048598
        22242 | -.070078 .0050253 -13.95 0.000 -.0799277 -.0602284
        22243 | -.0597455 .0050253 -11.89 0.000 -.0695951 -.0498959
        22244 | -.0316702 .0050253 -6.30 0.000 -.0415198 -.0218206
        22245 | -.364146 .0050253 -72.46 0.000 -.3739956 -.3542964
        22246 | -.2139293 .0050253 -42.57 0.000 -.2237789 -.2040797
        22247 | -.1434266 .0050253 -28.54 0.000 -.1532762 -.133577
        22248 | -.0974948 .0050253 -19.40 0.000 -.1073444 -.0876452
        22249 | -.1049967 .0050253 -20.89 0.000 -.1148463 -.0951471
        22250 | -.0660503 .0050253 -13.14 0.000 -.0758999 -.0562007
        22251 | -.0901983 .0050253 -17.95 0.000 -.1000479 -.0803487
        22252 | -.0576052 .0050253 -11.46 0.000 -.0674548 -.0477556
        22253 | -.0878984 .0050253 -17.49 0.000 -.097748 -.0780488
        22254 | -.0934529 .0050253 -18.60 0.000 -.1033025 -.0836033
        22255 | -.1115524 .0050253 -22.20 0.000 -.121402 -.1017028
        22256 | -.0947357 .0050253 -18.85 0.000 -.1045853 -.0848861
        22257 | -.0852183 .0050253 -16.96 0.000 -.0950679 -.0753687
        22258 | -.0856866 .0050253 -17.05 0.000 -.0955362 -.075837
        22259 | -.0686329 .0050253 -13.66 0.000 -.0784825 -.0587833
        22260 | -.091803 .0050253 -18.27 0.000 -.1016527 -.0819534
        22261 | -.0848228 .0050253 -16.88 0.000 -.0946724 -.0749732
        22262 | -.1058546 .0050253 -21.06 0.000 -.1157042 -.096005
        22263 | -.1093315 .0050253 -21.76 0.000 -.1191811 -.0994819
        22264 | -.0706573 .0050253 -14.06 0.000 -.0805069 -.0608077
        22265 | -.1316232 .0050253 -26.19 0.000 -.1414728 -.1217736
        22266 | -.0895425 .0050253 -17.82 0.000 -.0993921 -.0796929
        22267 | -.0763088 .0050253 -15.18 0.000 -.0861584 -.0664592
        22268 | -.0522904 .0050253 -10.41 0.000 -.06214 -.0424408
        22269 | -.0722278 .0050253 -14.37 0.000 -.0820774 -.0623782
        22270 | -.0389771 .0050253 -7.76 0.000 -.0488267 -.0291275
        22271 | -.0230712 .0050253 -4.59 0.000 -.0329208 -.0132216
        22272 | -.0010417 .0050253 -0.21 0.836 -.0108913 .0088079
        22273 | -.1285618 .0050253 -25.58 0.000 -.1384114 -.1187122
        22274 | -.481358 .0050253 -95.79 0.000 -.4912076 -.4715084
        22275 | -.2047548 .0050253 -40.74 0.000 -.2146044 -.1949052
        22276 | -.1378026 .0050253 -27.42 0.000 -.1476522 -.127953
        22277 | -.1084895 .0050253 -21.59 0.000 -.1183391 -.0986399
        22278 | -.1135309 .0050253 -22.59 0.000 -.1233805 -.1036813
        22279 | -.1227531 .0050253 -24.43 0.000 -.1326027 -.1129035
        22280 | -.0820567 .0050253 -16.33 0.000 -.0919063 -.0722071
        22281 | -.3877996 .0050253 -77.17 0.000 -.3976492 -.37795
        22282 | -.1751182 .0050253 -34.85 0.000 -.1849678 -.1652686
        22283 | -.1382504 .0050253 -27.51 0.000 -.1481 -.1284008
        22284 | -.0712775 .0050253 -14.18 0.000 -.0811271 -.0614279
        |
        1.treated| 0 (omitted)
        |
        date#treated |
        22190 1 | -.0103737 .0070439 -1.47 0.141 -.0241797 .0034323
        22191 1 | -.0101262 .0070439 -1.44 0.151 -.0239322 .0036798
        22192 1 | -.0044279 .0070439 -0.63 0.530 -.0182339 .0093781
        22193 1 | -.0121281 .0070439 -1.72 0.085 -.0259341 .0016779
        22194 1 | -.0087692 .0070439 -1.24 0.213 -.0225752 .0050368
        22195 1 | -.0163783 .0070439 -2.33 0.020 -.0301843 -.0025724
        22196 1 | -.0029138 .0070439 -0.41 0.679 -.0167198 .0108922
        22197 1 | -.0130168 .0070439 -1.85 0.065 -.0268228 .0007892
        22198 1 | -.0137071 .0070439 -1.95 0.052 -.0275131 .0000988
        22199 1 | -.0107476 .0070439 -1.53 0.127 -.0245536 .0030584
        22200 1 | -.0148477 .0070439 -2.11 0.035 -.0286537 -.0010417
        22201 1 | -.0133479 .0070439 -1.89 0.058 -.0271539 .000458
        22202 1 | -.0172506 .0070439 -2.45 0.014 -.0310566 -.0034446
        22203 1 | -.0027392 .0070439 -0.39 0.697 -.0165452 .0110668
        22204 1 | -.0122303 .0070439 -1.74 0.083 -.0260363 .0015757
        22205 1 | -.013572 .0070439 -1.93 0.054 -.027378 .0002339
        22206 1 | -.0063438 .0070439 -0.90 0.368 -.0201498 .0074622
        22207 1 | -.0138562 .0070439 -1.97 0.049 -.0276622 -.0000503
        22208 1 | -.0099377 .0070439 -1.41 0.158 -.0237437 .0038683
        22209 1 | -.0127609 .0070439 -1.81 0.070 -.0265669 .001045
        22210 1 | -.0051835 .0070439 -0.74 0.462 -.0189895 .0086225
        22211 1 | -.0206262 .0070439 -2.93 0.003 -.0344322 -.0068202
        22212 1 | -.0104425 .0070439 -1.48 0.138 -.0242485 .0033635
        22213 1 | -.0152608 .0070439 -2.17 0.030 -.0290668 -.0014548
        22214 1 | -.0218191 .0070439 -3.10 0.002 -.0356251 -.0080131
        22215 1 | -.0185402 .0070439 -2.63 0.008 -.0323462 -.0047342
        22216 1 | -.0175623 .0070439 -2.49 0.013 -.0313683 -.0037563
        22217 1 | -.0146424 .0070439 -2.08 0.038 -.0284484 -.0008364
        22218 1 | -.0160528 .0070439 -2.28 0.023 -.0298588 -.0022468
        22219 1 | -.0113074 .0070439 -1.61 0.108 -.0251134 .0024986
        22220 1 | -.0121444 .0070439 -1.72 0.085 -.0259504 .0016616
        22221 1 | -.015694 .0070439 -2.23 0.026 -.0295 -.001888
        22222 1 | -.0114927 .0070439 -1.63 0.103 -.0252987 .0023133
        22223 1 | -.0173198 .0070439 -2.46 0.014 -.0311258 -.0035138
        22224 1 | -.0025581 .0070439 -0.36 0.716 -.016364 .0112479
        22225 1 | -.0137782 .0070439 -1.96 0.050 -.0275842 .0000278
        22226 1 | -.009298 .0070439 -1.32 0.187 -.023104 .004508
        22227 1 | -.0074904 .0070439 -1.06 0.288 -.0212963 .0063156
        22228 1 | -.0132087 .0070439 -1.88 0.061 -.0270147 .0005973
        22229 1 | -.0104683 .0070439 -1.49 0.137 -.0242743 .0033377
        22230 1 | -.0177245 .0070439 -2.52 0.012 -.0315305 -.0039185
        22231 1 | -.0008606 .0070439 -0.12 0.903 -.0146666 .0129454
        22232 1 | -.0126195 .0070439 -1.79 0.073 -.0264255 .0011865
        22233 1 | -.0045465 .0070439 -0.65 0.519 -.0183525 .0092594
        22234 1 | -.0139692 .0070439 -1.98 0.047 -.0277752 -.0001632
        22235 1 | -.0119234 .0070439 -1.69 0.091 -.0257294 .0018826
        22236 1 | -.0102942 .0070439 -1.46 0.144 -.0241002 .0035118
        22237 1 | -.0088444 .0070439 -1.26 0.209 -.0226504 .0049616
        22238 1 | -.0056243 .0070439 -0.80 0.425 -.0194303 .0081817
        22239 1 | -.008949 .0070439 -1.27 0.204 -.022755 .004857
        22240 1 | -.0000589 .0070439 -0.01 0.993 -.0138649 .0137471
        22241 1 | -.0069736 .0070439 -0.99 0.322 -.0207796 .0068324
        22242 1 | -.0192946 .0070439 -2.74 0.006 -.0331006 -.0054886
        22243 1 | -.0134066 .0070439 -1.90 0.057 -.0272126 .0003994
        22244 1 | -.0175341 .0070439 -2.49 0.013 -.0313401 -.0037282
        22245 1 | -.0040729 .0070439 -0.58 0.563 -.0178789 .0097331
        22246 1 | -.0092793 .0070439 -1.32 0.188 -.0230853 .0045267
        22247 1 | -.0104058 .0070439 -1.48 0.140 -.0242118 .0034002
        22248 1 | -.0135413 .0070439 -1.92 0.055 -.0273473 .0002647
        22249 1 | -.0129602 .0070439 -1.84 0.066 -.0267662 .0008458
        22250 1 | -.0209287 .0070439 -2.97 0.003 -.0347347 -.0071227
        22251 1 | -.0196172 .0070439 -2.79 0.005 -.0334232 -.0058112
        22252 1 | -.0113494 .0070439 -1.61 0.107 -.0251554 .0024566
        22253 1 | -.0179151 .0070439 -2.54 0.011 -.0317211 -.0041091
        22254 1 | -.0086215 .0070439 -1.22 0.221 -.0224274 .0051845
        22255 1 | -.0014953 .0070439 -0.21 0.832 -.0153013 .0123107
        22256 1 | -.0115046 .0070439 -1.63 0.102 -.0253106 .0023014
        22257 1 | -.0070427 .0070439 -1.00 0.317 -.0208487 .0067633
        22258 1 | -.012663 .0070439 -1.80 0.072 -.026469 .001143
        22259 1 | -.0002986 .0070439 -0.04 0.966 -.0141046 .0135074
        22260 1 | -.0121874 .0070439 -1.73 0.084 -.0259934 .0016186
        22261 1 | -.003374 .0070439 -0.48 0.632 -.01718 .010432
        22262 1 | -.0184383 .0070439 -2.62 0.009 -.0322443 -.0046323
        22263 1 | -.0148609 .0070439 -2.11 0.035 -.0286669 -.001055
        22264 1 | -.0121513 .0070439 -1.73 0.085 -.0259573 .0016547
        22265 1 | -.0266981 .0070439 -3.79 0.000 -.0405041 -.0128921
        22266 1 | -.0119126 .0070439 -1.69 0.091 -.0257185 .0018934
        22267 1 | -.0121467 .0070439 -1.72 0.085 -.0259527 .0016592
        22268 1 | -.0047228 .0070439 -0.67 0.503 -.0185287 .0090832
        22269 1 | -.0020996 .0070439 -0.30 0.766 -.0159056 .0117064
        22270 1 | -.0049637 .0070439 -0.70 0.481 -.0187697 .0088423
        22271 1 | -.006379 .0070439 -0.91 0.365 -.0201849 .007427
        22272 1 | -.0139923 .0070439 -1.99 0.047 -.0277983 -.0001863
        22273 1 | -.0013843 .0070439 -0.20 0.844 -.0151903 .0124217
        22274 1 | -.0063288 .0070439 -0.90 0.369 -.0201348 .0074772
        22275 1 | -.0108742 .0070439 -1.54 0.123 -.0246802 .0029318
        22276 1 | -.007296 .0070439 -1.04 0.300 -.021102 .00651
        22277 1 | -.0116437 .0070439 -1.65 0.098 -.0254497 .0021623
        22278 1 | -.0102686 .0070439 -1.46 0.145 -.0240746 .0035374
        22279 1 | -.0111294 .0070439 -1.58 0.114 -.0249353 .0026766
        22280 1 | -.0034829 .0070439 -0.49 0.621 -.0172889 .0103231
        22281 1 | -.0191858 .0070439 -2.72 0.006 -.0329918 -.0053798
        22282 1 | -.0058934 .0070439 -0.84 0.403 -.0196994 .0079125
        22283 1 | -.0121037 .0070439 -1.72 0.086 -.0259097 .0017023
        22284 1 | -.0119443 .0070439 -1.70 0.090 -.0257503 .0018617
        |
        _cons | .0041367 .00249 1.66 0.097 -.0007437 .009017
        -------------+----------------------------------------------------------------
        sigma_u | .05373217
        sigma_e | .0643553
        rho | .41076238 (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        F test that all u_i=0: F(667, 63270) = 65.96 Prob > F = 0.0000

        What would be the correct model for the fixed effect then?

        Comment


        • #5
          Taiba:
          the code above makes sense if you want to go (double) -fe-.
          That said, I would explore whether two predictors only are actually enough to give a fair and true viee of the data generating process you're investigating.
          In addition (and provided what above), you may want to take a look at the community-contributed module -reghdfe-.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Hi, so I tried running the following regression:
            reghdfe movement i.date#1.treated if inrange(date,td(14april2020),td(30may2020)), absorb(date) cluster(firm)

            I remember that with my model, there is the potential of the dummy variable traps due to the days. I was wondering how I would drop a day from the regression then?
            I tried:
            reghdfe movement o22231.date#1.treated if inrange(date,td(14april2020),td(30may2020)), absorb(date) cluster(firm)

            But the first date from the range was not omitted still. Any suggestions?

            Comment


            • #7
              Taiba:
              thanks to the -i.prefix- you should not have any dummy trap issue.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                ah I see, thank you! I was wondering how I would change the regression to include the coefficient for treated within the output:

                reghdfe movement i.date#1.treated if inrange(date,td(14april2020),td(30may2020)), absorb(date) cluster(firm)

                I tried:

                reghdfe movement i.date#1.treated treated if inrange(date,td(14april2020),td(30may2020)), absorb(date) cluster(firm)
                However this omits further dates.

                Last edited by Taiba Chau; 16 May 2022, 08:47.

                Comment


                • #9
                  Is there something else I could do? Thank you

                  Comment


                  • #10
                    Taiba:
                    1) if you go 2-way fe why did you -abs(date)- only (and not firm?
                    2) as far as tha -fate- issue is concerned, what if (after -%td- or else):
                    Code:
                    reghdfe movement i.date#1.treated if >=14april2020 | <=30may2020, absorb(firm date) cluster(firm)
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      I thought since I am clustering by the firm I wouldn't have to absorb by the firm. As the coefficient for treated I tried the suggested regression:

                      reghdfe movement i.date#1.treated if date>=14april2020 & date <=30may2020, absorb(firm date) cluster(firm)

                      I still got an output but the coefficient for treated is not included

                      Comment


                      • #12
                        Taiba:
                        is it collinear with fixed effects?
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          Sorry about the very delayed response but I was able to solve the problem. I was just curious why a two-way fixed effects model would be better than a DiD estimation for this example? There is no notion of parallel trends here as I do not have a pre-period. With parallel trends, you want to show that the treated and control units were observationally equivalent in the pre-period, but none exists in your case. I understand in this case it won't work, but why is then Two way fixed effects suitable?

                          Comment


                          • #14
                            How can you impute the treatment effect without any pre-intervention data? If it's a simple "treated or not" thing, you're better off just doing propensity score matching
                            Last edited by Jared Greathouse; 19 May 2022, 10:25.

                            Comment


                            • #15
                              I was also wondering how I could then collapse this dataset to the state level, so from firms, it goes to states. Would this mean I would have to create the mean of all the variables within the model? Is the correct regression:
                              collapse (mean) movement treated, by (date, state)

                              Comment

                              Working...
                              X