Announcement

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

  • Csdid: Unbalaced panel with covariates

    I have an unbalanced panel with observations at the provincial level from 2006 to 2023. I want to estimate the effect of a treatment that is introduced from 2014 onward. 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 My baseline model is the following:
    Code:
    set seed 1
    gen sample = runiform()<.9
    csdid y if sample==1  , cluster(id) time(year) gvar(treat)
    I then wanted to include a dummy variable equal to one for the years 2020–2021 (Covid-19 pandemic), but the results remain unchanged.

    I suspect that this might be due to an insufficient number of observations during those years.

    Code:
    ------------------------------------------------------------
           | first_t                                            
      year |   0   2014  2015  2016  2017  2018  2019  2020  Total
    -------+------------------------------------------------------
      2006 |  10     1     2    30    25    10     7     4    102
      2007 |  11     1     2    30    25    10     7     4    103
      2008 |  12     1     2    30    25    10     7     4    104
      2009 |  12     1     2    30    25    10     7     4    104
      2010 |  12     1     2    30    25    10     7     4    104
      2011 |  12     1     2    31    26    10     7     4    107
      2012 |  12     1     2    31    26    10     7     4    107
      2013 |  12     1     2    31    26    10     7     4    107
      2014 |  12     1     2    31    26    10     7     4    107
      2015 |  12     1     2    31    26    10     7     4    107
      2016 |  12     1     2    31    26    10     7     4    107
      2017 |  12     1     2    31    26    10     7     4    107
      2018 |  12     1     2    31    26    10     7     4    107
      2019 |  12     1     2    31    26    10     7     4    107
      2020 |  12     1     2    31    26    10     7     4    107
      2021 |  12     1     2    31    26    10     7     4    107
      2022 |  12     1     2    31    26    10     7     4    107
      2023 |  12     1     2    31    26    10     7     4    107
    -------+------------------------------------------------------
    Total  | 213    18    36   553   463   180   126    72   1,908
    ------------------------------------------------------------
    
    ----------------------------------
           | first_t                
      year |  2021   2022   Total    
    -------+--------------------------
      2006 |   11      2     102    
      2007 |   11      2     103    
      2008 |   11      2     104    
      2009 |   11      2     104    
      2010 |   11      2     104    
      2011 |   12      2     107    
      2012 |   12      2     107    
      2013 |   12      2     107    
      2014 |   12      2     107    
      2015 |   12      2     107    
      2016 |   12      2     107    
      2017 |   12      2     107    
      2018 |   12      2     107    
      2019 |   12      2     107    
      2020 |   12      2     107    
      2021 |   12      2     107    
      2022 |   12      2     107    
      2023 |   12      2     107    
    -------+--------------------------
    Total  |  211     36   1,908    
    ----------------------------------
    Suggestions?
    Thanks.
Working...
X