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
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: rearranging multiple date variables
Date
Tue, 31 Jan 2012 01:26:09 +0000
-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/