[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: R: Kaplan Meier graph in longitudinal data

From   "E. Paul Wileyto" <>
Subject   Re: st: R: Kaplan Meier graph in longitudinal data
Date   Tue, 12 May 2009 09:05:09 -0400

Let's take a step back because the first thing you should be asking is how to structure the risk set... Then ask how to graph it.

You appear to have structured your risk set as in the Andersen-Gill model, where time of the first event is entry time for being at risk for the second event, and so on. If your events in the series are identical, you may wish to graph cumulative hazard, and not survival. That is one of the options in sts graph.

If your time to event is conditional on being at risk for "that event" in the series, and time starts from zero, you may want to draw separate survival curves for event 1, event 2, and so on. This would be true for gap time models, where the clock is reset to 0, and for marginal models where time to each event is measured from original time of entry.


Deepa Aggarwal wrote:
Dear Carlo,

Thanks for the quick response.

I tried the following command.
stcox age, cluster(id)

But what to do after that. I looked at the reference book but I am lost.

Many thanks,

On Tue, May 12, 2009 at 3:36 AM, Carlo Lazzaro
<> wrote:
Dear Deepa,
provided that the proportional risk assumption holds, a possible solution
would be to switch to the semiparamentric Cox regression model, with the
option -cluster(patient)- (please, see -help stcox-). In this way, you would
correctly assume that patients are independent, whereas receuurences within
the same patient aren't.
This topic (like many others) is covered in Cleves MA, Gould WG, Gutierrez
R. An Introduction To Survival Analysis Using Stata. Revised edition.
College Station: StataPress, 2006: 148-152.

Another possible (but trickier option) would be considering a Markov model
(please, see Sonnenberg FA, Beck JR. Markov models in medical decision
making: a practical guide. Medical Decision Making 1993;13:322-339.

HTH and Kind Regards,
-----Messaggio originale-----
[] Per conto di Deepa Aggarwal
Inviato: lunedì 11 maggio 2009 19.52
Oggetto: st: Kaplan Meier graph in longitudinal data

 Hi All,

I have the following longitudinal data :

 id     d_entry           d_censor         status          age       x2
 1      20jan2008     22jan 2008        0               62          0
 1      22jan 2008    24jan 2008        0               62          0
 1      24jan 2008    26jan 2008        0               62          1
 1      26jan 2008    28jan 2008        1                62          0
 2      13jan 2008    18jan 2008        0               70           0
 2     18jan 2008    20jan 2008        0               70           1
 2      20jan 2008    24jan 2008        0               70           0
 2     24jan 2008    26jan 2008        1                70          1

 Here id is patient id number, d_entry is the date of entry,  d_censor
 is the date of censoring, status is the censoring variable, age is
 fixed for each id, x2 changes with time for each id.

First I stset the above mentioned data by using the following command:
stset d_censor, id(id) failure (status==1) origin (time d_entry)

Now I want to get a Kaplan meier graph . I know if there is one event per
id, then sts graph can be used.
But in recurrent event models, what command should be used?

 Thanks for your consideration.



*   For searches and help try:

*   For searches and help try:

E. Paul Wileyto, Ph.D.
Assistant Professor of Biostatistics
Tobacco Use Research Center
School of Medicine, U. of Pennsylvania
3535 Market Street, Suite 4100
Philadelphia, PA  19104-3309

Fax: 215-746-7140
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index