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

Re: st: episode data in st format


From   anna krivelyova <[email protected]>
To   [email protected]
Subject   Re: st: episode data in st format
Date   Wed, 18 Jun 2003 08:35:39 -0700 (PDT)

Hi,

Thanks for the advice.  I have Stata 8.  Actually, I
probably asked the wrong question: it is more of a
programing than an analysis question.  I am trying to
get my data to look as series of spells of whether you
are in or out of a hospital, without gaps.
Here is my data:

ID service begin end
1 outpatient 03/10/99 03/10/99
1 inpatient 04/15/99 04/27/99
1 inpatient 07/14/99 07/20/99
1 outpatient 09/03/99 09/03/99
2 inpatient 06/12/99 07/01/99
2 outpatient 10/17/99 10/17/99
2 outpatient 12/23/99 12/23/99
    
etc

Basically, a person may start out being in a hosptal
or not, and can have multiple hospitalizations and
stay in a hospital for various time periods.

I'd like to recontsruct the above data to look like
the following:

ID  begin     end             status
1  03/10/99 04/15/99    nothospitalized   
1  04/15/99 04/27/99     hospitalized
1  04/27/99 07/14/99     nothospitalized 
1  07/14/99 07/20/99     hospitalized
1  07/20/99 09/03/99    nothospitalized
2  06/12/99 07/01/99     hospitalized
2  07/01/99 12/23/99    nothospitalized


Obviously, I can replace the end date with the begin
date of the next observation when appropriate.  What I
don't know how to do is how to insert an observation
that between the two hospitalization records: stating
that between the end date of first hospitalization and
start date of the second the person was not in a
hospital.

Thanks again,
Anna




--- Ronan Conroy <[email protected]> wrote:
> on 18/06/2003 2:49 pm, anna krivelyova at
> [email protected] wrote:
> 
> > I am only interested in the timing of inpatient
> > hospitalization (in and out of hospital spells),
> but
> > the dates of outpatient services give me info on
> when
> > the observed period starts and ends for each
> person.
> > 
> > My question is how do I tsset this data?
> 
> You don't say what version of Stata you are using,
> but Stata 8 has a whole
> manual on survival analysis and epidemiological
> tests. You should read and
> understand the -stset- command documentation,
> because Stata has very
> powerful methods for dealing with survival data. But
> you need to know how
> these methods relate to the logic of your data. In
> particular, pay attention
> to variables which record things that apply during
> the spell spanned by the
> record and ones which record things that changed at
> the end of the record.
> 
> Survival analysis is something you need to sit down
> with and work some
> examples to get happy with.
> 
> Actually, what statistical method isn't?
> 
> Ronan M Conroy ([email protected])
> Lecturer in Biostatistics
> Royal College of Surgeons
> Dublin 2, Ireland
> +353 1 402 2431 (fax 2764)
> 
> --------------------
> 
>
--------------------------------------------------------------------------------------------------------------------
> This email and any files transmitted with it are
> confidential and
> intended solely for the use of the individual or
> entity to whom
> they are addressed.
> If you have received this email in error please
> notify the
> originator of the message. This footer also confirms
> that this
> email message has been scanned for the presence of
> computer viruses.
> 
> Any views expressed in this message are those of the
> individual
> sender, except where the sender specifies and with
> authority,
> states them to be the views of The Royal College Of
> Surgeons in Ireland.
> 
>
--------------------------------------------------------------------------------------------------------------------
> 
> 
> *
> *   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/



__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
*
*   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