Announcement

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

  • Competing risk regression without a control group?

    Hello,

    I am trying to graph the cumulative hazard of running out of new medications (nonpersistence) within one year for a cohort of patients, accounting for the competing risk of death. In this example, the date the patient is censored is represented by the variable latest_fill_trunc and reason for censoring is represented by the variable persistent_end which = 2 if the patient died and =1 if the patient ran out of medications but did not die.

    Using competing risk regressions, as shown below, I can plot the comparison of patients who received one type of new medication vs another (intensification_type variable).

    Code:
    . stset latest_fill_trunc, failure (persistent_end2==1)
    
         failure event:  persistent_end2 == 1
    obs. time interval:  (0, latest_fill_trunc]
     exit on or before:  failure
    
    ------------------------------------------------------------------------------
           2691  total observations
              0  exclusions
    ------------------------------------------------------------------------------
           2691  observations remaining, representing
           1153  failures in single-record/single-failure data
         630707  total analysis time at risk and under observation
                                                    at risk from t =         0
                                         earliest observed entry t =         0
                                              last observed exit t =       365
    
    . stcrreg intensification_type, compete(persistent_end2==2)
    
             failure _d:  persistent_end2 == 1
       analysis time _t:  latest_fill_trunc
    
    Iteration 0:   log pseudolikelihood = -8818.6153  
    Iteration 1:   log pseudolikelihood = -8818.6129  
    Iteration 2:   log pseudolikelihood = -8818.6129  
    
    Competing-risks regression                       No. of obs       =      2,691
                                                     No. of subjects  =      2,691
    Failure event  : persiste~2 == 1                 No. failed       =      1,153
    Competing event: persiste~2 == 2                 No. competing    =        266
                                                     No. censored     =      1,272
    
                                                     Wald chi2(1)     =      47.38
    Log pseudolikelihood = -8818.6129                Prob > chi2      =     0.0000
    
    --------------------------------------------------------------------------------------
                         |               Robust
                      _t |        SHR   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ---------------------+----------------------------------------------------------------
    intensification_type |      1.630      0.116     6.88   0.000        1.419       1.874
    --------------------------------------------------------------------------------------
    
    stcurve, cumhaz at1(intensification_type=0) at2(intensification_type=1) ///
    xtitle(Days Following Medication Start) ///
    ylabel(0(0.2)1) yscale(range(0 1)) ytitle(Cumulative Incidence of Nonpersistnce) ///
    However, I also want to generate a graph for the entire population, not stratified by type of medication. I do not understand how to do this competing risk regressions, as they require a stratifying variable and if I attempt the same code without a stratifying variable I get errors.

    Code:
    . stcrreg, compete(persistent_end2==2)
    
             failure _d:  persistent_end2 == 1
       analysis time _t:  latest_fill_trunc
    
    Competing-risks regression                       No. of obs       =      2,691
                                                     No. of subjects  =      2,691
    Failure event  : persiste~2 == 1                 No. failed       =      1,153
    Competing event: persiste~2 == 2                 No. competing    =        266
                                                     No. censored     =      1,272
    
                                                     Wald chi2(0)     =       0.00
    Log pseudolikelihood = -8842.3574                Prob > chi2      =          .
    
    ------------------------------------------------------------------------------
                 |               Robust
              _t |        SHR   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ------------------------------------------------------------------------------
    
    stcurve, cumhaz ///
    xtitle(Days Following Medication Start) ///
    ylabel(0(0.2)1) yscale(range(0 1)) ytitle(Cumulative Incidence of Nonpersistnce) ///
    
    prediction not valid after fitting null model
    r(498);
    I also tried including a variable that represents the entire cohort (all observations cohort==1) but it is dropped from the model due to collinearity

    Code:
    . stcrreg cohort, compete(persistent_end2==2)
    note: cohort omitted because of collinearity
    
             failure _d:  persistent_end2 == 1
       analysis time _t:  latest_fill_trunc
    
    redundant or inconsistent constraints
    Is there another way to graph cumulative hazards for an entire population, accounting for competing risks, similar to what can be done with a regular stcox which does not account for competing risks

    Code:
    stset latest_fill_trunc, failure (persistent_end)
    sts graph, xtitle(Days) ytitle(% Persistence) title(Medication Level Persistence)
    Appreciate your insight

  • #2
    Hello,

    If you have not solved your problem yet, you could try
    Code:
    stcurve, cif
    Kind regards,

    Nicoletta

    Comment


    • #3
      Probably too late to be helpful, but I had a similar issue and used:

      webuse hypoxia, clear
      stset dftime, failure(failtype==1)
      gen dummy=1
      stcrreg dummy, compete(failtype==2)

      Interestingly it works fine on STATA 16 I have on one computer, but crashes on STATA 15. So version might be the issue.

      Comment

      Working...
      X