Bookmark and Share

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: stset


From   Neophytos Stylianou <neophytos.stylianou@postgrad.manchester.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: stset
Date   Tue, 29 Jan 2013 15:56:01 +0000

By saying that it won't work do you mean? that the stset command would give me an error?
Because I am doing it and it does set the data.

In my dataset I have admission as well as discharge/death date per observation

In Statas manual the stset takes the form of:
stset failuretime, failure(mortality==1) id(id) enter =(admissiontime)

so why it would not work if my dataset as I showed an example earlier has unique observations that have the admission date as well as the discharge/death date?

thanks
Neo

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: 29 January 2013 15:45
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: stset

No; that won't work. You don't have a single time variable or survival variable. What makes you think that compatible with -stset-?

You need to -reshape- your data.

Nick

On Tue, Jan 29, 2013 at 3:38 PM, Neophytos Stylianou <neophytos.stylianou@postgrad.manchester.ac.uk> wrote:

> I am about to perform some survival analysis and I need to set my dataset in survival data format.
>
> Will the stset command work when data is not in the correct format i.e wide instead of long?
>
> I have a dataset of many variables (550) and observations (60,000) in this format:
> Mortality       timeADM timeDisch           ID
> Survived        Jan2003 Jan2003 1
> Died                       Feb2004      Mar2004 2
> Survived        Jun2006 Aug2006 3
>
> From what is saw in the stset help file as well as Statas manual this will be ok but I am just worried it is not in the long format.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index