setzler / eventStudy

R package and guide for performing event studies with heterogeneous dynamic effects.
MIT License
71 stars 18 forks source link

Never-treated individuals #2

Closed johnnybonney closed 5 years ago

johnnybonney commented 5 years ago

Allow option in ES() to use never-treated individuals as a control group.

davidnov commented 5 years ago

I have added this as an option to ES().

I will add a description of this option to the front page, but the gist is that the argument is never_treat_action and it takes on values in c('none', 'exclude', 'keep', 'only'). It is meant to work with the case where, by assumption, units missing onset_time_var are considered to be never treated.

A bit more detail:

For never_treat_action %in% c('exclude', 'keep', 'only'), if there are no units with missing onset_time_var, ES() will throw an informative error, suggest never_treat_action = 'none', and break.