Announcement

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


  • Hi Fernando,

    I’m encountering an issue with the long2 command—it seems to be dropping some years from my dataset, and I haven’t been able to determine why. Could you help me figure out the cause?

    I’m working with SIPP data, which is a rotating panel. Could that be a factor in this issue?

    Thanks in advance for your help!


    [CODE]

    csdid creditcarddebt_log [weight=hweight] , ivar(hid) time(year) gvar(o_year) notyet
    (importance weights assumed)
    (importance weights assumed)
    Panel is not balanced
    Will use observations with Pair balanced (observed at t0 and t1)
    ...xxxxxx...x...xx...x...xx...x........x........x.
    ....(4 missing values generated)

    Difference-in-difference with Multiple Time Periods

    Number of obs = 43,022
    Outcome model : regression adjustment
    Treatment model: none
    ------------------------------------------------------------------------------
    | Coefficient Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    g2018 |
    t_2014_2015 | .1288567 .1257227 1.02 0.305 -.1175552 .3752686
    t_2015_2016 | -.011361 .1339865 -0.08 0.932 -.2739697 .2512477
    t_2016_2017 | .1221403 .1358202 0.90 0.369 -.1440623 .3883429
    t_2017_2018 | 0 (omitted)
    t_2017_2019 | 0 (omitted)
    t_2017_2020 | 0 (omitted)
    t_2017_2021 | 0 (omitted)
    t_2017_2022 | 0 (omitted)
    t_2017_2023 | 0 (omitted)
    -------------+----------------------------------------------------------------
    g2019 |
    t_2014_2015 | -.0540998 .0685279 -0.79 0.430 -.188412 .0802123
    t_2015_2016 | .0822121 .0730696 1.13 0.261 -.0610017 .2254259
    t_2016_2017 | .0206096 .0727599 0.28 0.777 -.1219971 .1632163
    t_2017_2018 | 0 (omitted)
    t_2018_2019 | -.0477295 .0678176 -0.70 0.482 -.1806495 .0851906
    t_2018_2020 | .022488 .0821306 0.27 0.784 -.138485 .1834609
    t_2018_2021 | -.0504147 .0997901 -0.51 0.613 -.2459997 .1451702
    t_2018_2022 | 0 (omitted)
    t_2018_2023 | 0 (omitted)
    -------------+----------------------------------------------------------------
    g2020 |
    t_2014_2015 | .1201289 .0676236 1.78 0.076 -.0124109 .2526686
    t_2015_2016 | -.1726418 .0733755 -2.35 0.019 -.3164551 -.0288285
    t_2016_2017 | .025222 .0771589 0.33 0.744 -.1260067 .1764508
    t_2017_2018 | 0 (omitted)
    t_2018_2019 | .016374 .1043152 0.16 0.875 -.1880799 .220828
    t_2019_2020 | -.0252896 .0932367 -0.27 0.786 -.2080301 .1574508
    t_2019_2021 | .2404562 .1137706 2.11 0.035 .01747 .4634425
    t_2019_2022 | 0 (omitted)
    t_2019_2023 | 0 (omitted)
    -------------+----------------------------------------------------------------
    g2021 |
    t_2014_2015 | .0188281 .0717065 0.26 0.793 -.1217141 .1593703
    t_2015_2016 | -.0830524 .0781733 -1.06 0.288 -.2362692 .0701645
    t_2016_2017 | .0437133 .0781423 0.56 0.576 -.1094427 .1968694
    t_2017_2018 | 0 (omitted)
    t_2018_2019 | -.0929588 .0826294 -1.13 0.261 -.2549095 .0689919
    t_2019_2020 | .05824 .0907386 0.64 0.521 -.1196044 .2360843
    t_2020_2021 | -.089361 .0767514 -1.16 0.244 -.239791 .061069
    t_2020_2022 | .3382623 .1501639 2.25 0.024 .0439465 .6325781
    t_2020_2023 | .274011 .205645 1.33 0.183 -.1290458 .6770679
    -------------+----------------------------------------------------------------
    g2022 |
    t_2014_2015 | -.008298 .0802026 -0.10 0.918 -.1654923 .1488963
    t_2015_2016 | .0440349 .0866937 0.51 0.611 -.1258817 .2139514
    t_2016_2017 | .0201032 .081277 0.25 0.805 -.1391967 .1794032
    t_2017_2018 | 0 (omitted)
    t_2018_2019 | .0484307 .0830982 0.58 0.560 -.1144388 .2113002
    t_2019_2020 | -.0461753 .0932762 -0.50 0.621 -.2289932 .1366427
    t_2020_2021 | -.1121791 .0849456 -1.32 0.187 -.2786694 .0543112
    t_2021_2022 | -.0251153 .1205218 -0.21 0.835 -.2613338 .2111031
    t_2021_2023 | .0934505 .1449315 0.64 0.519 -.1906101 .3775112
    -------------+----------------------------------------------------------------
    g2023 |
    t_2014_2015 | .1603671 .1059174 1.51 0.130 -.0472272 .3679614
    t_2015_2016 | .169297 .1126223 1.50 0.133 -.0514387 .3900326
    t_2016_2017 | -.0347464 .1174833 -0.30 0.767 -.2650095 .1955167
    t_2017_2018 | 0 (omitted)
    t_2018_2019 | .0845053 .1107733 0.76 0.446 -.1326064 .3016171
    t_2019_2020 | .0161582 .1263434 0.13 0.898 -.2314704 .2637868
    t_2020_2021 | -.1116175 .1313876 -0.85 0.396 -.3691324 .1458974
    t_2021_2022 | -.0370114 .1881763 -0.20 0.844 -.4058301 .3318074
    t_2022_2023 | -.1439625 .1314627 -1.10 0.273 -.4016247 .1136997
    ------------------------------------------------------------------------------
    Control: Not yet Treated

    See Callaway and Sant'Anna (2021) for details

    . estat event
    ATT by Periods Before and After treatment
    Event Study:Dynamic effects
    ------------------------------------------------------------------------------
    | Coefficient Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    Pre_avg | .0263242 .0186142 1.41 0.157 -.0101589 .0628074
    Post_avg | .0387251 .0463956 0.83 0.404 -.0522086 .1296588
    Tm8 | .1603671 .1059174 1.51 0.130 -.0472272 .3679614
    Tm7 | .0447273 .0654551 0.68 0.494 -.0835624 .173017
    Tm6 | .0193928 .0508632 0.38 0.703 -.0802972 .1190828
    Tm5 | .0178399 .0448449 0.40 0.691 -.0700545 .1057343
    Tm4 | -.0342753 .0396317 -0.86 0.387 -.111952 .0434014
    Tm3 | .0613735 .0407487 1.51 0.132 -.0184925 .1412395
    Tm2 | -.0438213 .0424084 -1.03 0.301 -.1269403 .0392977
    Tm1 | -.0150102 .0488613 -0.31 0.759 -.1107767 .0807563
    Tp0 | -.0683828 .0408175 -1.68 0.094 -.1483837 .011618
    Tp1 | .1377402 .0584609 2.36 0.018 .023159 .2523213
    Tp2 | .046818 .0943233 0.50 0.620 -.1380524 .2316883
    ------------------------------------------------------------------------------






    csdid creditcarddebt_log, ivar(hid) time(year) treatment(treatment_active) gvar(o_year) agg(event) long2
    Panel is not balanced
    Will use observations with Pair balanced (observed at t0 and t1)
    xxxx...xxxxxx...xxxxxx.....xxxx.....xxxxxx...xxxxx
    x...
    Difference-in-difference with Multiple Time Periods

    Number of obs = 21,171
    Outcome model : regression adjustment
    Treatment model: none
    ------------------------------------------------------------------------------
    | Coefficient Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    Pre_avg | .1072762 .0532004 2.02 0.044 .0030053 .2115471
    Post_avg | .0114637 .0662737 0.17 0.863 -.1184304 .1413578
    Tm4 | .2430794 .1101621 2.21 0.027 .0271656 .4589932
    Tm3 | .0213244 .0673931 0.32 0.752 -.1107636 .1534125
    Tm2 | .0574248 .0391181 1.47 0.142 -.0192452 .1340948
    Tp0 | -.0012944 .0405202 -0.03 0.975 -.0807127 .0781238
    Tp1 | .1258476 .0713153 1.76 0.078 -.0139277 .2656229
    Tp2 | -.090162 .1567307 -0.58 0.565 -.3973485 .2170245
    ------------------------------------------------------------------------------
    Control: Never Treated

    See Callaway and Sant'Anna (2021) for details


    [CODE]

    Comment


    • start with a simple task
      tabulate tvar and gvar.

      Comment


      • tab year treatment

        | treatment
        year | 0 2018 2019 2020 2021 2022 | Total
        -----------+------------------------------------------------------------------+----------
        2013 | 11,116 445 2,107 1,885 1,772 2,505 | 19,830
        2014 | 11,039 431 2,083 1,908 1,752 2,453 | 19,666
        2015 | 9,085 344 1,783 1,541 1,503 2,000 | 16,256
        2016 | 7,515 264 1,507 1,278 1,229 1,626 | 13,419
        2017 | 9,690 410 1,544 1,249 1,483 1,694 | 16,070
        2018 | 7,474 313 1,312 988 1,211 1,311 | 12,609
        2019 | 9,723 414 1,583 1,337 1,553 1,695 | 16,305
        2020 | 10,763 427 1,592 1,380 1,653 1,707 | 17,522
        2021 | 7,014 301 1,041 843 970 1,235 | 11,404
        2022 | 6,083 273 900 770 826 1,085 | 9,937
        -----------+------------------------------------------------------------------+----------
        Total | 89,502 3,622 15,452 13,179 13,952 17,311 | 153,018
        Last edited by Mustafa Caliskan; 13 Feb 2025, 13:38.

        Comment


        • Ok it’s probably because you have a kind of rotating panel
          so households are not there for all periods

          Comment


          • Hello again Fernando! Is there any explanation to why do I always get very high standard errors in the pre-treatment phase compared to the treated one? Even when I try with a balanced panel, the standard errors are way bigger in the left of the eventstudy plot and I do not understand why, thank you!

            Comment


            • No general explanation
              it is what it is
              however Pretreatment test are known for low power

              Comment


              • Originally posted by FernandoRios View Post
                Use jwdid for that. It has an option for adding fixed effects other than individual
                In any case when explaining and presenting results be aware that identification may be difficult that way, and the sssumptions you are imposing when doing that
                Hello Fernando! I am not sure whether I understand this, can you link me to a paper or any reference that explains why I cannot use year fixed effects when using Callaway and Sant'Anna (2021)? Thanks a lot!

                Comment


                • It’s about how it is constructed
                  A) each attgt considers only 2x2 periods
                  b) for each period a regression is run
                  c) for that regression there is no time component because you only have one period and one group

                  Comment


                  • Hi Fernando,

                    Quick question about exporting csdid results to LaTeX using esttab. I'd like to have only the GAverage coefficient (and standard error/p-value) in my table. But if I do

                    eststo: csdid tempO ln_GNI_pc ln_wdi_pop, ivar(ccode) time(year) gvar(firstZyear) notyet agg(group)

                    then it gives me coefficients for all treatment timing groups:

                    . esttab

                    ----------------------------
                    (1)

                    ----------------------------
                    GAverage -7.456***
                    (-4.36)

                    G1997 -0.628
                    (-0.24)

                    G1998 0.328
                    (1.00)

                    G2000 -6.730*
                    (-2.38)

                    G2001 -7.825
                    (-1.54)

                    G2002 -18.72**
                    (-2.64)

                    G2005 -39.57***
                    (-177.71)

                    G2006 -15.36
                    (-1.38)

                    G2007 3.426***
                    (10.30)

                    G2008 2.007***
                    (6.04)

                    G2009 2.375***
                    (4.31)

                    G2010 -4.146***
                    (-3.34)
                    ----------------------------
                    N 1980
                    ----------------------------
                    t statistics in parentheses
                    * p<0.05, ** p<0.01, *** p<0.001


                    Do you know how I only show the GAverage one?

                    Thank you!

                    Comment

                    Working...
                    X