Announcement

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

  • lincom for a Cox regression

    I am analysing a randomised trial of a drug versus untreated controls in 5418 children with 512 deaths. The relevant variables (all numeric) are:
    - drug (0,1)
    - ismale (0,1)
    - birthweight (continuous)
    - diedinfection (0,1)

    I would like to adjust for sex and birthweight in a Cox model (the hazards are proportional) and calculate (a) the adjusted ratio and 95% CI for deaths from infection per person-year for drug versus control, and (b) the adjusted ratio and 95% CI for deaths from non-infectious causes per person-year for drug versus control. I assume that, having stset the data, I would run in Stata 17 the command:
    Code:
    stcox i.drug##i.diedinfection i.ismale c.birthweight
    and then use lincom to calculate the drug/control ratios for (a) deaths from infection and (b) deaths from non-infectious causes. I'd be very grateful for advice about what lincom commands to use to obtain the two ratios and 95% CIs.

  • #2
    I don't think this approach can be made to work. The problem is, at a minimum, that when, say, diedinfection = 0 you are including both those who died from causes other than infection and those who didn't die at all. At a deeper level, even if you fixed that, diedinfection is not really an explanatory variable here. Rather, you have two different failure outcomes. I think you have to do a separate -stset- and a separate -stcox- for each failure mode here. Worse still, the occurrence of a death from either cause prevents you from observing a death from the other cause, so you are actually in a competing risks situation here. So -stcox- is not going to work for this. Take a look at -stcrreg-. (But it's not just a trivial variant of -stcox-; competing risks regression is a different framework, and if you are not familiar with it, you need to learn about it.)
    Last edited by Clyde Schechter; 12 Sep 2022, 10:00.

    Comment


    • #3
      Dear Clyde, Thank you very much for your advice. I'm afraid separate Cox models for each failure mode does not solve the problem because the denominator for the Drug and Control rates should be person-time for died-infection plus died-noninfection.

      With diedinfect coded as 0=Survived, 1=DiedNoninfection, 2=DiedInfection.
      Abbreviated Stata output (not adjusted for sex and birthweight):

      Code:
      . byvar drug: stptime if diedinfect >0, by(diedinfect) per(365.25)
      
      -> drug==0
       diedinf~t |  Person-time   Failures        Rate   [95% conf. interval]
      -----------+-----------------------------------------------------------
       DiedNoInf |    788.36892        139   64.398467   54.53528     76.0455
       DiedInftn |    899.06237        133   54.032124   45.58726    64.04136
      -----------+-----------------------------------------------------------
           Total |    1687.4313        272   58.875286   52.27829    66.30476
       
      -> drug==1
       diedinf~t |  Person-time   Failures        Rate   [95% conf. interval]
      -----------+-----------------------------------------------------------
       DiedNoinf |    1108.8333        165   54.351047    46.6597    63.31023
       DiedInftn |    505.77439         73   52.717676   41.91125    66.31043
      -----------+-----------------------------------------------------------
           Total |    1614.6077        238   53.839395   47.41601    61.13295
       
      
      . iri 73 133 1614.61 1687.43
                       |   Exposed   Unexposed  |      Total
      -----------------+------------------------+-----------
                 Cases |        73         133  |        206
           Person-time |   1614.61     1687.43  |    3302.04
      -----------------+------------------------+-----------
      Incidence rate   |  .0452122    .0788181  |   .0623857
      --------------------------------------------------------------------------
                       |      Point estimate    |    [95% conf. interval]
      Inc. rate ratio  |         .5736267       |   .4251129    .7688274 (exact)
       
      
      . iri 165 139 1614.61 1687.43
                       |   Exposed   Unexposed  |      Total
      -----------------+------------------------+-----------
                 Cases |       165         139  |        304
           Person-time |   1614.61     1687.43  |    3302.04
      -----------------+------------------------+-----------
      Incidence rate   |  .1021919    .0823738  |   .0920643
      --------------------------------------------------------------------------
                       |      Point estimate    |    [95% conf. interval]
      Inc. rate ratio  |         1.240587       |    .9839646   1.566019 (exact)

      Rate per 100py (Died/person-years) - not adjusted for sex and birthweight
      Drug Control MRR (95% CI)
      DiedInfection 4.52 (73/1614.61) 7.88 (133/1687.43) 0.57 (0.43-0.77)
      DiedNonInfect 10.22 (165/1614.61) 8.24 (139/1687.43) 1.24 (0.98-1.57)

      If I try a Cox model (to obtain Drug/Control ratios adjusted for sex and birthweight):
      Code:
      . stcox i.bcg#i.diedinfect i.diedinfect c.birthweight i.ismale, nolog
      ----------------------------------------------------------------------------------
                    _t | Haz. ratio   Std. err.      z    P>|z|     [95% conf. interval]
      -----------------+----------------------------------------------------------------
        bcg#diedinfect |
         BCG#Survived  |   2.26e-06   6.461306    -0.00   1.000            0           .
       BCG#DiedNonInf  |   .8153284   .0948222    -1.76   0.079       .64914    1.024063
       BCG#DiedInfect  |      .9586   .1403169    -0.29   0.773     .7195171    1.277126
      The Cox Drug/Control ratios for DiedInfection and DiedNonInfection are clearly not the ones I want (they are too different from the unadjusted ratios) - I think because the denominator for Drug is only person-time for DiedInfection or for DiedNoninfection (and not DiedInfection plus DiedNoninfection), and the denominator for Control is only person-time for DiedInfection or for DiedNoninfection (and not DiedNoninfection plus DiedInfection).

      I'm hoping there is a lincom command that would do the trick with one or other of these models:
      Code:
      stcox i.drug##i.diedinfect i.ismale c.birthweight
      or
      stcox i.bcg#i.diedinfect i.diedinfect i.ismale c.birthweight
      If lincom is not the answer, how do I calculate the ratios for Drug/Control adjusted for sex and birthweight?

      Thanks again for your help.

      Comment


      • #4
        Well, I don't have anything to offer beyond what I said in #1. Perhaps somebody else does and will join in. If I were dealing with this problem, I would approach it as a competing risks analysis, -stcrreg-, not -stcox-.

        Comment


        • #5
          Dear Clyde, Thank you very much for your help, which is much appreciated.

          I'd be very grateful if anyone else could tell me how to calculate the Drug and Control ratios for Died-Infection and Died-NonInfection in an adjusted Cox model (as in Table 3 of PMID 29579158) .

          Frank

          Comment

          Working...
          X