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

Re: st: SE's on survival estimates from parametric models

From   Maarten buis <>
To   stata list <>
Subject   Re: st: SE's on survival estimates from parametric models
Date   Mon, 27 Apr 2009 09:16:42 +0000 (GMT)

--- On Sat, 25/4/09, Mark Hebblewhite wrote:
> Thanks for your suggestion, it worked! But it produced, as
> expected with the predict command, a prediction of the 
> mean survival rate and SE for each individual row/animal 
> in my dataset.
> To obtain one estimate of survival for say, the entire
> dataset, would it then be appropriate to just use summary 
> statistics to calculate group-level means and SE's? 

Below is an example of how to compute the hazards, se, and 
confidence intervals at t=15 for someone of average age, 
but still differentiated by drug. If you want one number,
then also replace the variable drug with one representative 
value e.g. the mode.

*------------- begin example -------------------
sysuse cancer, clear
stset studytime, failure(died)
xi: streg i.drug age, dist(weibull)

local t = 15
local p "exp([ln_p]_b[_cons])"
local h0 "`p' *`t' ^(`p' -1)"

sum age if e(sample), meanonly
replace age = r(mean)
bys drug : keep if _n == 1 

predictnl hazard = `h0' * exp(xb()), ci(lb ub) se(se)
list drug hazard se lb ub, clean noobs
*-------------- end example --------------------

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

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