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

st: Re: counting patient-days


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: counting patient-days
Date   Wed, 20 Jul 2005 12:29:46 -0400

I think there is a simpler solution than the ones proposed.

gen los=dischargedate-admitdate+1
gen date=admitdate
expand los
bysort patientid: replace date=date[_n-1]+1 if _n>1

you now have a dataset with one observation per patient per day where you can count the number of days, etc..

Michael Blasnik
[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