Extended Cox model (time varying exposure) with more than two treatments

Reply
New Contributor
Posts: 2

Extended Cox model (time varying exposure) with more than two treatments

Question: While using extended Cox model, where exposure is time varying and has more than two arms, how to handle that to get two different HR.


For instance, see below small data and Proc Phreg code. For data tumor01 - exposure is "0" or "1"; so I will get one HR. For data tumor012 - exposure is "0", "1" or "2"; so I should get two HR but I am getting only one HR. I tried to include time varying exposure in class statement but it gives an error.


SAS CODES:


data Tumor01;                       /*P1 - P15 variable has value of "0" and "1", say drug_A and drug_B*/

   infile datalines missover;

   input ID Time Dead Dose P1-P15;

   label ID='Subject ID';

   datalines;

1 47 1 1.0  0  1 .  1  1 1  1  1 .  .  .  . . . .

2 71 1 1.0  0  . 0  0  0 0  0  0 1  1  1  1 1 1 1

3 81 0 1.0  0  . 1  1  1 1  1  1 1  1  1  1 1 1 1

4 81 0 1.0  0  0 0  0  0 1  1  1 1  1  1  1 1 1 1

5 81 0 1.0  0  0 0  0  0 0  0  0 0  0  0  0 0 0 0

6 65 1 1.0  0  0 0  1  . .  1  1 1  1  1  1 1 . .

7 71 0 4.0  0  0 0  0  0 0  0  0 0  0  0  0 0 0 0

8 69 0 4.0  .  . 0  0  0 0  0  0 0  0  0  0 0 0 0

9 67 1 4.0  .  . 1  1  1 1  1  1 1  1  1  1 1 1 .

10 81 1  4.0 0  0  0 0  0  0 0  0  0 0  0  0 0 0 0

;

run;

          

data Tumor012;                      /*P1 - P15 variable has value of "0", "1" and "2", say drug_A, drug_B and drug_c*/

   infile datalines missover;

   input ID Time Dead Dose P1-P15;

   label ID='Subject ID';

   datalines;

1 47 1 1.0  0  1 .  1  1 1  1  1 .  .  .  . . . .

2 71 1 1.0  0  . 0  0  0 0  0  0 1  1  1  1 1 1 1

3 81 0 1.0  0  . 1  1  1 1  1  1 1  1  1  1 1 1 1

4 81 0 1.0  0  0 0  0  0 2  2  2 2  2  2  2 2 2 2

5 81 0 1.0  0  0 0  0  0 0  0  0 0  0  0  0 0 0 0

6 65 1 1.0  0  0 0  1  . .  1  1 1  1  1  1 1 . .

7 71 0 4.0  0  0 0  0  0 0  0  0 0  0  0  0 0 0 0

8 69 0 4.0  .  . 0  0  0  0  0 0  0  0 0  0 0 0 0

9 67 1 4.0  .  . 1  1  1 1  1  1 1  1  1  1 1 1 .

10 81 1  4.0 0  0  0 0  0  2 2  2  2 2  2  2 2 2 2

;

run;

proc phreg data=Tumor01;            *TRY data = tumor012;

model Time*Dead(0)= NPap / rl;

      array pp{*} P1-P15;

            do i = 1 to 15;

            if pp ne . then do;

      npap = pp ;

      end;

      end;

run;

/* QUESTION: Why I am not getting two hazard ratios for data tumor012

      Shouldn't I get HR for 1 vs 0 and for 2 vs 0    */

Super Contributor
Posts: 307

Re: Extended Cox model (time varying exposure) with more than two treatments

Please forgive me if I don't understand your problem correctly.I think the error is that you are attempting to model the effect on the categorical treatment variable (i.e. drug a, drug b, drug c) as though it is the outcome (event) of interest. The way you have specified your data and the resulting model is that you have up to 15 separate treatment events being treated as a single event.

Ask a Question
Discussion stats
  • 1 reply
  • 244 views
  • 0 likes
  • 2 in conversation