Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: difficulty determining exposure time for incidence

From   <>
Subject   st: difficulty determining exposure time for incidence
Date   Thu, 06 May 2004 12:12:25 -0600

Hello Stata-listers ---
I'm using Intercooled Stata, version 8.2.
I'm hoping someone can provide some suggestions regarding the 
determination of a single value for exposure for each subject 
in a dataset.  My dataset includes 187 observations (90 unique 
values) and I need to determine how many days each subject was 
on a particular medication, the problem, however, is that each 
subject may be on more than one medication at a time and I do 
not want to double-count the number of days on a prescription.  
The main problem is that each subject may contain prescriptions 
whose dates overlap (or not), and one prescription may envelope 
the remaining prescriptions for that person.  My dataset 
includes a unique identifier, the date the prescription 
commenced, the number of days on the medication, and the date 
the prescription terminated.  My dataset is currently in 'long' 
form and each subject appears in the dataset 1-12 times.  I've 
grappled with this and I suspect that either I need to reshape 
the dataset or write a program that loops across observations, 
although I'm uncertain whether either approach will accomplish 
what I want.  Any suggestions?  
Many thanks in advance,
Clint Thompson
*   For searches and help try:

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