Announcement

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

  • Examine treatment effect at different follow-up periods in difference-in-difference analyses

    Hi Statalisters

    I want to examine the effect of an intervention at different follow-up points. I'm using the difference-in-difference (DID) design to evaluate an intervention. My main DID-analyses use the common binary pre-post variable, but I'm also interested in effects at different follow-up periods. I've searched for ways of specifying different follow-up periods but have not found any concrete descriptions with quarterly data (although the command -ddid- may be a solution).

    I'm thinking the following approach may do the trick, although I'm uncertain as I've not seen any other applications:
    Code:
    * Effect at 6 month follow-up (2Q)
    gen byte post_6m = quarter >= tq(2016q3) & quarter <= tq(2016q4) 
    * Effect at 12 months follow-up (4Q)
    gen byte post_12m = quarter >= tq(2016q3) & quarter <= tq(2017q3)
    * Effect (full follow-up)
    gen byte post_16Q3 = quarter >= tq(2016q3)
    xtreg suicideRate i.intervention##i.post_6m, fe
    xtreg suicideRate i.intervention##i.post_12m, fe
    xtreg suicideRate i.intervention##i.post_16Q3, fe
    My aim with this is to estimate the ATET for follow-up periods using a post variable coded 0 for pretreatment quarters, 1 for 2 or 4 quarters (depending on 6 or 12 month follow-up), and then 0 again for the remaining follow-up period in the dataset (last time unit is 2017Q4).

    Here is a data example:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(suicideRate intervention) byte(post_16Q3 post_6m post_12m) long region float quarter
     2.486646 0 0 0 0 1 211
     3.469676 0 0 0 0 1 214
    2.0125837 0 1 0 1 1 230
     1.984417 1 0 0 0 2 210
     1.821562 0 0 0 0 3 209
    3.2823925 1 0 0 0 4 210
     2.958134 1 0 0 0 4 213
    2.2824166 1 0 0 0 4 218
    2.0749242 1 0 0 0 4 219
    3.4813704 1 0 0 0 4 220
     2.854724 1 0 0 0 4 222
     2.664677 1 1 1 1 4 226
     2.820055 1 0 0 0 6 212
     1.833036 1 0 0 0 6 213
    1.3645698 1 0 0 0 6 219
    end
    format %tq quarter
    label values intervention intervention
    label def intervention 0 "Control", modify
    label def intervention 1 "Intervention", modify
    Hopefully someone has some input on this.

    Best
    Tarjei

  • #2
    The simplest way to do this is to create a single variable, let's call it era. Set it to 0 in the pre-intervention period, 1 for the first 6 months, 2 for the next 6 months, etc.
    Code:
    gen byte era = 0 if quarter < tq(2016q3)    // PRE-INTERVENTION
    replace era = 1 if inrange(quarter, tq(2016q3), tq(2016q4)) // FIRST 6 MONTHS
    replace era = 2 if inrange(quarter, tq(2017q1), tq(2017q2)) // SECOND 6 MONTHS
    replace era = 3 if inrange(quarter, tq(2017q3), .) // AFTER THAT
    label define era    0    "Pre-Intervention"    ///
                        1    "First 6 Months"    ///
                        2    "Second 6 Months"    ///
                        3    "After 1 Year"
    label values era era
    
    xtset region quarter
    xtreg suicideRate i.intervention##i.era, fe
    Note: This won't run in your example data because you do not have enough observations in each era and condition to avoid having all of the era indicators omitted due to colinearity. But this will work with an adequate sample of real data. The interaction term for 1.intervention#1.era will give you the DID effect estimate for the first 6 months, etc.

    Comment


    • #3
      Thanks Clyde. This was a way better solution to what I aimed for!

      Comment

      Working...
      X