Hi,

I am trying to investigate the effect of an in-hospital intervention on:

1) Time to emergency department visit, and
2) Number of ED visits

The problem is that individuals receive this intervention at different time periods and they may receive the intervention multiple number of times. To make things simple, I want to assume that once a patient receives that intervention, they will be considered after the first treatment. I want to use a diff-in-diff estimator to estimate the difference in outcome between those who received the intervention and those who never received the intervention. I have read about staggered diff-in-diff and generalized diff-in-diff, but I am yet to see any step by step implementation of these approaches. Please can someone explain to me how to specify diff-in-diff treatment effects if interventions are instituted at different periods for many treatment units.