I am new to survival analysis and I have a problem with proportional hazards. (I have ordered Flexible Parametric Survival Analysis Using Stata: Beyond the Cox Model and An Introduction to Survival Analysis Using Stata but they have not come yet). My data has two categorical variables and when they are used individually the assumption of proportional hazards is violated. I included their interaction and it is still violated. I then considered flexible parametric survival, stpm2 (SJ-12-4 st0165_1) and the HRs are similar to the Cox regression. It has been suggested that I need to allow for time varying in the flexible parametric survival models. My questions are:
1. Does the flexible parametric model as I have used it allow for the violation of proportional hazards?
2. As both trt and condition are determined at the start of the treatment I do not see how time variation would help.
3. If I had to allow for time variation would I include them as tvc(i.trt i.condition) or tvc(i.trt##i.condition)?
4. Am I missing something obvious and should I use a different approach?
Sorry that this is a long request.
Thank you,
Julie
1. Does the flexible parametric model as I have used it allow for the violation of proportional hazards?
2. As both trt and condition are determined at the start of the treatment I do not see how time variation would help.
3. If I had to allow for time variation would I include them as tvc(i.trt i.condition) or tvc(i.trt##i.condition)?
4. Am I missing something obvious and should I use a different approach?
Sorry that this is a long request.
Thank you,
Julie
Code:
. stset at Survival-time data settings Failure event: (assumed to fail at time=at) Observed time interval: (0, at] Exit on or before: failure -------------------------------------------------------------------------- 81 total observations 0 exclusions -------------------------------------------------------------------------- 81 observations remaining, representing 81 failures in single-record/single-failure data 20,185 total analysis time at risk and under observation At risk from t = 0 Earliest observed entry t = 0 Last observed exit t = 421 . stcox i.trt i.condition, nolog Failure _d: 1 (meaning all fail) Analysis time _t: at Cox regression with Breslow method for ties No. of subjects = 81 Number of obs = 81 No. of failures = 81 Time at risk = 20,185 LR chi2(2) = 54.27 Log likelihood = -251.17159 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ _t | Haz. ratio Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- trt | 0 | 1.000 (base) 1 | 3.474 0.941 4.60 0.000 2.043 5.906 | condition | 0 | 1.000 (base) 1 | 0.150 0.042 -6.74 0.000 0.087 0.261 ------------------------------------------------------------------------------ . estat phtest, det Test of proportional-hazards assumption Time function: Analysis time -------------------------------------------------------- | rho chi2 df Prob>chi2 -------------+------------------------------------------ 0b.trt | . . 1 . 1.trt | -0.08704 0.72 1 0.3970 0b.condition | . . 1 . 1.condition | 0.40373 10.13 1 0.0015 -------------+------------------------------------------ Global test | 10.58 2 0.0050 -------------------------------------------------------- . stcox i.trt##i.condition, nolog Failure _d: 1 (meaning all fail) Analysis time _t: at Cox regression with Breslow method for ties No. of subjects = 81 Number of obs = 81 No. of failures = 81 Time at risk = 20,185 LR chi2(3) = 57.81 Log likelihood = -249.39722 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------- _t | Haz. ratio Std. err. z P>|z| [95% conf. interval] --------------+---------------------------------------------------------------- trt | 0 | 1.000 (base) 1 | 6.560 2.926 4.22 0.000 2.737 15.723 | condition | 0 | 1.000 (base) 1 | 0.223 0.077 -4.35 0.000 0.113 0.438 | trt#condition | 1 1 | 0.370 0.197 -1.86 0.062 0.130 1.053 ------------------------------------------------------------------------------- . estat phtest, det Test of proportional-hazards assumption Time function: Analysis time -------------------------------------------------------- | rho chi2 df Prob>chi2 -------------+------------------------------------------ 0b.trt | . . 1 . 1.trt | 0.16100 3.31 1 0.0690 0b.condition | . . 1 . 1.condition | 0.34123 7.80 1 0.0052 0b.trt#0b.~n | . . 1 . 0b.trt#1o.~n | . . 1 . 1o.trt#0b.~n | . . 1 . 1.trt#1.co~n | -0.17909 3.33 1 0.0679 -------------+------------------------------------------ Global test | 10.03 3 0.0183 -------------------------------------------------------- . help stpm2 . stpm2 i.trt##i.condition, scale(hazard) df(4) eform nolog Log likelihood = 19.13481 Number of obs = 81 ------------------------------------------------------------------------------- | exp(b) Std. err. z P>|z| [95% conf. interval] --------------+---------------------------------------------------------------- xb | trt | 0 | 1.000 (base) 1 | 6.408 2.703 4.40 0.000 2.803 14.649 | condition | 0 | 1.000 (base) 1 | 0.228 0.076 -4.41 0.000 0.118 0.440 | trt#condition | 1 1 | 0.374 0.190 -1.94 0.052 0.139 1.010 | _rcs1 | 5.572 0.926 10.33 0.000 4.022 7.719 _rcs2 | 1.127 0.109 1.24 0.214 0.933 1.363 _rcs3 | 0.972 0.069 -0.40 0.688 0.846 1.117 _rcs4 | 1.000 0.047 -0.01 0.996 0.912 1.096 _cons | 0.664 0.176 -1.54 0.123 0.394 1.118 ------------------------------------------------------------------------------- Note: Estimates are transformed only in the first equation.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double trt int at double condition 0 191 0 0 267 1 0 268 1 0 186 0 0 246 1 0 281 1 0 343 1 0 164 0 0 172 0 0 146 0 0 294 1 0 304 0 0 197 0 0 300 1 0 143 0 0 298 1 0 357 1 0 250 0 0 229 0 0 214 0 0 276 1 0 320 1 0 266 1 0 355 1 0 152 0 0 362 0 0 317 1 0 421 1 0 354 1 0 192 0 0 261 0 0 374 1 0 292 0 0 151 0 0 319 1 0 286 0 0 369 1 0 352 1 1 177 0 1 202 0 1 151 0 1 160 0 1 237 1 1 268 1 1 164 0 1 219 1 1 367 1 1 239 1 1 161 0 1 159 0 1 223 1 1 175 0 1 208 0 1 293 1 1 255 1 1 152 0 1 256 1 1 345 1 1 232 1 1 236 1 1 241 1 1 199 0 1 201 0 1 204 0 1 211 0 1 245 1 1 135 0 1 267 1 1 178 0 1 266 1 1 213 0 1 324 1 1 133 0 1 332 1 1 236 1 1 294 1 1 234 1 1 308 1 1 280 1 1 260 1 1 276 1 end
Comment