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: Analysis of event history data
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: Analysis of event history data
Date
Mon, 19 Mar 2012 11:42:57 +0000
For most Stata purposes your data would indeed be better reshaped to a
long data structure or shape or form (some people do say "format", but
in a Stata context format implies -format-, etc.).
reshape long y_ , i(id) j(time)
rename y_ status
should do it. See also -tsspell- (SSC) and
SJ-7-2 dm0029 . . . . . . . . . . . . . . Speaking Stata: Identifying spells
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
Q2/07 SJ 7(2):249--265 (no commands)
shows how to handle spells with complete control over
spell specification
as well as the literature on survival analysis with which you are
evidently familiar.
Nick
On Mon, Mar 19, 2012 at 11:32 AM, Kristian Thor Jakobsen <[email protected]> wrote:
> I am trying to do an analysis of transition in and out of public income
> transfers. My data is organized roughly the following way:
>
> Id y_1001 y_1002 y_1003
> 1 0 1 0
> 2 0 0 0
> 3 1 1 0
>
> This means that I have the weekly status of each individual from 1991 to
> 2011. But in order to any sort of analysis I would guess that I had to
> convert the data into the following way instead (for example survival
> analysis):
>
> Id Status Time
> 1 0 1
> 1 1 2
> 1 0 3
> 2 0 1
> 2 0 2
> 2 0 3
> 3 1 1
> 3 1 2
> 3 0 3
>
> Is that correct, and if so, does there exist a smart way to convert the
> data from one format into the other? Or can I perhaps use the data as
> given?
>
*
* 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/