Announcement

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

  • CSDID Staggered Difference in Difference Interpretation

    Hi all,

    I am trying to set up a staggered difference in difference using the CSDID package. I have sample code and data below which produces the attached figure . Thank you all so much and apologies if these are too basic.


    1) I am a little confused how the control group is represented in this staggered DiD figure (since the intervention does not occur in the control group and the intervention is staggered ). Is each treatment sample matched with a control sample based on the raw value of the time variable? In other words, in each time period, what is the outcome variable in the treatment group being compared to in order to generate the ATT?

    2) I would also like to plot the raw values of (outcome in control group) , (outcome in treatment group) and (raw quarter) in each "time to event" period
    Click image for larger version

Name:	Example.jpg
Views:	1
Size:	71.8 KB
ID:	1771028
    but can't figure out how to do that.



    Sample Code

    csdid outcome, ivar(id) time(quarter) gvar(quartertreated )

    estat event, window(-4 4) estore(cs)

    event_plot cs, default_look graph_opt(xtitle("Quarters Relative to Event") ytitle("Average effect") ///
    title("ATT Difference in Difference") xlabel(-4(1)4)) stub_lag(Tp#) stub_lead(Tm#) together


    Description of variables

    id=sample ID
    quarter =a sequential time period starting from zero, same for all observations,
    eventquarter=the quarter an event happened for treatment , missing otherwise
    state= the state the sample is in
    outcome=the outcome of interest
    var1, var2= only two listed for simplicity but covariates I am hoping to adjust for in a propensity score
    treatment= whether a sample is ever in the treatment group

    data

    [CODE]
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str4 id byte quarter float eventquarter str2 state int(outcome var1 var2) float treatment
    "288" 9 . "NY" 0 1 1 0
    "288" 10 . "NY" 0 3 7 0
    "288" 11 . "NY" 0 3 6 0
    "277" 12 9 "NY" 0 0 4 1
    "277" 13 9 "NY" 0 1 0 1
    "277" 16 9 "NY" 0 0 1 1

  • #2
    The figure is showing you the treatment effect (Ytreat - Ycontrol).

    It all lines up by quarter.

    You have no effect and none of the pre-treatment differences is significant, but that wide CI at -1 is funky. I'd investigate that.

    Comment


    • #3
      Very helpful and I appreciate your time, George.So since the intervention is staggered across different quarters, the program automatically realigns the appropriate controls for each treatment sample? For instance if a sample experienced an intervention in quarter 5, the treatment effect is the outcome in quarter 5 vs the average outcome in quarter 5 in all controls? And so on for each treatment sample?

      Sorry I am having such a hard time with this! Thanks

      Comment


      • #4
        HTML Code:
        https://friosavila.github.io/playingwithstata/main_csdid.html

        Comment


        • #5
          Very helpful - thank you!

          Comment

          Working...
          X