Announcement

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

  • difference in difference estimator

    Hello,
    I am assessing the impact of a reform that increases the number of pharmacies that can be opened in a municipality on firm's revenues from sales.
    I am working with firm-level longitudinal data from 2011 to 2020, containing economic information of pharmacies in Italy. Since the opening of new pharmacies is decided by the local administration, then some municipalities started to open new pharmacies in 2016, others in 2017, others in 2018, others in 2019 and others in 2020. For this reason I created a treatment variable that is 1 if a firm is in a municipality when it open at least 1 new pharmacy and 0 otherwise.
    The problem is that the treatment period is different for any firm , because some are treated by the 2016 onwards, others from the 2017 onwards...
    So I have to decide which difference in differences estimation method I will use because I have a pre-treatment period (from 2011 to 2016) but I don't have a post period (because even in the treated municipalities new pharmacies continue to be opened) and the lenght of the treatment period is different for any municipality and then for any firm in my dataset.
    At the beginning I tried xtdidregress but then I thought that maybe is not the right choice and I started to think about flexpaneldid but I am not sure yet. Could you help me ?
    Thank you in advance for your help.
    Francesco

  • #2
    Your instinct to use flex panel is correct. I think you're misunderstanding DD with staggered adoption though.

    Unless you wish to model your intervention as continuous, the post intervention period does NOT refer to "the period after the treatment stops being implemented", it just refers to, in this case, the period after the first intervention happens in a given unit.

    There are literally a sea of Stata commands for this purpose. My synthetic control command for example readily accommodates staggered adoption using similar methods. perhaps FernandoRios has other thoughts on this.

    Comment


    • #3
      Thank you very much for your help.
      Do you have some suggestions of which estimation method I can use ? Because it is a little bit difficult to understand this command since there are very papers that explain it.

      Comment


      • #4
        The help file explains xtdidregress. Look up Fernando's CSDID command.

        Comment


        • #5
          Thank you Jared, I have used the CSDID command.
          first I run: csdid log_ricavi, ivar(id) time(anno) gvar(treat_group) notyet
          where Log_ricavi is the log of the revenue from sales, id is the firm identifier, anno is year, treat_group is a variable that is 0 for controls and is equal to the year of the first treatment for the treated units, I use the option "notyet" because I want to have a large control group.
          But stata told me that the "Panel is not balanced" and every variable was omitted by the estimation , then I delete the ivar variable to have a repeated cross section estimation and the command run without problems but again every variable is ommitted. I tried with different estimation methods but the final result is the same.
          How can I solve this problem ?
          I think that the strategy to use this command instead of xtdidregress is correct but I don't know what is the problem here.

          Comment

          Working...
          X