*! version 2.5 04Jan2021
help stpm2cr
also see: stpm2, stpm2cr postestimation

Title

stpm2cr -- Flexible parametric competing risks regression models

Syntax

stpm2cr [cause1: [varlist] [, suboptions]]
[cause2: [varlist] [, suboptions]]
... [[causeN: [varlist] [, suboptions]]]
[if] [in]
[, options]

suboptions

Equation Options
bknots(numlist) boundary knots for baseline

bknotstvc(knots list) boundary knots for time-dependent effects

cure fit a cure model for causeN

df(#) degrees of freedom for baseline hazard function

dftvc(df_list) degrees of freedom for each time-dependent effect

knots(numlist) knot locations for baseline hazard

knotstvc(numlist) knot locations for time-dependent effects

noconstant suppress constant term

scale(scalename) specifies the scale on which the survival model is
to be fitted

tvc(varlist) varlist of time varying effects

options

Main Options
cause(numlist) indicator values for causeN

censvalue(numlist) indicator(s) for censored values; default is censvalue(0)

noorthog do not use orthogonal transformation of splines variables

Reporting
alleq report all equations

eform exponentiate coefficients

level(#) set confidence level; default is level(95)

Max options
lininit obtain initial values by first fitting a linear function of ln(time)

maximize_options control the maximization process; seldom used

You must stset your data before using stpm2cr; see [ST] stset.

fweights, iweights, and pweights may be specified using stset; [ST] stset.

Description

stpm2cr fits competing risks flexible parametric regression models (Royston-Parmar models) by directly modelling the cumulative incidence function.
stpm2cr can be used with single- or multiple-record st data. However, it cannot be used for multiple failures per subject.
stpm2cr can be fitted on either the log cumulative subdistribution hazard scale or the log cumulative odds of failure scale.

Alternatively, we may fit models using [ST] stpm2 in the presence of competing risks to either
estimate the crude probability of death after fitting a relative survival model, (see [ST] stpm2cm),
estimate the cumulative incidence function i.e. cause-specific hazards using [ST] stpm2cif or
calculate the net probability of death in a hypothetical world where competing events do not occur (a relative survival model).

Suboptions

Equation Options

bknots(knotslist) knotslist is a two-element numlist giving
the boundary knots. By default these are located at the minimum and maximum
of the uncensored survival times. They are specified on the normal time-scale.

bknotstvc(knotslist) knotslist gives the boundary knots for
any time-dependent effects. By default these are the same as for the bknots
option. They are specified on the normal time-scale.

For example,

bknotstvc(x1 0.01 10 x2 0.01 8)

cure is used when fitting cure models. It forces the cumulative hazard to
be constant after the last knot. When the df() option is used together with
the cure option the internal knots are placed evenly according to centiles of the
distribution of the uncensored log survival times except one that is placed at the
95th centile. Cure models can only be used when modelling on the log cumulative
hazard scale (scale(hazard)

df(#) specifies the degrees of freedom for the restricted
cubic spline function used for the baseline function. # must be more than 0,
but usually a value between 1 and 4 is sufficient, with 1 being the
default. The knots() option is not applicable if the df() option
is specified. The internal knots are placed at equally spaced centiles of the
distribution of the uncensored log survival times including two boundary knots
at the 0 and 100 centiles. For example, for df(4):

df internal knots centile positions

4 3 25th 50th 75th

Note again that these are interior knots and there are also boundary knots
placed at the minimum and maximum of the distribution of uncensored survival
times.

When the cure option is used df must be more than 2. An adjustment is made
to the default locations of the knots shown above. Following the same example for
df(4), we have:

df internal knots centile positions

4 3 33rd 67th 95th

dftvc(df_list) gives the degrees of freedom for time-dependent effects
in df_list. The potential degrees of freedom are listed under the
df() option. With 1 degree of freedom a linear effect of log time is fitted.
If there is more than one time-dependent effect and different degress of freedom
are requested for each time-dependent effect then the following syntax applies:

dftvc(x1:3 x2:2 1)

This will use 3 degrees of freedom for x1, 2 degrees of freedom for
x2 and 1 degree of freedom for all remaining time-dependent effects.

knots(# [# ...]) specifies knot locations for the baseline distribution
function, as opposed to the default locations set by df(). Note that
the locations of the knots are placed on the normal time-scale.
However, the scale used by the restricted cubic spline function is always
log time. Default knot positions are determined by the df() option.

knotstvc(knotslist) defines numlist knotslist as the location
of the interior knots for time-dependent effects. If different knots
are required for different time-dependent effects the option is
specified, for example, as follows:

knotstvc(x1 1 2 3 x2 1.5 3.5)

noconstant;
see [ST] estimation options.

scale(scalename) specifies on which scale the survival model is to be
fitted.

scale(hazard) fits a model on the log cumulative subhazard scale,
i.e. the scale of ln(-ln(1 - F(t))). If no time-dependent effects are specified,
the resulting model has proportional subhazards.

scale(odds) fits a model on the log cumulative odds scale for the ,
i.e. ln((F(t))/(1 - F(t))). If no time-dependent effects
are specified then this assumes proportionality of the odds ratios over time.

tvc(varlist) gives the name of the variables that are time-dependent.
Time-dependent effects are fitted using restricted cubic splines.
The degrees of freedom are specified using the dftvc() option.

Main Options

Model

cause(numlist) specifies the indicator values in the data for the causes that are fitted in the model.

censvalue(# [# ...]) specifies the indicator value(s) in the data which represents a censored individual.
More than one value can indicate a censored individual.
For example, if censored individuals are indicated by values 0 and 99, we have, censvalue(0 99).

noorthog suppresses orthogonal transformation of spline variables.

Reporting

alleq reports all equations used by ml. The models are fitted by using
various constraints for parameters associated with the derivatives of the
spline functions. These parameters are generally not of interest and thus
are not shown by default. In addition, an extra equation is used when fitting
delayed entry models, and again this is not shown by default.

eform reports the exponentiated coefficents. For models on the log
cumulative hazard scale scale(hazard) this gives hazard ratios if
the covariate is not-time dependent. Similarly, for models on the log
cumulative odds scale scale(odds) this option will give odds ratios
for non time-dependent effects.

level(#) specifies the confidence level, as a percentage, for confidence
intervals. The default is level(95) or as set by set level.

Max options

lininit This obtains initial values by fitting only the first spline
basis function (i.e. a linear function of log survival time).
This option is seldom needed.

maximize_options; difficult, technique(algorithm_spec),
iterate(#), [no]log, trace, gradient,
showstep, hessian, shownrtolerance, tolerance(#),
ltolerance(#) gtolerance(#), nrtolerance(#),
nonrtolerance, from(init_specs); see [R] maximize. These
options are seldom used, but the difficult option may be useful if there
are convergence problems when fitting models that use Aranda-Ordaz family of link
functions.

Remarks

Let t denote time. stpm2cr works by first generating the cumulative incidence function, F(t),
using [[ST]] stcompet and then fitting a regression model against a function of the cumulative incidence.
The procedure is illustrated for proportional hazards models, specified by option
scale(hazard). F(t) is converted to an estimate of the log cumulative subhazard
function Z(t) by the formula

Z(t) = ln(-ln(1 - F(t)))

This estimate of Z(t) is then smoothed on ln(t) using regression splines with
knots placed at certain quantiles of the distribution of t. The knot positions
are chosen automatically if the spline complexity is specified by the df()
option, or manually by way of the knots() option. (Note that the knots
are placed on values of ln(t), not t.) Denote the predicted values of the log cumulative
subhazard function by Z_hat(t). The density function f(t) is

f(t) = dF(t)/dt = dF/dZ_hat dZ_hat/dt = (1 - F(t)) exp(Z_hat) dZ_hat(t)/dt

dZ_hat(t)/dt is computed from the regression coefficients of the fitted spline
function. The estimated cumulative incidence function is calculated as

F_hat(t) = 1 - exp(-exp(Z_hat(t)).

The subhazard function is calculated as f(t)/(1 - F_hat(t)).

If varlist is specified, the baseline cumulative incidence function (i.e. at zero values
of the covariates) is used instead of the cumulative incidence function of the raw
observations. With df(1) a Weibull model is fitted.

With scale(odds), smoothing is of the log cumulative odds of failure function,
ln(F(t)/(1 - F(t))), instead of the log cumulative subhazard function. With
df(1) a subdistribution log-logistic model is fitted.

Estimation is performed by maximum likelihood. Optimisation uses the
default technique (nr, meaning Stata's version of Newton-Raphson
iteration.

Examples

Setup

use http://www.stata-journal.com/software/sj4-2/st0059/prostatecancer

stset time, failure(status==1, 2, 3) scale(12) id(id) noshow

tab treatment, gen(trt)

Proportional log-cumulative subdistribution hazards model

stpm2cr [prostate: trt2, scale(hazard) df(4)] [CVD: trt2, scale(hazard) df(4)] [other: trt2, scale(hazard) df(4)], events(status) cause(1 2 3) cens(0) eform

Proportional odds of failure model

stpm2cr [prostate: trt2, scale(odds) df(4)] [CVD: trt2, scale(odds) df(4)] [other: trt2, scale(odds) df(4)], events(status) cause(1 2 3) cens(0) eform

Time-dependent effects on log-cumulative subdistribution hazard scale

stpm2cr [prostate: trt2, scale(hazard) df(4) tvc(trt2) dftvc(2)] [CVD: trt2, scale(hazard) df(4) tvc(trt2) dftvc(2)] [other: trt2, scale(hazard) df(4) tvc(trt2) dftvc(2)], events(status) cause(1 2 3) cens(0) eform

Author

Sarwar I. Mozumder, University of Leicester, UK.
(sarwar.mozumder@leicester.ac.uk)

Paul Lambert, University of Leicester, UK and Karolinska Institutet, Stockholm, Sweden.
(paul.lambert@leicester.ac.uk)

Mark Rutherford, University of Leicester, UK.
(mark.rutherford@leicester.ac.uk)

References

P. C. Lambert and P. Royston. Further development of flexible parametric
models for survival analysis. Stata Journal 2009;9:265-290

P. Royston, P.C. Lambert. Flexible parametric survival analysis in Stata:
Beyond the Cox model StataPress, 2011

Also see

Online: [ST] stpm2cr postestimation;
[ST] stset,
[ST] stpm2,
[ST] stpm2cif