I’m using the -stpm2- command to generate a flexible parametric model (relative survival, >18000 cervical cancer patients 1989 - 2014). The eventual goal is to predict loss in expectation of life. Age and year were modelled using restricted cubic splines with 3 degrees of freedom for the effect of age and 3 for the effect of year. Time-dependent effects were also included.
What I wanted to do is to select the optimal number df’s for for the baseline and for the time-dependent effects, by using AIC/BIC. However, only in the model with 3/4/5/6 df’s for the baseline and 1 df for the time-dependent effects, convergence is achieved. For all the other models, convergence was not achieved.
Can anyone tell me how it is possible that, when I use more degrees of freedom for the time-dependent effects, the model does not converge? Thanks in advance!
Gr. Hans
The following code was used:
Code:
use “cervical_cancer”, clear gen patid = _n stset surv_mm, failure(status=1) scale(12) exit(time 120.5) id(patid) rcsgen age, df(3) gen(agespl) orthog /*spline variables for age*/ rcsgen yydx, df(3) gen(yearspl) orthog /*spline variables for year*/ gen _age = min(int(age + _t),99) /*merge on expected rates at exittime*/ gen _year = int(yydx + _t) sort _year sex _age merge m:1 _year sex _age using popmort, keep(match master) keepusing(rate) forval i=3/6 { forval j=1/4 { stpm2 agespl* yearspl*, scale(hazard) df(`i') bhazard(rate) tvc(agespl* yearspl*) dftvc(`j') estimates store df`i'`j' predict s`i'`j'_0, s timevar(tt) } } twoway (line s??_0* tt, sort) /// ,legend(off) estimates table df*, eq(1) keep(agespl1) se stats(AIC BIC) stpm2 agespl* yearspl*, scale(hazard) df(4) bhazard(rate) tvc(agespl* yearspl*) dftvc(1) // only model with convergence
0 Response to Flexible parametric modelling, models do not converge
Post a Comment