Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cox or flexible parametric survival - problem with proportional hazards

    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
    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


  • #2
    1. Does the flexible parametric model as I have used it allow for the violation of proportional hazards?
    The proportional hazards assumption is necessary in any kind of survival analysis that calculates a hazard ratio. In fact, the concept of hazard ratio is meaningless if the proportional hazards assumption is false. The hazard ratio is, by definition, a single constant number that represents the ratio of the hazard associated with a unit difference in the variable. If the ratio of the hazard associated with a unit difference is different at different times, then there is no such unique number. And that is what the proportional hazards assumption is: it is the assumption that the ratio h(t|x+1)/h(t|x) is constant.

    When the ratio h(t|x+1)/h(t|x) varies over time, then there is no single hazard ratio definable. In that case, one has to interact the variables with time to create proportional hazards: this is what the -tvc()- option does. Now, it is also possible that whatever transformations -stpm2- may apply to the variables, even without a -tvc()- option, may result in proportional hazards for the transformed variable. (I am only vaguely familiar with -stpm2- and do not use it myself.) But if that does not happen in your case, then you would need to use -stpm2-'s -tvc()- option as well.

    2. As both trt and condition are determined at the start of the treatment I do not see how time variation would help.
    The term "time-varying covariate" does not mean that the covariate varies over time, it means that the effect of the covariate varies over time. It means that there is an interaction between the covariate and time. Having the effect of a variable that is, itself, time-invariant vary over time can accomplish fulfillment of the proportional hazards assumption.

    To take a simplistic example, suppose the hazard function in the control group is a constant, 2. And suppose that the treatment reduces the hazard to 1 during the first year, but then its effect starts to wear off and the hazard comes back up to 1.5 in years 2 and beyond. Then we do not have proportional hazards because the hazard ratio for treatment is 0.5 in the first year but 0.667 in the second year and after. In any other regression model we would say that there is an interaction between the effect of treatment and time. In survival analysis it is the same concept, but we call it "failure of proportional hazards." And the solution is the same: include an interaction between time and the treatment variable in the model. In this simplistic example, you would actually create an indicator variable for _t <= 1 vs _t > 1 and include the interaction between that indicator variable and the treatment variable to handle this. Then you would have one hazard ratio for _t <= 1 and another for _t > 1. In real life things are generally not this simple and the way in which effects vary over time is more complicated. The -tvc()- option allows you to model more complicated types of variation in effects over time.

    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)?

    Whatever way you entered them into the model varlist, I would enter them the same way.

    4. Am I missing something obvious and should I use a different approach?
    I don't think so. I think you just didn't quite understand what proportional hazards really is about.

    Comment


    • #3
      Thank you Prof. Schechter for your response.
      You are correct, I now realise that I do not really understand what 'proportional hazards' means (I thought that I did!). I will wait for the text books to come so that I can improve my understaning.

      Thank you for your time.
      Julie

      Comment

      Working...
      X