02/10/2008 1 Fifth Italian Stata Users Group Meeting October 20‐21, 2008 ‐ Milan Confidence Bands for the Survival Function for the Survival Function Enzo Coviello Outline of the talk • Confidence Intervals and confidence bands of the survival function survival function • Validation of the estimates and examples • Comparing Methods and Transformations • Coverage probabilities • Coverage probabilities • Conclusions
28
Embed
Confidence Bands for the Survival Function - Boston …fm · Confidence Bands for the Survival Function ... confidence bands for the survival and the cumulative ... H-W 95 Lower Band
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
02/10/2008
1
Fifth Italian Stata Users Group Meeting
October 20‐21, 2008 ‐ Milan
Confidence Bands for the Survival Functionfor the Survival Function
Enzo Coviello
Outline of the talk
• Confidence Intervals and confidence bands of thesurvival functionsurvival function
• Validation of the estimates and examples
• Comparing Methods and Transformations
• Coverage probabilities• Coverage probabilities
• Conclusions
02/10/2008
2
Confidence Intervals andand
Confidence Bands
• The Kaplan‐Meyer method is a standard estimator of thesurvival function, i.e. of the survival probabilities along theanalysis time.
• Confidence intervals are usually derived by transformation ofthe survival function on the log‐minus‐log scale followed by thethe survival function on the log‐minus‐log scale followed by theestimation of appropriate variance.
• So, let
( )i
i
i i it t
dn n d
σ≤
=−∑
(the sum in theGreenwood’s formula)
confidence intervals for the survival function are thenconfidence intervals for the survival function are thencomputed as follows:
( )( )1 /2exp
lntz
S tSα σ
⎛ ⎞⎜ ⎟⎜ ⎟−⎜ ⎟±⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠
⎡ ⎤⎣ ⎦(adapted from the Stata10 [ST] Manual p. 356)
02/10/2008
3
• The confidence intervals (CI) are valid at a single time point.
• A common incorrect use is to estimate CI at all time points
and connect their endpoints drawing two curves. The area
between the two curves is interpreted as having, for example,
the 95% confidence to contain the entire survival function.
• Rather, the so‐called confidence bands (not yet available
within Stata) are the appropriate limits.
• A new Stata command, ‐stcband‐ , allows to compute these
confidence bands for the survival and the cumulative hazard
function.
An example illustrates the difference between confidence intervals and confidence bands.
use rectum,clear
stset time,f(status) scale(12)
205 total obs.0 exclusions
-----------------------------------------------------------------205 obs. remaining, representing195 failures in single record/single failure data
247.1417 total analysis time at risk, at risk from t = 0earliest observed entry t = 0
last observed exit t = 5last observed exit t 5
The “rectum” dataset includes 205 patients with advancedrectum cancer, of whom 195 died within 5 years (the timeis in months) from the diagnosis
1 Confidence Intervals areaConfidence Bands area exceeding CIs
• The confidence bands are always widerh h fid i l
.2
.4
.6
.2
.4
.6
pp
2
.4
.6
than the confidence intervals.
• The latter approach seriouslyunderestimates the true variability of thesurvival function.
0
0 1 2 3 4 5Time
0
0 1 2 3 4 5Time
0
.2
0 1 2 3 4 5Time
02/10/2008
6
• Two methods are available to construct the confidencebands. The first has been proposed by Hall and Wellner(1980) (HW). The second, proposed by Nair (1984), is called“equal precision” (EP) (1 2)equal precision (EP) (1, 2).
• To construct the confidence bands, we must use theconfidence coefficients taken from special distributions.
• These coefficients are reported in the tables C.3 (EqualPrecision) and C.4 (Hall and Wellner) of the Klein andMoeschberger’s book(1)Moeschberger s book .
• The values in the tables C.3 and C.4 have been stored in twodata files: NairTables.dta and HallWellnerTables.dta
To compute confidence bands, -stcband- works asfollows:• first, four appropriate values are selected from one of thesefiles;
• then, the selected values are linearly interpolated tothen, the selected values are linearly interpolated todetermine the exact coefficient to be used.
For each method we have three possible forms of confidencebands:
• Linear
• Log‐minus‐log transformed (for short denoted “log”)
• Arcsine square‐root transformed (for short denoted“arcsine”).
• Some comment about the differences and the properties ofeach approach is addressed at the end of the next section.
02/10/2008
7
Validation of the estimates and examples
• Checks have been made to validate the new command using the “rectum” dataset
• The results obtained by ‐stcband‐ and by km.ci R function(3)
were compared. As shown in the following tables, the two commands reach perfect agreement
Hall-WellnerArcsine Transformation• Often, the arcsine and the log transformed confidence bands
are both large at the beginning of the survival curve.
.4
.6
.8
Sur
viva
l Pro
babi
lity
S(t+0)H-W 95 Upper BandH-W 95 Lower Band
• This result is apparently anomalous. In this tract of thesurvival function, in fact, we expect the confidence bands tobe shorter than in the rest of the curve.
• This happens, however, in the Hall‐Wellner method aloneand depends on the formulae applied.
• To circumvent this problem we can specify a lower time limit
0
.2
S
0 1 2 3 4 5Time
rectum.dta
To circumvent this problem we can specify a lower time limitslightly greater than the minimum observed time.
1 S(t+0)H W 95 U B d
Hall-WellnerLog Transformation
stcband, tlower(0.1) ……
.2
.4
.6
.8
Sur
viva
l Pro
babi
lity
H-W 95 Upper BandH-W 95 Lower Band
0
0 1 2 3 4 5Time
rectum.dta
02/10/2008
12
1 S(t+0)H W 95 U B d
Hall-WellnerLog Transformation
stcband, tlower(0.1) ……
In the option –tlower()‐ we specified that therange of times to be considered for computingthe confidence bands starts from 0.1
• ‐stcband‐ can save lower and higher limits of the confidencebands by specifying the options ‐genhi(newvarname)‐ and ‐genlo(newvarname)‐.
• After saving the estimates obtained by the Hall Wellner and• After saving the estimates obtained by the Hall‐Wellner andEqual Precision methods, a graph can be easily produced tocompare either methods:
The option -nograph- suppresses the graph to be shownThe option -nograph- suppresses the graph to be shown.The higher and lower limits of the log‐transformed confidencebands are saved in the variables HW_hi and HW_lo .
02/10/2008
15
‐stcband‐ and the -nair- option graph the Equal Precision
Now, let us consider the Hall‐Wellner method and compare in thesame graph the linear, log and arcsine transformed confidencebands.
Given that the curves from the rectum data set overlap, we usedthe example dataset WHAS100, presented in the book Applied
( )Survival Analysis(4):use e:\whas100
stset lenfol,f(status) scale(365.25)
stcband, nograph transform(arcsine) ///
genhi(HiArc) genlo(LoArc) Linear and arcsinef d
stcband, nograph transform(linear) ///
genhi(HiLin) genlo(LoLin)
transformed estima‐tes are savedwithout graphing
02/10/2008
18
Now we estimates log transformed confidence bands and graphthem together with the previous estimates:stcband, plot(line HiArc LoArc HiLin LoLin _t , sort ///
c(J J J J) lc(blue blue red red) lp(- - - -)) ///
legend(label(2 "Hi Log") label(3 "Lo Log") ///g ( ( g ) ( g ) ///
label(4 "Hi Arcsine") label(5 "Lo Arcsine") ///
label(6 "Hi Lin") label(7 "Lo Lin") ///
pos(7) ring(0) rows(3) order(2 3 4 5 6 7) )
.6
.8
1
Pro
babi
lity
HW Confidence BandsLinear Log and Arcsine Transformation
0
.2
.4
Sur
viva
l P
0 2 4 6 8Time
Hi Log Lo LogHi Arcsine Lo ArcsineHi Lin Lo Lin
• At the beginning of the follow‐up time, the arcsine and (more) the logtransformed bands are wider than the linear ones.
• Even the linear confidence bands have a problem in this tract: thehigher limit is automatically trimmed to 1 by -stcband-
• In the rest of the curve it is hard to see relevant differences .
02/10/2008
19
6
.8
1ab
ility
EP Confidence BandsLinear Log and Arcsine Transformation
0
.2
.4
.6
Sur
viva
l Pro
ba
0 2 4 6 8
Hi Log Lo LogHi Arcsine Lo ArcsineHi Lin Lo Lin
0 2 4 6 8Time
For the Equal Precision method the aforementioned problemat the start of the follow‐up does not exist.
• The confidence bands are notproportional to the pointwiseconfidence intervals: ad hocformulae are applied
• The confidence bands areproportional to the pointwiseconfidence intervals: identicalformulae are applied to calculate
EQUAL PRECISION HALL‐WELLNER
formulae are applied.
• Anomalous values of the lowerconfidence band are seen at thestart of the follow‐up when log orarcsine transformations are used.Therefore, the initial observedtimes should be excluded.
formulae are applied to calculateconfidence bands and intervals,but the Z coefficient in the CIformula is replaced by a differentcoefficient in the Equal Precisionformula.
• Borgan and Liestol (5) studied the• Linear, log and arcsinetransformed confidence bandswork reasonably well with as fewas 20 events (5).
• Borgan and Liestol (5) studied thecoverage probabilities of theconfidence bands. On this basisthey recommend arcsinetransformed confidence bands.The linear bounds should beavoided.
02/10/2008
20
Coverage probabilities
• Using ‐stcband‐ and the ‐bootstrap‐ capabilities of Stata, apersonal check of the coverage probabilities of the variousapproaches to estimate the confidence bands has been done.
• Briefly, two simulated data sets have been generated. The firstBriefly, two simulated data sets have been generated. The firstfollows a Gompertz distribution, the second a log‐logisticdistribution (6, 7).
• In the former distribution, the scale and shape parametershave been chosen to approximately reproduce the survival ofa highly malignant tumor (lung, pancreas).
• In the latter, the scale and shape parameters mimic thesurvival experience of a low malignant tumor like the breastcancer.
02/10/2008
21
Simulated data set: Gompertz distribution
. stset time,f(fail)
------------------------------------------------------------------------------10000 total obs
2
2.5
10000 total obs.0 exclusions
------------------------------------------------------------------------------10000 obs. remaining, representing8965 failures in single record/single failure data
9852.591 total analysis time at risk, at risk from t = 0earliest observed entry t = 0
last observed exit t = 5
5
1
1.5
pred
icte
d ha
zard
0
.5
0 1 2 3 4 5_t
Simulated data set: Gompertz distribution
. stset time,f(fail)
------------------------------------------------------------------------------10000 total obs
2
2.5
1.00Kaplan-Meier survival estimate
10000 total obs.0 exclusions
------------------------------------------------------------------------------10000 obs. remaining, representing8965 failures in single record/single failure data
9852.591 total analysis time at risk, at risk from t = 0earliest observed entry t = 0
last observed exit t = 5
5
1
1.5
pred
icte
d ha
zard
0.25
0.50
0.75
0
.5
0 1 2 3 4 5_t
0.00
0 1 2 3 4 5analysis time
02/10/2008
22
Simulated data set: Log‐logistic distribution
. stset time,f(fail)
------------------------------------------------------------------------------10000 l b05
.055
10000 total obs.0 exclusions
------------------------------------------------------------------------------10000 obs. remaining, representing2241 failures in single record/single failure data
44133.31 total analysis time at risk, at risk from t = 0earliest observed entry t = 0
last observed exit t = 5.04
.045
.05
pred
icte
d ha
zard
.03
.035
0 1 2 3 4 5_t
Simulated data set: Log‐logistic distribution
. stset time,f(fail)
------------------------------------------------------------------------------10000 l b05
.055
1.00Kaplan-Meier survival estimate
10000 total obs.0 exclusions
------------------------------------------------------------------------------10000 obs. remaining, representing2241 failures in single record/single failure data
44133.31 total analysis time at risk, at risk from t = 0earliest observed entry t = 0
last observed exit t = 5.04
.045
.05
pred
icte
d ha
zard
0.25
0.50
0.75
.03
.035
0 1 2 3 4 5_t
0.00
0 1 2 3 4 5analysis time
02/10/2008
23
BOOTSTRAP
• The survival function in the simulated data has been saved in avariable. This function should represent the population (true)survival function: Sp.p
• 1000 replicates has been done.
• In each sample the higher and lower limits of the confidencebands have been estimated according to 6 (2 methods X 3transformations) different approaches.
• Then, an ‐assert‐ statement verifies whether the confidence,bands encompass Sp.
• This also allows the coverage probabilities of the confidenceintervals to be checked.
Each replication returns 7 results (scalars):
• r1‐r6 assume value 1 if the confidence bands encompassSp , 0 otherwise
• r7 assumes value 1 if the confidence intervals encompassS 0 otherwise
bandboot‐ returns : r1=1 if EP log bands encompass the survival function
• The Equal Precision linear confidence bandsperforms slightly worse than the other|
Eq Prec ARCSINE | 10000 0.946 |
Eq Prec LINEAR | 10000 0.918_______________________________________________________
HALL-WELLNER LOG-LOG | 10000 0.951|
HALL-WELLNER ARCSINE | 10000 0.952|
performs slightly worse than the otherapproaches.
• The coverage probabilities of the Hall‐Wellnermethod correspond exactly to the nominalvalue without differences among linear, log orarcsine transformed form.
Th i t i fid i t l t l|HALL-WELLNER LINEAR | 10000 0.951________________________________________________________
POINTWISE CONFIDENCE |INTERVALS | 10000 0.297
• The pointwise confidence intervals stronglyunderestimate the variability of the survivalfunction.
|Eq Prec LINEAR | 10000 0.887_______________________________________________________
HALL-WELLNER LOG-LOG | 10000 0.949|
HALL-WELLNER ARCSINE | 10000 0.949||
HALL-WELLNER LINEAR | 10000 0.949________________________________________________________
POINTWISE CONFIDENCE |INTERVALS | 10000 0.457
RESULTS – LOG‐LOGISTIC DISTRIBUTION
| COVERAGE| Obs PROBABILITIES
-----------------------+------------------------------------Eq Prec LOG-LOG | 10000 0.915 In this different context the results look
|Eq Prec ARCSINE | 10000 0.926
|Eq Prec LINEAR | 10000 0.887_______________________________________________________
HALL-WELLNER LOG-LOG | 10000 0.949|
HALL-WELLNER ARCSINE | 10000 0.949|
corresponding to the previous one:
• the coverage probabilities of the EqualPrecision linear confidence bands performsworse
• the Hall‐Wellner method yields better resultsthan the Equal Precision
|HALL-WELLNER LINEAR | 10000 0.949________________________________________________________
POINTWISE CONFIDENCE |INTERVALS | 10000 0.457
q
• the coverage probabilities of the pointwiseconfidence intervals are again unsatisfactoryat all.
02/10/2008
26
CONCLUSIONS
• In clinical and epidemiological settings, the confidencebands should be used when dealing with the variability ofthe survival function.
• To this aim the confidence intervals are inappropriate, aspp pconfirmed by our results of two simulations. Their use is nolonger justified by the unavailability of software estimatingthe appropriate confidence bands.
• The new Stata command ‐stcband‐ makes available theestimates of the confidence bands of the survival functionaccording to 2 methods and 3 transformations.according to 2 methods and 3 transformations.
• Although not illustrated in this talk, the ‐na‐ option (1, 8) of ‐stcband‐ allows confidence bands for the cumulative hazardfunction to be estimated too.
02/10/2008
27
The full syntax of -stcband- is as follows:
stcband [if] [in] [,
nair tlower(#) tupper(#) na
transform(linear log arcsine)
genlow(newvar) genhigh(newvar) level(#->90-95-99)
nograph twoway_options ]
• The new command is also provided with a help file in which theuser can run an example, taken from Klein and Moeschberger’sbook(1), by clicking on the viewer window.
• -stcband- is available for download from the SSC‐Archive.
References1. Klein J.P. and Moeschberger M.L. Survival Analysis: techniques for Censored
and Truncated Data (2nd ed.), pp. 104‐117. New York: Springer‐Verlag, 2003.
2. Borgan O. The Kaplan‐Meier estimator in Encyclopedia of Biostatistics (eds. P.Armitage and T. Colton), vol 3, pp. 2154‐60. Chichester: Wiley, 1998
3. Strobl R. The km.ci package. Version 0.5‐1, 2007.www.mirrorservice.org/sites/lib.stat.cmu.edu/R/CRAN/doc/packages/km.ci.pdf
4. Hosmer D.W., Lemeshow S. and May S. Applied Survival Analysis (2nd ed.), pp.27‐35. Hoboken, New Jersey: John Wiley & Sons, 2008.
5. Borgan O. and Liestol K. A note on confidence intervals and bands for thesurvival function based on transformations. Scand. J. Statist. 17: 35‐41, 1990.
6. Bender R., Augustin T. and Blettner M. Generating survival times to simulateI wish to thank Maarten Buis for his brilliantg gCox proportional hazards model. Statist. Med. 2005; 24: 1713‐1723
7. Burton A. Altman D.G., Royston P. and Holder R.L. The design of simulationsstudies in medical statistics. Statist. Med. 2006: 25: 42279‐4292.
8. Borgan O. The Nelson‐Aalen estimator in Encyclopedia of Biostatistics (eds. P.Armitage and T. Colton), vol 4, pp. 2967‐72. Wiley, Chichester, 1998.
advices in constructing the simulationschecking the coverage probabilities of theconfidence bands.
02/10/2008
28
References1. Klein J.P. and Moeschberger M.L. Survival Analysis: techniques for Censored
and Truncated Data (2nd ed.), pp. 104‐117. New York: Springer‐Verlag, 2003.
2. Borgan O. The Kaplan‐Meier estimator in Encyclopedia of Biostatistics (eds. P.Armitage and T. Colton), vol 3, pp. 2154‐60. Chichester: Wiley, 1998
3. Strobl R. The km.ci package. Version 0.5‐1, 2007.www.mirrorservice.org/sites/lib.stat.cmu.edu/R/CRAN/doc/packages/km.ci.pdf
4. Hosmer D.W., Lemeshow S. and May S. Applied Survival Analysis (2nd ed.), pp.27‐35. Hoboken, New Jersey: John Wiley & Sons, 2008.
5. Borgan O. and Liestol K. A note on confidence intervals and bands for thesurvival function based on transformations. Scand. J. Statist. 17: 35‐41, 1990.
6. Bender R., Augustin T. and Blettner M. Generating survival times to simulateg gCox proportional hazards model. Statist. Med. 2005; 24: 1713‐1723
7. Burton A. Altman D.G., Royston P. and Holder R.L. The design of simulationsstudies in medical statistics. Statist. Med. 2006: 25: 42279‐4292.
8. Borgan O. The Nelson‐Aalen estimator in Encyclopedia of Biostatistics (eds. P.Armitage and T. Colton), vol 4, pp. 2967‐72. Wiley, Chichester, 1998.