Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

RE: st: Survival analysis - individual survival functions

From   "Lambert, Paul C. (Dr.)" <>
To   "''" <>
Subject   RE: st: Survival analysis - individual survival functions
Date   Thu, 16 Dec 2010 12:23:42 +0000

Another option is to use -stpm2- (available from ssc) which fits flexible-parametric survival models where you can use the -timevar()- option. If you want the conditional survival then you can use two -predict- statements. An example is below.

webuse brcancer
stset rectime, f(censrec=1) scale(365.25)
rename x1 age

stpm2 hormon age, scale(hazard) df(3)

range my_t 1 5 9
predict S_t, survival timevar(my_t) at(hormon 0 age 50)

gen my_t0 = my_t - 0.5
predict S_t0, survival timevar(my_t0) at(hormon 0 age 50)
gen condsurv = S_t/S_t0

I have used the -at()- option to get predictions at set values of my covariates. Note that Weibull, log-logistic and log normal models are special cases of these models. See the help file for more details.


Dr Paul C Lambert
Reader in Medical Statistics
Centre for Biostatistics & Genetic Epidemiology
Department of Health Sciences
University of Leicester
2nd Floor, Adrian Building
University Road
Leicester LE1 7RH
Tel: +44 (0)116 229 7265, Fax: +44 (0)116 229 7250
Homepage: ________________________________________

-----Original Message-----
From: [] On Behalf Of Steven Samuels
Sent: 16 December 2010 01:10
Subject: Re: st: Survival analysis - individual survival functions


  -predict- gives values at the observations after every regression
command. To get it for arbitrary values of the inputs, you have to do
it yourself.   S(t| t_0) = S(t)/S(t_0), and the formulas for S(.) are
on page 358 of the Stata Manual (V 11).  You can get the linear
predictor for any values of the X's with  -margins-  or -adjust-
( Stata<11).  Add the appropriate auxiliary parameters (returned
results e(theta), e(aux_p), e(gamma), e(sigma), e(kappa)); your t and
t_0; then plug  everything into the formulas.


Steven J. Samuels
18 Cantine's Island
Saugerties NY 12477
Voice: 845-246-0774
Fax:    206-202-4783

On Dec 15, 2010, at 4:25 PM, Seed, Paul wrote:

Dear all,
Following a parametric survival regression,
I can use -predict- with the -surv- option to get
the survival function; but I only do not seem to have
any choice over when it is calculated for.

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

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

Many thanks.

Paul Seed, Senior Lecturer in Medical Statistics,
020 7188 3642,,
King's College London, Division of Women's Health
Please do not send unencrypted un-anonymised data to this address.

*   For searches and help try:

*   For searches and help try:

*   For searches and help try:

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