Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: rearranging multiple date variables
From
Romana Pylypchuk <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
RE: st: rearranging multiple date variables
Date
Tue, 31 Jan 2012 22:34:32 +0000
Thanks Nick
Romana
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: Tuesday, 31 January 2012 2:26 p.m.
To: [email protected]
Subject: Re: st: rearranging multiple date variables
-reshape long- and -drop- and -reshape wide- again.
Nick
On Mon, Jan 30, 2012 at 10:44 PM, Romana Pylypchuk
<[email protected]> wrote:
> I have a dataset of hospital admissions (multiple per patient) which is in a wide format.
> The variables are:
> unique patient's identifier, date of hospital admission 1, date of hospital discharge 1, date of hospital admission 2, date of hosp. discharge 2 , date of hosp. admission 3, date of hosp discharge. 3 and so on.
> I would need to combine into one each two visits that have discharge and subsequent admission on the same date. Ie, if the date of hospital discharge 1 and hospital admission 2 is the same than date of hospital discharge 2 becomes date of hospital discharge 1, while all subsequent dates shift to the left (date of admission 3 becomes date of admission 2 and date of discharge 3 becomes date of discharge 2).
> Is there a way to do this efficiently?
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/