Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References Multi-state survival analysis in Stata Stata UK Meeting 8th-9th September 2016 Michael J. Crowther and Paul C. Lambert Department of Health Sciences University of Leicester and Department of Medical Epidemiology and Biostatistics Karolinska Institutet [email protected]Michael J. Crowther Stata UK 1 / 37
49
Embed
Multi-state survival analysis in Stata · Multi-state survival analysis in Stata Stata UK Meeting 8th-9th September 2016 Michael J. Crowther and Paul C. Lambert ... (Jackson, 2011)
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
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Multi-state survival analysis in Stata
Stata UK Meeting8th-9th September 2016
Michael J. Crowther and Paul C. Lambert
Department of Health SciencesUniversity of Leicester
andDepartment of Medical Epidemiology and Biostatistics
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Plan
I Background
I Primary breast cancer example
I Multi-state survival modelsI Common approachesI Some extensionsI Clinically useful measures of absolute risk
I New Stata multistate package
I Future research
Michael J. Crowther Stata UK 2 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Background
I In survival analysis, we often concentrate on the time to asingle event of interest
I In practice, there are many clinical examples of where apatient may experience a variety of intermediate events
I CancerI Cardiovascular disease
I This can create complex disease pathways
Michael J. Crowther Stata UK 3 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Figure: An example from stable coronary disease (Asaria et al.,2016)
Michael J. Crowther Stata UK 4 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
I We want to investigate covariate effects for each specifictransition between two states
I With the drive towards personalised medicine, andexpanded availability of registry-based data sources,including data-linkage, there are substantial opportunitiesto gain greater understanding of disease processes, andhow they change over time
Michael J. Crowther Stata UK 5 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Primary breast cancer (Sauerbrei et al., 2007)
I To illustrate, I use data from 2,982 patients with primarybreast cancer, where we have information on the time torelapse and the time to death.
I All patients begin in the initial ‘healthy’ state, which isdefined as the time of primary surgery, and can thenmove to a relapse state, or a dead state, and can also dieafter relapse.
I Covariates of interest include; age at primary surgery,tumour size (three classes; ≤ 20mm, 20-50mm, >50mm), number of positive nodes, progesterone level(fmol/l), and whether patients were on hormonal therapy(binary, yes/no). In all analyses we use a transformationof progesterone level (log(pgr + 1)).
Michael J. Crowther Stata UK 6 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
State 1: Post-surgery
State 2: Relapse
State 3: Dead
Transition 1 h1(t)
Transition 3 h3(t)
Transition 2 h2(t)
Figure: Illness-death model for primary breast cancer example.
Michael J. Crowther Stata UK 7 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Markov multi-state models
Consider a random process {Y (t), t ≥ 0} which takes thevalues in the finite state space S = {1, . . . , S}. We define thehistory of the process until time s, to beHs = {Y (u); 0 ≤ u ≤ s}. The transition probability can thenbe defined as,
P(Y (t) = b|Y (s) = a,Hs−)
where a, b ∈ S. This is the probability of being in state b attime t, given that it was in state a at time s and conditionalon the past trajectory until time s.
Michael J. Crowther Stata UK 8 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Markov multi-state models
A Markov multi-state model makes the following assumption,
P(Y (t) = b|Y (s) = a,Hs−) = P(Y (t) = b|Y (s) = a)
which implies that the future behaviour of the process is onlydependent on the present.
Michael J. Crowther Stata UK 9 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Markov multi-state models
The transition intensity is then defined as,
hab(t) = limδt→0
P(Y (t + δt) = b|Y (t) = a)
δt
Or, for the kth transition from state ak to state bk , we have
hk(t) = limδt→0
P(Y (t + δt) = bk |Y (t) = ak)
δt
which represents the instantaneous risk of moving from stateak to state bk . Our collection of transitions intensities governsthe multi-state model.
Michael J. Crowther Stata UK 10 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Estimating a multi-state models
I There are a variety of challenges in estimating transitionprobabilities in multi-state models, within bothnon-/semi-parametric and parametric frameworks (Putteret al., 2007), which I’m not going to go into today
I Essentially, a multi-state model can be specified by acombination of transition-specific survival models
I The most convenient way to do this is through thestacked data notation, where each patient has a row ofdata for each transition that they are at risk for, usingstart and stop notation (standard delayed entry setup)
Michael J. Crowther Stata UK 11 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Consider the breast cancer dataset, with recurrence-free andoverall survival
. list pid rf rfi os osi if pid==1 | pid==1371, sepby(pid) noobs
pid rf rfi os osi
1 59.1 0 59.1 alive
1371 16.6 1 24.3 deceased
Michael J. Crowther Stata UK 12 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
We can restructure using msset
Michael J. Crowther Stata UK 13 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Michael J. Crowther Stata UK 14 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
. list pid rf rfi os osi if pid==1 | pid==1371, sepby(pid) noobs
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
I Now our data is restructured and declared as survivaldata, we can use any standard survival model availablewithin Stata
I Proportional baselines across transitionsI Stratified baselinesI Shared or separate covariate effects across transitions
I This is all easy to do in Stata; however, calculatingtransition probabilities (what we are generally mostinterested in!) is not so easy
Michael J. Crowther Stata UK 16 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Calculating transition probabilities
P(Y (t) = b|Y (s) = a)
There are a variety of approaches
I Exponential distribution is convenient (Jackson, 2011)
I Numerical integration (Hsieh et al., 2002; Hinchliffeet al., 2013)
I Ordinary differential equations (Titman, 2011)
I Simulation (Iacobelli and Carstensen, 2013; Touraineet al., 2013; Jackson, 2016)
Michael J. Crowther Stata UK 17 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Simulation
I Given our estimated transition intensities, we simulate npatients through the transition matrix (Crowther andLambert, 2013)
I At specified time points, we simply count how manypeople are in each state, and divide by the total to getour transition probabilities
I To get confidence intervals, we draw from a multivariatenormal distribution, with mean vector the estimatedcoefficients from the intensity models, and associatedvariance-covariance matrix, and repeated M times
Michael J. Crowther Stata UK 18 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Extending multi-state models
I What I’ve described so far assumes the same underlyingdistribution for every transition
I Consider a set of available covariates X . We thereforedefine, for the kth transition, the hazard function at timet is,
hk(t) = h0k(t) exp(Xkβk)
where h0k(t) is the baseline hazard function for theak → bk transition, which can take any parametric formsuch that h0k(t) > 0. To maintain flexibility, we have avector of patient-level covariates included in the ak → bktransition, Xk , where Xk ∈ X .
Michael J. Crowther Stata UK 19 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Proportional baseline, transition specific age effect
Separate models...we can now use different distributions
Michael J. Crowther Stata UK 22 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Building our model
Returning to the breast cancer dataset
I Choose the best fitting parametric survival model, usingAIC and BIC
I We find that the best fitting model for transitions 1 and 3is the Royston-Parmar model with 3 degrees of freedom,and the Weibull model for transition 2.
I Adjust for important covariates; age, tumour size, numberof nodes, progesterone level
I Check proportional hazards assumption
Michael J. Crowther Stata UK 23 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
0.0
1.0
2.0
3.0
4.0
Cum
ulat
ive
haza
rd
0 5 10 15 20Follow-up time (years since surgery)
Transition 1: Post-surgery to Relapsed
0.0
1.0
2.0
3.0
4.0
Cum
ulat
ive
haza
rd
0 5 10 15 20Follow-up time (years since surgery)
Transition 2: Post-surgery to Dead
0.0
1.0
2.0
3.0
4.0
Cum
ulat
ive
haza
rd
0 5 10 15 20Follow-up time (years since surgery)
Transition 3: Relapsed to Dead
Nelson-Aalen estimate Parametric estimate
Figure: Best fitting parametric cumulative hazard curves overlaidon the Nelson-Aalen estimate for each transition.
Michael J. Crowther Stata UK 24 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Final model
I Transition 1: Royston-Parmar baseline with df=3, age,tumour size, number of positive nodes, hormonal therapy.Non-PH in tumour size (both levels) and progesteronelevel, modelled with interaction with log time.
I Transition 3: Royston-Parmar with df=3, age, tumoursize, number of positive nodes, hormonal therapy.Non-PH found in progesterone level, modelled withinteraction with log time.
Michael J. Crowther Stata UK 25 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
predictms, transmat(tmat) at(age 54 pr 1 3 sz2 1)
> models(m1 m2 m3)
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0P
roba
bilit
y
0 5 10 15Follow-up time
Size <=20 mm
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
Pro
babi
lity
0 5 10 15Follow-up time
Size >20-50mmm
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
Pro
babi
lity
0 5 10 15Follow-up time
Size >50 mm
Prob. state=1 Prob. state=2 Prob. state=3
Figure: Probability of being in each state for a patient aged 54,with progesterone level (transformed scale) of 3.
Michael J. Crowther Stata UK 26 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
predictms, transmat(tmat) at(age 54 pr 1 3 sz2 1)
> models(m1 m2 m3) ci
0.0
0.2
0.4
0.6
0.8
1.0
0 5 10 15Years since surgery
Post-surgery
0.0
0.2
0.4
0.6
0.8
1.0
0 5 10 15Years since surgery
Relapsed
0.0
0.2
0.4
0.6
0.8
1.0
0 5 10 15Years since surgery
Died
Probability 95% confidence interval
Figure: Probability of being in each state for a patient aged 54,50> size ≥20 mm, with progesterone level (transformed scale) of3, and associated confidence intervals.
Michael J. Crowther Stata UK 27 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Differences in transition probabilities
-0.4
-0.2
0.0
0.2
0.4
0 5 10 15Follow-up time
Post-surgery
-0.4
-0.2
0.0
0.2
0.4
0 5 10 15Follow-up time
Relapsed
-0.4
-0.2
0.0
0.2
0.4
0 5 10 15Follow-up time
Died
Prob(Size <=20 mm) - Prob(20mm< Size <50mmm)
Difference in probabilities 95% confidence interval
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Ratios of transition probabilities
0.0
1.0
2.0
3.0
0 5 10 15Follow-up time
Post-surgery
0.0
1.0
2.0
3.0
0 5 10 15Follow-up time
Relapsed
0.0
1.0
2.0
3.0
0 5 10 15Follow-up time
Died
Prob(Size <=20 mm) / Prob(20mm< Size <50mmm)
Ratio of probabilities 95% confidence interval
. predictms, transmat(tmat) models(m1 m2 m3) ///
. at(age 54 pgr 3 size1 1) at2(age 54 pgr 3 size2 1) ci ratio
Michael J. Crowther Stata UK 29 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Length of stay
A clinically useful measure is called length of stay, whichdefines the amount of time spent in a particular state.∫ t
s
P(Y (u) = b|Y (s) = a)du
Using this we could calculate life expectancy if t = ∞, anda = b = 1 (Touraine et al., 2013). Thanks to the simulationapproach, we can calculate such things extremely easily.
Michael J. Crowther Stata UK 30 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Length of stay
0.0
2.0
4.0
6.0
8.0
10.0
0 5 10 15Years since surgery
Post-surgery
0.0
2.0
4.0
6.0
8.0
10.0
0 5 10 15Years since surgery
Relapsed
0.0
2.0
4.0
6.0
8.0
10.0
0 5 10 15Years since surgery
Died
Length of stay 95% confidence interval
. predictms, transmat(tmat) models(m1 m2 m3) ///
. at(age 54 pgr 3 size1 1) ci los
Michael J. Crowther Stata UK 31 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Differences in length of stay
-4.0
-2.0
0.0
2.0
4.0
0 5 10 15Follow-up time
Post-surgery
-4.0
-2.0
0.0
2.0
4.0
0 5 10 15Follow-up time
Relapsed
-4.0
-2.0
0.0
2.0
4.0
0 5 10 15Follow-up time
Died
LoS(Size <=20 mm) - LoS(20mm< Size <50mmm)
Difference in length of stay 95% confidence interval
. predictms, transmat(tmat) models(m1 m2 m3) ///
. at(age 54 pgr 3 size1 1) at2(age 54 pgr 3 size2 1) ci los
Michael J. Crowther Stata UK 32 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Ratios in length of stay
0.1
0.5
1.0
5.0
10.0
30.0
90.0
0 5 10 15Follow-up time
Post-surgery
0.1
0.5
1.0
5.0
10.0
30.0
90.0
0 5 10 15Follow-up time
Relapsed
0.1
0.5
1.0
5.0
10.0
30.0
90.0
0 5 10 15Follow-up time
Died
LoS(Size <=20 mm) / LoS(20mm< Size <50mmm)
Ratio of length of stays 95% confidence interval
. predictms, transmat(tmat) models(m1 m2 m3) ///
. at(age 54 pgr 3 size1 1) at2(age 54 pgr 3 size2 1) ci los ratio
Michael J. Crowther Stata UK 33 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
Sharing covariate effects
I Fitting models separately to each transition means we canno longer share covariate effects - one of the benefits offitting to the stacked data
I We therefore want to fit different distributions, butjointly, to the stacked data, which will allow us toconstrain parameters to be equal across transitions
Michael J. Crowther Stata UK 34 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
. predictms, transmat(tmat) at(age 34 sz2 1 nodes 5) ci
Michael J. Crowther Stata UK 35 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
SummaryI Multi-state survival models are increasingly being used to
gain much greater insights into complex disease pathways
I The transition-specific distribution approach I’vedescribed provides substantial flexibility
I We can fit a very complex model, but immediately obtaininterpretable measures of absolute and relative risk
I Software now makes them accessibleI ssc install multistate
I Extensions:I Semi-Markov - reset with predictmsI Cox model will also be available (mstate in R)I Reversible transition matrixI Standardised predictions - std (Gran et al., 2015;
Sjolander, 2016)
Michael J. Crowther Stata UK 36 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
SummaryI Multi-state survival models are increasingly being used to
gain much greater insights into complex disease pathwaysI The transition-specific distribution approach I’ve
described provides substantial flexibility
I We can fit a very complex model, but immediately obtaininterpretable measures of absolute and relative risk
I Software now makes them accessibleI ssc install multistate
I Extensions:I Semi-Markov - reset with predictmsI Cox model will also be available (mstate in R)I Reversible transition matrixI Standardised predictions - std (Gran et al., 2015;
Sjolander, 2016)
Michael J. Crowther Stata UK 36 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
SummaryI Multi-state survival models are increasingly being used to
gain much greater insights into complex disease pathwaysI The transition-specific distribution approach I’ve
described provides substantial flexibilityI We can fit a very complex model, but immediately obtain
interpretable measures of absolute and relative risk
I Software now makes them accessibleI ssc install multistate
I Extensions:I Semi-Markov - reset with predictmsI Cox model will also be available (mstate in R)I Reversible transition matrixI Standardised predictions - std (Gran et al., 2015;
Sjolander, 2016)
Michael J. Crowther Stata UK 36 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
SummaryI Multi-state survival models are increasingly being used to
gain much greater insights into complex disease pathwaysI The transition-specific distribution approach I’ve
described provides substantial flexibilityI We can fit a very complex model, but immediately obtain
interpretable measures of absolute and relative riskI Software now makes them accessible
I ssc install multistate
I Extensions:I Semi-Markov - reset with predictmsI Cox model will also be available (mstate in R)I Reversible transition matrixI Standardised predictions - std (Gran et al., 2015;
Sjolander, 2016)
Michael J. Crowther Stata UK 36 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
SummaryI Multi-state survival models are increasingly being used to
gain much greater insights into complex disease pathwaysI The transition-specific distribution approach I’ve
described provides substantial flexibilityI We can fit a very complex model, but immediately obtain
interpretable measures of absolute and relative riskI Software now makes them accessible
I ssc install multistate
I Extensions:I Semi-Markov - reset with predictmsI Cox model will also be available (mstate in R)I Reversible transition matrixI Standardised predictions - std (Gran et al., 2015;
Sjolander, 2016)
Michael J. Crowther Stata UK 36 / 37
Background Primary breast cancer Multi-state models Transition probabilities Extensions Summary References
References IAsaria, M., Walker, S., Palmer, S., Gale, C. P., Shah, A. D., Abrams, K. R., Crowther, M., Manca, A., Timmis, A.,
Hemingway, H., et al. Using electronic health records to predict costs and outcomes in stable coronary arterydisease. Heart, 102(10):755–762, 2016.
Crowther, M. J. and Lambert, P. C. Simulating biologically plausible complex survival data. Stat Med, 32(23):4118–4134, 2013.
Gran, J. M., Lie, S. A., Øyeflaten, I., Borgan, Ø., and Aalen, O. O. Causal inference in multi-state models–sicknessabsence and work for 1145 participants after work rehabilitation. BMC Public Health, 15(1):1–16, 2015.
Hinchliffe, S. R., Scott, D. A., and Lambert, P. C. Flexible parametric illness-death models. Stata Journal, 13(4):759–775, 2013.
Hsieh, H.-J., Chen, T. H.-H., and Chang, S.-H. Assessing chronic disease progression using non-homogeneousexponential regression Markov models: an illustration using a selective breast cancer screening in Taiwan.Statistics in medicine, 21(22):3369–3382, 2002.
Iacobelli, S. and Carstensen, B. Multiple time scales in multi-state models. Stat Med, 32(30):5315–5327, Dec 2013.
Jackson, C. flexsurv: A platform for parametric survival modeling in r. Journal of Statistical Software, 70(1):1–33,2016.
Jackson, C. H. Multi-state models for panel data: the msm package for R. Journal of Statistical Software, 38(8):1–29, 2011.
Putter, H., Fiocco, M., and Geskus, R. B. Tutorial in biostatistics: competing risks and multi-state models. StatMed, 26(11):2389–2430, 2007.
Sauerbrei, W., Royston, P., and Look, M. A new proposal for multivariable modelling of time-varying effects insurvival data based on fractional polynomial time-transformation. Biometrical Journal, 49:453–473, 2007.
Sjolander, A. Regression standardization with the r package stdreg. European Journal of Epidemiology, 31(6):563–574, 2016.
Titman, A. C. Flexible nonhomogeneous Markov models for panel observed data. Biometrics, 67(3):780–787, Sep2011.
Touraine, C., Helmer, C., and Joly, P. Predictions in an illness-death model. Statistical methods in medicalresearch, 2013.