Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: time varying covariate Cox regression


From   Reinhardt Jan Dietrich <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: AW: time varying covariate Cox regression
Date   Wed, 8 Feb 2012 17:34:21 +0000

The easiest is to recode your time varying covariate into two dummies: level1 and level2 (level 3 is the reference then)

E.g.

Gen TCATOG2_1 = TCATOG2
RECODE TCATOG2_1 (1=1) (2=0) (3=0)
Gen TCATOG2_2 = TCATOG2
RECODE TCATOG2_1 (1=0) (2=1) (3=0)

Then use both dummies instead of i.TCATOG2 ...

Jan




________________________________________
Von: [email protected] [[email protected]]&quot; im Auftrag von &quot;Tim Evans [[email protected]]
Gesendet: Mittwoch, 8. Februar 2012 18:24
An: '[email protected]'
Betreff: st: time varying covariate Cox regression

I have a time varying covariate that I am using in a Cox regression which relates to stage at diagnosis for a particular cancer type. The accepted view is that later stage tumours will have higher hazard ratios. However I have a variable with three levels that purports to suggest that later stage tumours will actually reduce the hazard ratio. I think this is being confounded by a larger number of earlier stage tumours.

What I would like to know is how do I treat a categorical variable that varies with time since I don't appear to be able to use the i. prefix when using tvc.

My code is thus:

foreach var of varlist DELAY_* TDELAY_1 {
stcox `var' age i.ttype i.grade SEX2, tvc(TCATOG2 sizegrp)
}

Output:

------------------------------------------------------------------------------
          _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
main         |
 DELAY_1_NEW |   1.157908   .0788916     2.15   0.031     1.013162    1.323332
         age |   1.053658   .0038644    14.25   0.000     1.046111     1.06126
             |
       ttype |
          2  |   2.079459   .2228057     6.83   0.000     1.685573    2.565389
          3  |   1.635624   .1590821     5.06   0.000     1.351745    1.979119
             |
       grade |
          2  |    1.23092    .104672     2.44   0.015     1.041952    1.454161
          3  |   2.162566   .2359455     7.07   0.000     1.746222    2.678176
             |
        SEX2 |   1.171438   .0926916     2.00   0.046     1.003152    1.367955
-------------+----------------------------------------------------------------
tvc          |
     TCATOG2 |    .956024   .0074053    -5.81   0.000     .9416196    .9706488
     sizegrp |   1.001568   .0038096     0.41   0.680     .9941292    1.009063
------------------------------------------------------------------------------



© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index