Announcement

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

  • CSDID Omitted results.

    Hello,

    I am trying to use the csdid command (Callaway & Sant'Anna 2021) with a monthly panel dataset but all ATT(g,t) coefficients are returned as zero (omitted) and I cannot identify the cause.

    **Setup**
    - Stata 16.1
    - csdid and drdid installed from SSC
    - Panel data: borrower-level monthly observations
    - 6 treated cohorts entering the program in Jan–Jun 2025 (cohort_num 1–6)
    - 1 never-treated control group (cohort_num 0)
    - Time variable: sequential integer months (2024m7 = 1, 2024m8 = 2, ... 2025m11 = 17)
    - Data spans 2024m7 to 2025m11 (17 months total)

    **Variable construction**

    gen int ym_csdid = int(ym) - 772 // sequential: 2024m7=1 to 2025m11=17
    gen int entry_ym_csdid = 0
    replace entry_ym_csdid = int(ym(2025, cohort_num)) - 772 if cohort_num >= 1 & cohort_num <= 6
    // Results in: cohort1=7, cohort2=8, cohort3=9, cohort4=10, cohort5=11, cohort6=12

    xtset panel_id ym_csdid
    // panel variable: panel_id (unbalanced)
    // time variable: ym_csdid, 1 to 17, delta 1 unit

    **tab ym_csdid entry_ym_csdid (0.1% sample by cohort and control, ~5,000 obs)**

    Sequential |
    month: |
    2024m7=1, |
    2024m8=2, | entry_ym_csdid
    ... | 0 7 8 9 10 11 | Total
    -----------+------------------------------------------------------------------+----------
    1 | 191 24 29 22 16 12 | 304
    2 | 191 24 29 22 16 12 | 304
    3 | 191 24 29 22 16 12 | 304
    4 | 191 24 29 22 16 12 | 304
    5 | 190 24 29 22 16 12 | 303
    6 | 188 24 29 22 16 12 | 301
    7 | 184 24 29 22 16 12 | 297
    8 | 182 24 29 22 16 12 | 295
    9 | 182 24 29 22 16 12 | 295
    10 | 179 24 29 22 16 12 | 292
    11 | 178 24 29 22 16 12 | 291
    12 | 176 24 29 22 16 12 | 289
    13 | 176 23 29 22 16 12 | 288
    14 | 175 23 29 22 16 12 | 287
    15 | 175 23 29 22 16 12 | 287
    16 | 172 23 29 22 16 12 | 284
    17 | 172 23 29 22 16 12 | 284
    -----------+------------------------------------------------------------------+----------
    Total | 3,093 403 493 374 272 204 | 5,009


    Sequential |
    month: |
    2024m7=1, | entry_ym_c
    2024m8=2, | sdid
    ... | 12 | Total
    -----------+-----------+----------
    1 | 10 | 304
    2 | 10 | 304
    3 | 10 | 304
    4 | 10 | 304
    5 | 10 | 303
    6 | 10 | 301
    7 | 10 | 297
    8 | 10 | 295
    9 | 10 | 295
    10 | 10 | 292
    11 | 10 | 291
    12 | 10 | 289
    13 | 10 | 288
    14 | 10 | 287
    15 | 10 | 287
    16 | 10 | 284
    17 | 10 | 284
    -----------+-----------+----------
    Total | 170 | 5,009

    **Command used**

    csdid repayment, ivar(panel_id) time(ym_csdid) gvar(entry_ym_csdid) method(dripw) notyet

    **Result**

    All ATT(g,t) coefficients are 0 (omitted) across all 6 groups and all time periods. Number of obs = ~4,600. No x marks (estimation did not fail), but no estimates either.

    Number of obs = 4,694
    Outcome model : least squares
    Treatment model: inverse probability
    ------------------------------------------------------------------------------
    | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    g7 |
    t_1_2 | 0 (omitted)
    t_2_3 | 0 (omitted)
    t_3_4 | 0 (omitted)
    t_4_5 | 0 (omitted)
    t_5_6 | 0 (omitted)
    t_6_7 | 0 (omitted)
    t_6_8 | 0 (omitted)
    t_6_9 | 0 (omitted)
    t_6_10 | 0 (omitted)
    t_6_11 | 0 (omitted)
    t_6_12 | 0 (omitted)
    t_6_13 | 0 (omitted)
    t_6_14 | 0 (omitted)
    t_6_15 | 0 (omitted)
    t_6_16 | 0 (omitted)
    t_6_17 | 0 (omitted)
    -------------+----------------------------------------------------------------
    ----------and so on, so on--------------

    I have also tried:
    - never instead of notyet
    - Running without any covariates
    - Converting time and gvar to integer storage type (was float before)
    - Using the original %tm integer values (774–790) instead of sequential 1–17
    - Reducing to 0.1% stratified sample by cohort

    None of these resolved the issue.

    For reference, I confirmed csdid works correctly on the mpdta example dataset on a separate machine (Stata 14), producing real estimates with no omissions.

    The tab pattern looks similar to the working mpdta example. I cannot identify what structural difference in my data is causing all cells to be omitted.

    Any help would be greatly appreciated.

    Thank you.

  • #2
    That is a very odd situation, and no idea why it wouldnt work.
    As you suggest, this needs some manual exploration on the data, which could show some indications of where the error comes
    just to confirm, you are sure your panel id is correctly set up?
    can you try doing this manually? (even if for 1 unit

    you could also start by
    1)define your full panel data (manually)
    2) estimate your average output across time and cohort.

    Then try to do csdid again with this data.

    Other than that. not sure what else could be dirving the results

    Comment


    • #3
      For a particular problem, when I add control variables my z values blow up. I have looked at the data, and I cannot figure out what is going on. Any suggestions of what to check? Any potential fixes? (The number of observations, 18,246, does not change according specifications.)

      csdid cr if part == 1, ivar(fips) time(year) gvar(yy) method(drimp)

      g2008 |
      t_2000_2001 | .1672812 .0273656 6.11 0.000 .1136457 .2209167
      t_2001_2002 | -.1075658 .031715 -3.39 0.001 -.1697261 -.0454055

      csdid cr lpop pblack phisp if part == 1, ivar(fips) time(year) gvar(yy) method(drimp)
      t_2000_2001 | .1840816 . . . . .
      t_2001_2002 | 65.80876 3.57e-11 1.8e+12 0.000 65.80876 65.80876

      Comment


      • #4
        I did the same problem using xthdidregress, and I did not have this problem

        Comment


        • #5
          Need to use long2 option to match xthdidregress

          Comment

          Working...
          X