Announcement

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

  • Panel: setting one year as the reference year.

    Dear statalist community,
    I am conducting an analysis on green tariffs and renewable rebounds. Precisely, I want to understand whether households that switched to a green tariff tend to consume more electricity than people who use grey energy.
    The dataset that I am using is the German Socio-Economic Panel.
    What I want to do is to set the year of the switch as the reference year for each household. So, for example, household 1 switched to a green tariff in 2012. Therefore, 2012 = 0, 2013 = 1, 2014 = 2 and 2011 = -1, 2020 = -2. On the other hand, household 2 switched to a green tariff in 2013. So, 2013 = 0, 2014 = 1, 2015 = 2, and 2012 = -1.
    How can I do this on Stata?
    There is anyone who is able to help me?

    Thank you very much!

  • #2
    You probably will want to create an indicator (=0 for years prior to the switch and =1 for the year of the switch and subsequent years) and then use this as your treatment variable. Otherwise, without a data example, offering specific code is difficult. After opening your dataset, copy and paste the result of

    Code:
    dataex in 1/30

    Comment


    • #3
      Alessandra:
      welcome to this forum.
      As an aside to Andrew's helpful advice, you seem to be after a diff-in-diff design: green energy yes/no (treated/untreated group) before/after the chance of switching from traditional to green energy (before/after).
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment

      Working...
      X