Announcement

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

  • Difference-in-difference in unbalanced Panel*

    I have an unbalanced dataset of 8,000 observations for 2,000 IDs:

    xtset id year
    panel variable: id (unbalanced)
    time variable: year, 2006 to 2017, but with gaps
    delta: 1 unit

    I have a policy changed that occurred in 2014. I created the time and the ID effects and ran the following Difference in Difference to calculate the effect on takeup:

    xtreg takeup i.treated##i.post14

    Is this the right code, or should add at the end:RE, FE, R, or other options?
    Thanks,
    Last edited by John Matrix; 27 Jun 2018, 13:58.

  • #2
    The commands you show specify a correct model for calculating a DID effect, assuming that you have appropriately defined your treated and post14 variables.

    With no options specified, Stata will assume by default that you want a random effects (re) estimator and the ordinary VCE estimator. If you want robust VCE estimation or fixed effects (fe) estimation you must specify those as options.

    Whether you need fixed effects or (cluster) robust estimation depends on details of your problem and specifics of your data, and may also need to reflect the expectations of readers in your discipline.

    Comment


    • #3
      Thank you. Do you suggest a good reading to when I use DiD with Fixed vs. random, ordinary vs. robust? or should I run all of these then choose the one with best fit? Thank you.

      Comment


      • #4
        These issues are not specific to DID estimation: they are general. I suggest that you explore these issues in a basic textbook from your discipline, as there are different "traditions" and preferences in different disciplines about these matters. For example, if you work in economics or finance, consult a widely used econometrics text, etc.

        Comment


        • #5
          Thank you

          Comment

          Working...
          X