Announcement

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

  • Custom Aggregation and Linear Contrasts with CSDID

    Thank you so much for the huge public service with CSDID FernandoRios !

    Question about custom aggregations and contrasts, using the groups listed in here as reference examples: https://friosavila.github.io/playing...did_stata.html

    Suppose I wanted to estimate the difference in event study coefficients between G2007 and G2004 or maybe I wanted [avg(G2007, G2009) - avg(G2004, G2006)]: are there off the shelf methods in csdid for that type of estimation? If we do the aggregations manually how would you recommend we extract the vcov's for valid inference? I'm guessing that a naive aggregation of SEs across different `estat event` results subset for each group would be a big no-no.

    Thanks!

  • #2
    Actually that works because estat event gets the right vcov for those aggregates

    Comment


    • #3
      Thanks for the reply! Hmm just to clarify i was thinking that for step one it would be possible to generate (using `csdid_estat`)
      Click image for larger version

Name:	Screenshot from 2025-10-04 15-00-04.png
Views:	1
Size:	52.2 KB
ID:	1782241



      where `x G_1` are my annotations in this example and represents either one group or an set of groups (e.g. all groups receiving treatment before covid in 2020) and then you could have a similar `estat event` (for Group 2). Once you obtain those two sets of event study coefficients you then take the difference and need to obtain the right SEs for the differenced estimates. That's not currently available in the package right? Maybe ETWFE/JWDID is the more suitable package for this?
      Last edited by Hong-Yi Tu Ye; 04 Oct 2025, 13:22.

      Comment


      • #4
        Ohhhh i see
        you are trying to compare event aggregations for different subgroups!
        that is a bit more involved, not out of the shelf with CSDID
        jwdid will allow you to do something like that becase you coud estimate your model (swap csdid with jwdid)
        then do something like
        estat event, over(your_groups)

        and get results from there.
        now, I know i manage to write it so it should work, but have not tried it in a while.
        F

        Comment

        Working...
        X