Announcement

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

  • Year effect estimation with quarterly data - CSDID

    Hi FernandoRios,

    I've got a question about how to apply the CSDID command in a particular scenario. I have a dataset at the bank-quarter level and got results at that level, but since they are too noisy, I want to estimate the yearly average effect. I've tried to do this multiple times but it seems that is not possible using the command. Besides collapsing at the bank-year level, is there any other way to do this?

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float credit byte lender int(quarter quarter_accreditation year year_accreditation)
    17.599712  9 237 242 2019 2020
    16.401138  9 244 242 2021 2020
    16.729103  9 249 242 2022 2020
    16.502031  9 253 242 2023 2020
    17.239132  9 250 242 2022 2020
    16.877142  9 229 242 2017 2020
    17.684282  9 231 242 2017 2020
    17.483181  9 232 242 2018 2020
    17.181269  9 230 242 2017 2020
    17.988262  9 238 242 2019 2020
    17.038946  9 245 242 2021 2020
     17.52346  9 242 242 2020 2020
    16.713648  9 251 242 2022 2020
    16.557573  9 246 242 2021 2020
    17.778282  9 239 242 2019 2020
     16.56822  9 255 242 2023 2020
    17.035572  9 254 242 2023 2020
    17.331198  9 248 242 2022 2020
     17.43966  9 241 242 2020 2020
    17.580435  9 247 242 2021 2020
    17.785347  9 240 242 2020 2020
     16.93023  9 252 242 2023 2020
    17.531118  9 243 242 2020 2020
    17.485992  9 233 242 2018 2020
      17.4427  9 235 242 2018 2020
    16.903175 10 247   0 2021    0
    17.104927 10 246   0 2021    0
    15.861592 10 234   0 2018    0
    16.303251 10 230   0 2017    0
     14.70087 10 231   0 2017    0
     17.03864 10 239   0 2019    0
    15.751642 10 236   0 2019    0
    16.990808 10 248   0 2022    0
     16.51147 10 245   0 2021    0
    17.197304 10 254   0 2023    0
    15.322653 10 240   0 2020    0
      14.7455 10 244   0 2021    0
    16.961636 10 228   0 2017    0
     16.27355 10 233   0 2018    0
    17.474955 10 253   0 2023    0
    17.450285 10 242   0 2020    0
    15.790751 10 243   0 2020    0
    17.231977 10 249   0 2022    0
    17.364998 10 250   0 2022    0
    17.487429 10 255   0 2023    0
     16.67107 10 237   0 2019    0
    14.479133 10 232   0 2018    0
    17.232767 10 252   0 2023    0
    17.700909 10 251   0 2022    0
     17.11386 10 229   0 2017    0
    16.571762 10 238   0 2019    0
    17.705097 10 241   0 2020    0
    16.134617 10 235   0 2018    0
    10.385914 11 236   0 2019    0
    11.101312 11 251   0 2022    0
      13.1572 11 233   0 2018    0
    12.178016 11 252   0 2023    0
    15.029334 11 240   0 2020    0
     13.16938 11 253   0 2023    0
     13.81551 11 230   0 2017    0
    12.608533 11 238   0 2019    0
    10.571317 11 229   0 2017    0
    14.053068 11 237   0 2019    0
    15.701763 11 243   0 2020    0
    12.904926 11 234   0 2018    0
     13.77781 11 235   0 2018    0
     10.12663 11 231   0 2017    0
    13.433596 11 232   0 2018    0
    12.588402 11 255   0 2023    0
    15.916498 11 241   0 2020    0
    16.035383 11 242   0 2020    0
    15.049068 11 239   0 2019    0
            . 11 244   0 2021    0
    12.203043 11 254   0 2023    0
    11.066638 11 228   0 2017    0
     17.55722 12 238 249 2019 2022
    17.222298 12 246 249 2021 2022
    16.845688 12 230 249 2017 2022
     19.12043 12 251 249 2022 2022
    17.117624 12 234 249 2018 2022
    16.922073 12 231 249 2017 2022
    18.616293 12 249 249 2022 2022
    18.747732 12 250 249 2022 2022
    18.994743 12 252 249 2023 2022
    17.566483 12 236 249 2019 2022
    18.438084 12 248 249 2022 2022
    17.701353 12 247 249 2021 2022
    17.318092 12 233 249 2018 2022
    17.212387 12 242 249 2020 2022
    16.955214 12 232 249 2018 2022
    17.549284 12 237 249 2019 2022
    16.753258 12 229 249 2017 2022
    16.788864 12 241 249 2020 2022
    17.111528 12 245 249 2021 2022
    16.746674 12 255 249 2023 2022
    16.580389 12 228 249 2017 2022
    17.593071 12 239 249 2019 2022
    17.210438 12 254 249 2023 2022
    17.647118 12 253 249 2023 2022
    16.921915 12 244 249 2021 2022
    end
    My code that estimates results at the quarter level is as follows:
    Code:
    csdid credit, i(lender) time(quarter) gvar(quarter_accreditation) notyet rseed(654252) agg(simple) wboot(rseed(6589652)) 
    estat event, estore(csdd)
    event_plot csdd, stub_lag(Tp#) stub_lead(Tm#)
    and the code I've used to perform unsuccessfully the yearly analysis was
    Code:
    csdid credit, i(lender) time(year) gvar(year_accreditation) notyet rseed(654252) agg(simple) wboot(rseed(6589652))
    Thanks!
Working...
X