Announcement

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

  • DID analysis including time-varying covariates

    Hi. I'm studying Difference-in-Differences and have read Zeldow&Hatfield(2021) that is about the method of correcting bias due to observed confounders.
    In the article, I understand that when there are time-varying covariates which means evolve differently by group, they confound the treatment effect so that you must adjust for the interaction of a covariate and time(time-varying adjusted model).
    Time-varying adjusted model allows the coefficient on the covarite to vary over time.

    I know the commands 'didregress' and 'xtdidregress' fit DID models in STATA17.
    But I'm not familiar with the commands yet.

    Do the commands 'didregress' and 'xtdidregress' can fit time-varying adjusted DID models?


    (I'm not good at english. I'm sorry if you cannot understand my writing and if needed, I would explain or add some details.)

  • #2
    I understand you fine, but I don't understand the problem. You can add covariates to xtdidreg if you choose to.

    Comment


    • #3
      Thank you for answering, Mr. Greathouse.

      In the article(Zeldow&Hatfield, 2021),
      the covariate adjusted model is adjusted for the covariate with a constant coefficient(λxit)
      and the time-varying adjusted model allows the coefficient on the covariate(λtxit) to vary over time.

      I want to fit the time-varying adjusted model with STATA.
      But the model to fit with the command '(xt)didregress' is like below according to "STATA TREATMENT-EFFECTS REFERENCE MANUAL" distributed by STATA Corp.,

      yist = γs + γt + zistβ + Dstδ + εist

      In the model, the coefficient of covariates is not "βt" but "β". So, I understood the model is not adjusted for time-varying confounders.



      Last edited by Kyle Lee; 24 Oct 2022, 19:48.

      Comment


      • #4
        Just use an interaction term between time and your predictor
        Code:
        i.time##c.var

        Comment


        • #5
          Thank you very much, Mr. Greathouse!
          Your reply is very helpful.

          Comment

          Working...
          X