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]

From |
Steven Samuels <sjsamuels@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: Survival analysis - individual survival functions |

Date |
Thu, 16 Dec 2010 17:12:30 -0500 |

Very nice, Bobby! Steve sjsamuels@gmail.com On Dec 16, 2010, at 4:45 PM, Roberto G. Gutierrez, StataCorp wrote: Paul Seed <paul.seed@kcl.ac.uk> asks:

Following a parametric survival regression, I can use -predict- withthe-surv- option to get the survival function; but I only do not seemto haveany choice over when it is calculated for.

The help file promises me values for S(t|t_0), and I would like toset botht and t_0 myself. But they seem to be set automatically, at thetime ofentry and exit of the subject.

Is there a simple way of doing this? If not, is there any chance ofitbeing included in a future version of Stata?

uses to calculate S(t|t_0). Of course, when you do this you have to be careful to put everything back in place when you are done. To illustrate, we fit a Weibull model on the cancer data that ships with Stata, and we use one covariate, -age- . sysuse cancer, clear . streg age, dist(weibull)

want to set this at a fixed value for the predictions, too. . gen age_old = age . gen t_old = _t . gen t0_old = _t0

an evenly-spaced grid from 0 to 20 . drop _t . range _t 0 20

corresponding survival prediction is for someone aged 75 . replace _t0 = 0 . replace age = 75

set: . predict s, surv . list _t0 _t s Of course, remember to put everything back in place . replace age = age_old . replace _t = t_old . replace _t0 = t0_old --Bobby rgutierrez@stata.com * * 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/

**References**:**Re: st: RE: Survival analysis - individual survival functions***From:*rgutierrez@stata.com (Roberto G. Gutierrez, StataCorp)

- Prev by Date:
**Re: RE: st: Converting a SAS datastep to Stata** - Next by Date:
**st: Adjust versus margins following logistic regression** - Previous by thread:
**Re: st: RE: Survival analysis - individual survival functions** - Next by thread:
**st: xtnbreg** - Index(es):