[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Scott Merryman <scott.merryman@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Identifying coherent periods of events with irregular reoccurrence from a time sequence |

Date |
Wed, 25 Feb 2009 08:47:07 -0600 |

It is not clear to me what constitutes the two separate periods in your example - I assume the large change in day variable from order 5 to order 6. You might find Nick Cox's -tsspell- helpful with this task. For example clear input order day 1 0 2 29 3 57 4 89 5 114 6 293 7 309 8 342 9 363 10 407 11 434 12 461 end tsset order tsspell day, fcond(d.day>100) l, sepby(_spell) noobs Scott On Wed, Feb 25, 2009 at 8:02 AM, Jakob Petersen <j.petersen@ucl.ac.uk> wrote: > Statalisters, > > I have a problem identifying compliant vs. non-compliant periods in > patients’ prescription history. I assume that this type of problems is > known from other areas with temporal sequences (climate, transactional, > reoffending, etc.). >- > How would it be possible to flag and number a) coherent periods of > prescriptions; b) gaps; c) beginning dates; and d) end dates to each > period? > > Example (with two clearly separated periods): > > > order day > 1 0 > 2 29 > 3 57 > 4 89 > 5 114 > 6 293 > 7 309 > 8 342 > 9 363 > 10 407 > 11 434 > 12 461 > > > Any advice or suggestions will be much appreciated. > Jakob Petersen * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: Identifying coherent periods of events with irregular reoccurrence from a time sequence***From:*"Jakob Petersen" <j.petersen@ucl.ac.uk>

- Prev by Date:
**st: Identifying coherent periods of events with irregular reoccurrence from a time sequence** - Next by Date:
**st: RE: Identifying coherent periods of events with irregular reoccurrence from a time sequence** - Previous by thread:
**st: Identifying coherent periods of events with irregular reoccurrence from a time sequence** - Next by thread:
**st: RE: Identifying coherent periods of events with irregular reoccurrence from a time sequence** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |