Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: expected and relative survival


From   Enzo Coviello <[email protected]>
To   [email protected]
Subject   st: expected and relative survival
Date   Wed, 21 Jul 2004 17:23:25 +0200

Hello Stata friends,

Thanks to Kit Baum, there is now a new version of stexpect downloadable from SSC. In Stata, type
ssc desc stexpect
or
findit stexpect

stexpect implements the methods to estimate the expected survival function described in Therneau and Grambsh's book Modeling Survival Data, section 10.3.

Even if stexpect directly estimates the expected survival function, it is easy, using stexpect output, to achieve an estimate of the relative survival function, the preferred measure for the analysis of patient survival based on data from cancer registries.

Let me briefly illustrate this point with an example:

use colon,clear
de
Contains data from C:\RelativeExample\colon.dta
obs: 15,564
vars: 9 20 Jul 2004 18:02
size: 264,588 (97.5% of memory free)
-------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-------------------------------------------------------------------------------
year int %9.0g Year of diagnosis
dx int %d Date of diagnosis
exit int %d Date of exit
sex byte %9.0g sex Sex
age byte %9.0g Age at diagnosis
stage byte %9.0g stage Clinical stage at diagnosis
status byte %17.0g status Vital status at last date of
contact
year8594 byte %15.0g year8594 Indicator for year of dx 1985-94
id int %9.0g
-------------------------------------------------------------------------------

keep if stage==1 & year8594
stset exit, origin(dx) fail(status==1 2) id(id) scale(365.25)
stsplit fu, at(0(1)10)
preserve
sts gen Observed = s
bysort fu (_t) : keep if _n==_N
keep _t Observed
rename _t t_exp
sort t_exp
save observedsurvival,replace
restore
bysort id (_t) : replace age = age + _n - 1
bysort id (_t) : replace year = year + _n - 1

*popmort is the file with reference rates
sort year sex age
merge year sex age using popmort, keep(rate) nokeep

* Conditional or Ederer II Method estimate using approximate computation
stexpect CondApprox, at(0(1)10) ratevar(rate) output(conditional,replace) np(100) method(2)

* stexpect output
use conditional, clear
list, noobs abb(12) separator(0)

+-----------------------------+
| t_exp atrisk CondApprox |
|-----------------------------|
| 0 3717 1 |
| 1 3325 .95569161 |
| 2 2703 .91194803 |
| 3 2150 .86857608 |
| 4 1677 .8249502 |
| 5 1315 .78220432 |
| 6 986 .74070762 |
| 7 730 .70002679 |
| 8 475 .65938194 |
| 9 276 .61907437 |
| 10 122 .57567071 |
+-----------------------------+


merge t_exp using observedsurvival, nokeep

* Relative Survival
gen RelCondSurv = Observed / CondApprox
replace RelCondSurv = 1 if t_exp==0
list atrisk t_exp RelCondSurv, noobs abb(12) separator(0)

+------------------------------+
| atrisk t_exp RelCondSurv |
|------------------------------|
| 3717 0 1 |
| 3325 1 .9303817 |
| 2703 2 .8848194 |
| 2150 3 .8465964 |
| 1677 4 .820224 |
| 1315 5 .7981542 |
| 986 6 .768697 |
| 730 7 .7516535 |
| 475 8 .737656 |
| 276 9 .7184874 |
| 122 10 .7214158 |
+------------------------------+


On demand I can give privately more details (e.g. exact or approximate estimates, period analysis) on this subject.

Enzo

^^^^^^^^^^^^^^^^
Enzo Coviello
Dipartimento di Prevenzione ASL BA/1
via L. Barbera 27 - 70055 MINERVINO MURGE (BA)
Italy
tel - fax +39 0883 691053
tel (home) +39 0883 695055

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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