Announcement

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

  • Diffrence-in-Diffrence Estimation with Panel Data

    Hey, I'm trying to estimate a simple DID regression on my panel data (400 observations from 2000-2022). I have created a Dummy variable for Treatment and a Dummy variable for Time (Post=1 and Pre=0) and an interaction term between Treatment and Post. My treatment started in 2016. I used this command to estimate my DID :

    xtdidregress (all) (treatpost), group(K_id) time(period)

    where "period" is the time variable, "K_id" is the Id for each observation in my sample and "all" is the dependent variable.

    My question is the following:

    When I enter this command, Stata uses only one period for pre-treatment (2000) and also only one period for after-treatment (2016). What I need is that it uses all of my pre and post-treatment periods for the estimation.

    Click image for larger version

Name:	Question.png
Views:	1
Size:	27.6 KB
ID:	1750946


    How can I change that? What do I miss?

    Thanks very much in advance.

  • #2
    The treatment variable is meant to be a dummy variable. You do not use the interaction with this specific command, Stata does this under the hood.

    Comment


    • #3
      thanks for your advice! The treatment is a dummy variable, it is coded 1 or 0 if the observation (in my case the region) is on the treatment or not. The variable treatpost is the interaction between treatment and another dummy for Time. It separates the periods into pre (before 2016) and post (after 2016). Should I just use the treatment variable in this model and drop the interaction term? or should I use a different command?
      My major problem is that Stata uses only period 2000 as the pre-treatment period and 2016 as the post-treatment period.

      Thanks again.

      Comment


      • #4
        Hi Mary,

        Stata uses all the time periods. If you look at the methods and formulas section, you will see how it is implemented. The table you present just illustrates a treatment timing summary. In particular, it shows if the time of treatment varies.

        Comment


        • #5
          Alright, thank you very much for your help.

          Comment

          Working...
          X