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

Re: st: difficulty determining exposure time for incidence


From   Fred Wolfe <[email protected]>
To   [email protected]
Subject   Re: st: difficulty determining exposure time for incidence
Date   Fri, 07 May 2004 02:49:10 -0500

In Stata, the way to do what you want is most easily accomplished using the long format.

The problem is not so much a programming problem as it is a conceptual one. Clint must decide how best to present such complex data. We have sometimes presented alternative counting methods to readers. In general, there are a number of approaches.

One approach is to use is to use -egen group: egen druggrp = group(druga drugb), lname(somename). Good for 2, maybe 3 drugs.

Another approach is to combine -egen rsum()- with the sum() in 2 passes. Just how to do this depends on how your drug data are formatted.

Fred Wolfe


At 01:12 PM 5/6/2004, you wrote:

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:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel (316) 263-2125     Fax (316) 263-0761
[email protected]


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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