Announcement

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

  • Creating indicator for 3 or more consecutive months

    Hello,

    I want to create an indicator variable by id for any individual with 3 or more consecutive months of prescription, using the prescription dates.
    I came across the egen seq( )and tried it but it does not exactly do what I want.

    Example dataset:
    id date
    1 09aug2012
    1 08nov2012
    1 10jan2013
    -----------------------------------
    2 09may2001
    2 23may2001
    2 11jul2001
    2 01aug2001
    2 03oct2001
    2 19nov2001
    -----------------------------------
    3 09nov2004
    3 06dec2004
    3 01jan2005
    3 01mar2005
    -----------------------------------

    Many thanks for the assistance.

    Kwame
Working...
X