Announcement

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

  • Difference-in-Differences (DID) with varying treatment intensity at different times

    Dear all,

    I am struggling to find the best way, if any, to use difference-in-differences (DID) to analyze this data.

    The observations regard districts in a city, counting how many times public urban renovation has happened in each district. The data begins in 2011 and finish in 2021. Throughout this time, each district may have had 1 or more instances of renovation, happening in different years, eventually adding up. Some districts had 0 interventions.

    Can I use a DID to study the effect of this treatment? The dependent variable is the housing costs in each district.

    This is an example of my treatment data:
    ID Number_of_interventions Year_of_each_intervantion
    21 5 2015-16-19-20-21
    11 3 2018-20-20-20
    35 4 2018-18-19-20
    59 4 2017-17-20-20
    1 3 2018-19-20
    22 3 2019-19-20
    44 3 2015-15-19
    57 3 2015-19-19
    85 3 2015-16-18
    49 2 2017-18
    9 2 2018-19
    14 2 2019-20
    23 3 2016-18
    31 2 2016-16
    33 2 2017-20
    42 2 2018-19
    51 2 2019-19
    56 2 2020-20
    71 2 2016-17
    76 2 2017-17
    77 2 2014-17
    2 1 2016
    4 1 2018
    5 1 2019
    6 1 2013
    73 0
    74 0
    75 0
    78 0
    80 0
    81 0
    83 0
    84 0
    86 0
    87 0
    88 0

  • #2
    Yes, in principle, if you reformat the data. However, your post alone does not answer whether a DID approach is most suitable.

    See:

    Code:
     
     ssc install did_multiplegt   help did_multiplegt
    You should certainly test for pre-trends, it is likely that renovation decisions correlate with price trends.

    Comment


    • #3

      Dear Danile, thank you so much for your answer. I cannot view the code after "See:", perhaps it's my computer's problem?

      Comment


      • #4
        Not sure why that is, but it states:

        ssc install did_multiplegt
        help did_multiplegt

        You can also find more information on the related github: https://github.com/chaisemartinPacka...legt/tree/main

        Comment


        • #5
          Dear Daniel, thank you for this. I have been trying to use did_multiplegt, with the dyn mode, but the results have been weird. The graph output looks like the attached image. I think there may have been issues with the way I reformatted the data. I formatted them increasing the treatment variable by one when a new renovation was made in the district, and they look like this:
          id_nil year treatment
          1 2015 0
          1 2016 0
          1 2017 0
          1 2018 1
          1 2019 2
          1 2020 3
          1 2021 3
          1 2022 3
          1 2023 3
          The command is as follows

          Code:
           did_multiplegt (dyn) housingcost id year treatment,  controls(residents immigrants)
          Do you have any idea why it is not working?

          Thank you so much!


          Click image for larger version

Name:	Screenshot 2024-08-28 alle 17.20.23.png
Views:	1
Size:	277.3 KB
ID:	1762559

          Comment

          Working...
          X