Announcement

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

  • Diff. - in Diffs. Analysis: Extend Treatment/Control Group Status across points of time in a panel dataset.

    Hello everyone,

    this is my first post in the STATALIST forum. I hope my question is accesible in terms of command presentation as well as of relevance. If there was a similar question posted elsewhere (which I could not find so far) I do am thankful for a quick hint.

    I am investigating whether the introduction of the manadatory minimum wage in Germany in 2015 had an effect on the political voting behaviour of the minimum wage affected group. To do so I am conducting a Difference-in-Differences analysis using the standard equation:

    Code:
    Yit=β1+β2(treati)+β3(timet)+ρ(treati⋅timet)+ϵit
    My problem concerns the time dimension. I am using a panel dataset (the German Socioeconomic Panel) which fortunately contains data on the voting behaviour and gross hourly wages from 1984 to 2020.

    To assign the treatment and control group status I used the follwing code

    Code:
    gen treatment = 1 if grosshourlywageact < 8.5 & syear == 2014
    replace treatment = 0 if grosshourlywageact >= 8.5 &grosshourlywageact !=. & syear == 2014
    This was done so since I, reasonably I guess, assume that an affection of the minimum wage can be determined based on the latest availabe pre-reform wage, which was the year 2014. It is assumed that those earning wages below 8.50€ in 2014 will receive the minimum wage in 2015. Using an earlier year for the treatment assignment would be unreasonable from that calculus.

    Here comes the problematic part: Doing so assigns the treatment (1) and control group status (0) only for the year 2014, for the diff.-in.-diffs. analysis (and the testing of the parallel trends assumption) I however need to extend those treatment status assignments to all survey years from 2005 to 2020. Putting it differently, I need to "delete" the time dimension of the assignment coded above but keep the personal identificator numbers since they constitute my representative treatment and control group.

    Has anyone faced a similar problem or any solutions for this? I guess it might be a common problem to D-i-D estimations with panel data, I have however neither found any similar posts nor any helpful online articles.

    Looking very forward to a response.

    Best,
    Jakob
    Last edited by Jakob Weber; 18 Jul 2022, 05:50.

  • #2
    Jakob, to extend the group assignment of an individual in 2014 to other years, you may use the code below after the two lines of code in #1

    Code:
    bys id (treatment): replace treatment = treatment[_n-1] if mi(treatment)
    BTW, "id" is the individual identifier in your data.

    Comment


    • #3
      Dear Fei,

      this totally solved the issue. Thank you so much!

      Best,
      Jakob

      Comment

      Working...
      X