Stata Routine for Check Sequence of Events