From | "Christopher W. Ryan" <[email protected]> |
To | [email protected] |
Subject | Re: st: re: counting patient-days--resolved |
Date | Sun, 07 Aug 2005 17:36:38 -0400 |
Michael said
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..
That is indeed more elegant and Stataish. Like my proposal, it creates a long format dataset rather than hundreds of new variables.
Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html
*
* 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/
* * 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 |