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

From |
"V.Martini" <vinmar0@hotmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Survival analysis: repeated spells |

Date |
Sat, 26 Sep 2009 15:58:17 +0100 |

Thank you very much for your reply!

Therefore, putting it differently, my question is the following: Compare stset t stcox X with stset t, id(var) stcox X

Many thanks, Vinicio Il giorno 25/set/2009, alle ore 19.25, E. Paul Wileyto ha scritto:

You have some choices to make for modeling recurrent events. Statahas many utilities for structuring the risk-set for survivalmodeling, especially for multiple record data. Best thing is to goto the survival manual for Stata, and look up the methods andformulas section in STREG. Here is how you stated the log-likelihood...ln L(i)= c log h(t)+log S(t) This should actually be ln L(i)= c log h(t)+ (1-c) log S(t)The manual adds one more term to make likelihood conditional on timeof entry into the risk set.ln L(i)= c log h(t)+ (1-c) log S(t) - S(t0)You will have to make a choice about how to represent time. Formodels like Anderson-Gill, the only time=0 is when you enter thecohort at the beginning. The time for your first event becomes theentry time for the second event, and so on. Gap time models resetthe clock back to zero after each event, so t for later eventsbecomes (ti-t0), and the S(t0) term in the likelihood goes away.Beyond that, you will have to adjust at least the standard errors,either by some sort of clustering approach (vce(cluster) orbootstrap), or using shared frailty.I will say that STSET is unfriendly to certain types of multiplerecord data. I have had bad luck trying to STSET data for gap time,and usually have to do something heroic that side-steps STSET's"idiot proofing." That is, I either have to create my multiplerecords with an Anderson-Gill type structure, and then subtract outthe t0 values, or I have to treat it as single record data... STSETonly generates the risk-set representation of the data, andclustering or shared frailty will work without giving the IDs toSTSET.Paul V. Martini wrote:Hello, this is maybe a trivial question for some of you: how does stata account for the presence of repeated spells?I know that, in order to account for different spells that refersto the same unit, stata requires to specify the id( ) option whenthe data are stset-ted. But my question is about how stata dealswith this problem in the estimation.For instance, suppose the contribution to the loglikelihood (withright censoring) is given by:L(i)= c log h(t)+log S(t)where c is a censoring variable (c=1 if spell is complete), h isthe hazard function and S the survival function.How the contribution to the likelihood changes when unit i hasrepeated spells? In my case this is relevant because I have toprogram the likelihood function by myself.Many thanks, Vinicio * * 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/-- 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 215-746-7147 Fax: 215-746-7140 epw@mail.med.upenn.edu * * 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/

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

**Follow-Ups**:**R: st: Survival analysis: repeated spells***From:*"Carlo Lazzaro" <carlo.lazzaro@tin.it>

**References**:**st: Survival analysis: repeated spells***From:*"V. Martini" <vinmar0@hotmail.com>

**Re: st: Survival analysis: repeated spells***From:*"E. Paul Wileyto" <epw@mail.med.upenn.edu>

- Prev by Date:
**st: R: RE: odd results after insample** - Next by Date:
**st: AW: R: RE: odd results after insample** - Previous by thread:
**Re: st: Survival analysis: repeated spells** - Next by thread:
**R: st: Survival analysis: repeated spells** - Index(es):

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