# Re: st: RE: survival analysis

 From Tina Hernandez-Boussard To statalist@hsphsun2.harvard.edu Subject Re: st: RE: survival analysis Date Tue, 25 Aug 2009 13:58:16 -0700

```Hi,

Thanks for your help, and sorry for the attachment!

```
So this is what I am not understanding, and I appreciate your hel. My data looks like this:
```
li event fumonths medrec

+------------------------------+
| event   fumonths      medrec |
|------------------------------|
1. |     0          1     2035632 |
2. |     0          58         261 |
3. |     0          19         103 |
4. |     1         3        5793 |
5. |     0          12        9142 |

I have set up my data as such:

stset fumonths , fail(event==1 )

failure event:  event == 1
obs. time interval:  (0, fumonths]
exit on or before:  failure

```
------------------------------------------------------------------------ ------
```      397  total obs.
0  exclusions
```
------------------------------------------------------------------------ ------
```      397  obs. remaining, representing
58  failures in single record/single failure data
8262.5  total analysis time at risk, at risk from t =         0
earliest observed entry t =         0
last observed exit t =        96

```
So I have 58 failures out of 397 observations. However, in my graph, I have all patients die, survival estimate goes to 0.
```
```
Can anyone help with this? How do I change the time to be followup time and not survival time?
```
Thanks

On Aug 24, 2009, at 5:33 PM, Villa Lora, Juan Miguel wrote:

```
```Hi Tina,
```
Your TimetoEvent variable must contain categorical observations or a dummies by default (you can tell Stata the failure values failure (failvar[==numlist])). For instance:
```
ID     TimetoEnvent     Followuptime
1      0                3
2      1                5
3      1                4
4      0                6

You may run: stset FollowupTime , id(ID) failure(TimetoEvent==1)

```
If you are building Kaplan-Meier graph, everyone must figure on it as it is based on the proportion of the observations that remain "live" untill the end of the experiment. If you give us more datails of your graph it would be better.
```Juan.

-----Original Message-----
```
From: owner-statalist@hsphsun2.harvard.edu on behalf of Tina Hernandez-Boussard
```Sent: Mon 8/24/2009 7:56 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: survival analysis

Hi All,

I am having problems viewing the graph I want using stset.

I have a dataset that contains 398 patients with 58 failures

I have the following variables:

followupTime TimetoEvent ID

I have set things up as such (1 row per patient):

stset followupTime , failure(TimetoEvent )

failure _d:  TimetoEvent
analysis time _t:  followupTime

I have tried to make TimetoEvent a dummy variable, with 0/1 instead
of time of event.

However, when I get the graphs, I have everyone with an event.  I
done wrong with the setup?

Thanks!

Tina

*
*   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/

<winmail.dat>
```
```
*
*   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/
```