Announcement

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

  • Pre-trends test using did2s

    Dear Statalist Community,

    I am running an event study using the command did2s. However, unlike other commands, this one in particular does not have estat options to test for pretrends.

    Here's my code that follows Kyle Butts (the creator of the command) operationalization of an event study:

    Code:
    *Restrict Pre and Post treatment to 20 years.
    gen timetrend2=timetrend
    replace timetrend2= . if timetrend>20
    replace timetrend2= . if timetrend<-20
    
    *Can not have negatives in factor variable (Following: did2s_stata)
    gen rel_year_shift = timetrend2 + 20
    replace rel_year_shift = 100 if rel_year_shift == .
    
    *Model
    did2s output if subsample==1 [aw=_weights],
    first_stage(i.country_id i.year control1 control2 control3 control4 control5)
    second_stage(ib100.rel_year_shift) treatment(treat) cluster(country_id)
    How can I run a pre trends test? I get the individual p-values for the pretrends when running the model, but I was wondering how to run alternative and/or joint pretrends tests.

    Thank you very much.



Working...
X