Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

RE: st: Survival analysis - individual survival functions


From   "Lambert, Paul C. (Dr.)" <pl4@leicester.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
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.

clear
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.

Paul


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
UK
Tel: +44 (0)116 229 7265, Fax: +44 (0)116 229 7250
e-mail: paul.lambert@le.ac.uk
Homepage: http://www2.le.ac.uk/Members/pl4/ ________________________________________

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Steven Samuels
Sent: 16 December 2010 01:10
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: Survival analysis - individual survival functions

Paul,

  -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.

Steve

Steven J. Samuels
sjsamuels@gmail.com
18 Cantine's Island
Saugerties NY 12477
USA
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,
paul.seed@kcl.ac.uk,
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:
*   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/

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index