Announcement

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

  • didregress vs xtreg fe for did analysis

    Panel data:1600 firms, 8 years, and 6 variables.
    I have a time-based treatment dummy variable (pre and post-treatment), a group dummy variable (healthy and unhealthy), and a non-control continuous independent variable along with other independent variables acting as control variables. The non-control continuous independent variable has to interact with the other two dummy variables.
    I want to ask whether I should go with the

    didregress model
    or

    xtreg,fe model where I can create dummy interactions like

    xtreg dep noncontrolindep controlindep i.treatmentdummy##i.groupdummy##c.non-controlcontiniousindependenttvariable, fe

    Thanks
    Last edited by Pranshu Tripathi; 17 Nov 2022, 01:19. Reason: Adding further information

  • #2
    Pranshu:
    I would go -didregress- or -xtdidregress- as per your dataset.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Okay, Carlos.

      I have a few other questions, and please take into consideration that I have panel data.

      If I do any one of these, then the model would be

      didregress (outcome) (treatment_indicator), group(firm) time(timevar)

      or


      xtdidregress (outcome) (treatment_indicator), group(firm) time(timevar).




      1) Are they both the same?

      2) why"xtreg dep noncontrolindep controlindep i.treatmentdummy##i.groupdummy##c.non-controlcontiniousindependenttvariable, fe" is not right?

      3)
      How to generate treatment_indicator. (I have created a dummy of the years based on a law passed in 2016. So, pre-2016 is pre-treatment (1), and post-2016 (2) is post-treatment. But these dummies have been generated in an excel sheet).

      4. group(firm) means that group dummy where the firm is either healthy (1) or unhealthy(2). So do I have to go with group(groupdummy)?

      5. Can we do a fixed effect regression with any one of these? (didregress/xtregress (outcome) (treatment_indicator), group(firm) time(timevar),fe?
      5a. Can we cluster for errors into the model in the 5th point?

      Comment


      • #4
        Pranshu:
        1) no, they are not. The two commands were developed for repeated cross-sectional studies and panel datasets DID, respectively. Therefore, as per your description, I would go -xtdidregress-;
        2) I do not comment on the correctness of your -xtreg,fe- code, but I'm curious about an effective way of communicating a three-way interactions. Again, I'd stick with -xtdidregress-;
        3) can't you simply import or, at worst, copy and paste it in a .dta file?;
        4) you can add healthy 0/1 as a categorical predictor between brackets just after the -outcome-;
        5) no;
        5a) see -Standard error considerations- paragraph in -DID intro-, Stata .pdf manual-
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thanks, Carlos. You are a savior.
          Regards.

          Comment

          Working...
          X