Hi all,
I would be grateful if you could consider the following enquiry. I am a second year PhD student researching the epidemiology of mortality of alcohol misusers within primary care (general practice) records. My record is structured as per the following excerpt.
+-------------------------------------------------------------------------------------------------------------------------------------------+
| patid eeventd~e readterm cohortcodes lrtag fdtag lr startlr LR |
|-------------------------------------------------------------------------------------------------------------------------------------------|
29. | 103001 20aug2008 Alcohol consumption low-risk 1 1 1 20aug2008 1 |
30. | 103001 15nov2012 Stopped drinking alcohol former-drinking 1 1 . . . |
31. | 103001 17oct2013 Alcohol use disorder identificatn test consumptn questionnre low-risk 1 1 1 . . |
32. | 103001 17oct2013 Teetotaller non-drinking 1 1 . . . |
33. | 103001 18mar2015 Teetotaller non-drinking 1 1 . . . |
+-------------------------------------------------------------------------------------------------------------------------------------------+
Key:
patid: subject/participant identifier
eeventdate: date of the event
readterm: name of event
cohortcodes: codes used to label alcohol related observations
lrtag: label of whether the participant has any record of ‘low risk drinking’
fdtag: label of whether the participant has any record of ‘former drinking’
LR: label indicating that the participant is considered a low risk drinker
startlr: start date of alcohol use exposure (here low risk drinker)
I am trying to identify patients in my dataset who fulfil the following patterns of sequence of events:
Generally, 1)Has experienced condition or event A,
2)Followed, after a certain time X, by condition or event B
3)And after event B or consecutive series of event Bs, no longer has event A
Specifically,
4)Has alcohol use event ( e.g. low risk drinking, hazardous drinking, alcohol use disorder, etc),
5)AND, at least 1 year after the record of alcohol use, has a record of ‘former drinking’ or ‘no drinking’,
6)AND after that record of ‘former drinking’ or ‘no drinking’ (or other consecutive records of ‘former drinking’ or ‘no drinking’), has no further record of alcohol use.
I have tried using several sources, including guidance on using stata for the data management of panel data but have not been able to solve my query.
Any help would be appreciated very much.
Thank you again.
Kareem
PS
Comment