Announcement

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

  • Unbalanced panel using CSDID

    Hello,

    I am working on a project where I am trying to estimate how one change in electoral rules affects party competition. The electoral change is observed only at the regional level but also in multiple time periods. The unit of analysis is the election observed in each of the regions included in my study but those elections take place in different times and and with a different frequency. A distribution of the treatment based on when the electoral change was first implemented is shown in the below table where 0 indicates cases where no reforms took place and year indicate the period when the electoral change took place.

    Code:
    first_treat |      Freq.     Percent        Cum.
    ------------+-----------------------------------
              0 |         65       41.94       41.94
           1999 |         35       22.58       64.52
           2011 |         19       12.26       76.77
           2014 |         18       11.61       88.39
           2017 |         18       11.61      100.00
    ------------+-----------------------------------
          Total |        155      100.00
    My empirical strategy is based on estimating a DiD and I was hoping to use command CSDID developed by FernandoRios based on Callaway and Sant'Anna (2021) to account for multiple time periods. The model, however, cannot be estimated as the panel is not balanced. Any suggestion about how to solve this problem?

    Many thanks.

    Best wishes,
    Rubén

  • #2
    There should be no issues with unbalanced panel.
    what do you get if you type
    tab year first_treat

    also, are you trying to include covariates from the start?

    Comment


    • #3
      Thank you for your answer FernandoRios.

      The crosstab of year and first_treat is the following

      Code:
                 |                 first_treat
       elec_year |         0       1999       2015       2018 |     Total
      -----------+--------------------------------------------+----------
            1991 |         2          0          2          0 |         4 
            1993 |         1          0          0          0 |         1 
            1994 |         1          2          0          1 |         4 
            1995 |         0          0          1          0 |         1 
            1996 |         1          0          1          0 |         2 
            1997 |         1          0          0          0 |         1 
            1998 |         1          0          0          0 |         1 
            1999 |         1          2          0          1 |         4 
            2000 |         0          0          2          0 |         2 
            2001 |         1          0          0          0 |         1 
            2003 |         2          1          0          0 |         3 
            2004 |         1          1          0          1 |         3 
            2005 |         1          0          2          0 |         3 
            2008 |         1          1          0          0 |         2 
            2009 |         2          1          0          1 |         4 
            2010 |         1          0          2          0 |         3 
            2013 |         1          2          0          1 |         4 
            2014 |         1          0          0          0 |         1 
            2015 |         2          0          2          0 |         4 
            2018 |         1          2          0          1 |         4 
            2019 |         1          0          1          0 |         2 
            2020 |         1          0          1          0 |         2 
            2021 |         1          0          0          0 |         1 
            2022 |         0          1          0          0 |         1 
            2023 |         1          1          0          1 |         3 
            2024 |         1          0          1          0 |         2 
      -----------+--------------------------------------------+----------
           Total |        27         14         15          7 |        63
      I did not use any covariates from the start, the specification that I tried is what is suggested in the help documentation about estimation with repeated crossection estimators
      Code:
      set seed 1
      gen sample = runiform()<.9
      
      csdid  depvar if sample==1, cluster(id) time(year) gvar(first_treat) method(dripw)
      where id is numerical id for my unit of analysis.

      The model does not run most likely because of numbers of singleton and little variation. But, then, what would be the best estimation strategy that I could use?

      Again, many thanks!
      Best,
      Rubén

      Comment


      • #4
        For the data you have, I dont think any of the methods that have been developed for DID and staggered analysis would work.
        It may be easier to do the estimations manually. Since there is no gain from trying to estimate SE in this setup. Or that is my opinion.
        Also, with this data, you dont have any room for covariates.

        Comment


        • #5
          Hi FernandoRios, that is also what I thought. Thank you very much for your nice and generous help. Best, Rubén

          Comment

          Working...
          X