help for kmest(Roger Newson)

Compute Kaplan-Meier survival probabilities and/or percentiles as estimation results

kmest [if] [in] , [
times(numlist) centiles(numlist)
stransform(transform_expression) ctransform(transform_expression)
]

where transform_expression is an expression specifying a transformation,
in which the input to the transformation has been substituted by @.

Description

kmest is intended for use in a survival time dataset set up by stset.
It computes Kaplan-Meier survival probabilities (as computed by sts generate)
for a list of times (sorted in ascending order),
and/or Kaplan-meier percentiles for a list of percents (srted in ascending order),
and saves them as estimation results, without a variance matrix.
kmest is intended for use with the bootstrap prefix,
or possibly with the jackknife prefix,
to create confidence intervals for the Kaplan-Meier survival probabilities and/or percentiles,
possibly allowing for clustering and/or sampling-probability weighting.

Options

times(numlist) specifies a list of survival times, for which survival probabilities are estimated.
Note that the times are assumed to be given in the units specified by the scale() option of stset.

centiles(numlist) specifies a list of percents, for which survival percentiles are estimated.
Note that the percentiles are computed in the units specified by the scale() option of stset.
If a percentile is infinite, then it is set to the c-class value c(maxdouble).

Note that one of the options times() and centiles() must be present.

stransform(transform_expression) specifies a transform expression for the survival probabilities,
in which the survival probability has been replaced by @.
For instance, if we want to transform the survival probability using the logit transform,
then we use the option stransform(logit(@)).
The default is stransform(@), implying untransformed survival probabilities.

ctransform(transform_expression) specifies a transform expression for the percentiles,
in which the percentile has been replaced by @.
For instance, if we want to transform the percentile using the log transform,
then we use the option ctransform(log(@)).
The default is ctransform(@), implying untransformed percentiles.

Examples

These examples use the stan3 dataset,
which the user can download using the webuse command,
and which has already been set up as survival time data,
using the stset command.

Set-up

. webuse stan3, clear

. stset

. describe, full

Display Kaplan-Meier survival probabilities

. kmest, times(0(100)2000)

Display Kaplan-Meier percentiles

. kmest, centiles(0(25)100)

Bootstrap Kaplan-Meier survival probabilities
using the Normal-based and percentile methods

. bootstrap, reps(1000): kmest, times(0(100)2000)

. estat bootstrap, percentile

Bootstrap Kaplan-Meier percentiles

. bootstrap, reps(1000) double: kmest, centiles(0(12.5)100)

. estat bootstrap, percentile

Note that, in this case, the bootstrap command has to have the double option,
and the percentile bootstrap has to be used,
because some of the replications may have infinite percentiles,
represented by the maximum double-precision number c(maxdouble).

Bootstrap median using log transform

. bootstrap, reps(250) double eform(Median): kmest, centiles(50) ctransform(log(@))

Bootstrap survival odds using logit transform

. bootstrap, reps(250) eform(Survival odds): kmest, times(100(100)2000) stransform(logit(@))

Saved results

kmest saves the following in e():

Scalars

e(N) Number of observations

e(N_fail) Number of failures

Macros

e(stransform) stransform() option for survival probabilities

e(ctransform) ctransform() option for percentiles

e(predict) program called by predict (kmest_p)

e(properties) b

Matrices

e(b) vector of survival probability estimates (in ascending order of time)

e(times) vector of survival times (in ascending order)

e(cumfail) vector of cumulative failure counts (in ascending order of survival time)

e(temat) matrix of survival times and survival probability estimates (in ascending order of survival time)

e(centiles) vector of percents (in ascending order)

e(cemat) matrix of percents and percentile estimates (in ascending order)

e(timcen) vector of survval times and/or percents (in ascending order)

Functions

e(sample) marks estimation sample

Author

Roger Newson, Imperial College London, UK.

Email: r.newson@imperial.ac.uk

Also see

Manual: [ST] sts, [ST] stset, [R] jackknife, [R] bootstrap

On-line: help for sts, stset, jackknife, bootstrap