M8 - Cox PH Model For Time Dependence Variable
M8 - Cox PH Model For Time Dependence Variable
Review (2/3)
X’s involving t: time-dependent
Requires extended Cox model (no PH)
There are three general approaches for assessing the
PH assumption. These are
1. a graphical approach;
2. the use of time-dependent variables in an extended
Cox model; and
3. The use of a goodness-of-fit test.
4
Review (3/3)
Options when PH assumption not satisfied:
1. Use a stratified Cox (SC) model.
2. Use time-dependent variables.
When time-dependent variables are used to assess
the PH assumption for a time-independent variable,
the Cox model is extended to contain product (i.e.,
interaction) terms involving the time-independent
variable being assessed and some function of time.
5
Time-Dependent Variables
Any variable whose values differ over time.
Example:
Race: time-independent
Race × t: time-dependent
There are 3 types of variables:
• Defined variables
• Internal variables
• Ancillary variables
6
Defined Variables
Most “defined” variables are of the form of the
product of a time-independent variable multiplied
by time or some function of time g(t).
Example: E g (t ) where
1 if t t0
g (t )
0 if t t0
Internal Variables
The values change over time for any subject under
study. The reason for a change depends on “internal”
characteristics or behavior specific to the individual.
Some examples are:
1. exposure level E at time t; E(t),
2. employment status (EMP) at time t; EMP(t),
3. smoking status (SMK) at time t; SMK(t), and
4. obesity level (OBS) at time t; OBS(t).
8
Ancillary Variables
In contrast, a variable is called an “ancillary” variable if
its values change primarily because of “external”
characteristics of the environment that may affect
several individuals simultaneously. Two such examples
of this type are:
1. Air pollution index at time t for a particular
geographical area, and
2. EMP at time t, if the primary reason for the status
depends more on general economic circumstances
than on individual characteristics.
9
Example 1 (1/2)
Consider the model with one time-independent exposure
status variable E and one time-dependent predictor
x(t ) E t. The extended Cox model is
h(t | x(t )) h0 (t ) exp( E ( E t ))
The reduced model under H0 : = 0 contains only the E
variable and hence PH is satisfied. However, when ≠ 0,
it is not. To compare exposed persons (E = 1) with
unexposed persons (E = 0), we have
x* (t ) ( E 1, E t t ),
x(t ) ( E 0, E t 0)
10
Example 1 (2/2)
and
hˆ(t | E 1, E t t )
HR(t )
hˆ(t | E 0, E t 0)
exp ˆ (1 0) ˆ (t 0)
exp( ˆ ˆ t )
If ˆ 0, the HR(t ) increases exponentially with time.
The PH assumption is certainly not satisfied.
11
Example 2 (1/3)
Again we consider a one variable model. Let E(t) denote
a weekly measure of chemical exposure status at time t.
That is, E(t) = 1 if exposed, and = 0 if unexposed, at a
weekly measurement. As defined, the variable E(t) can
take on different patterns of values for different subjects.
For example, for a five-week period, subject A’s values
may be 01011, whereas subject B’s values may be
11010. In this model, the values of E(t) may change over
time for different subjects, but there is only one
coefficient corresponding to the one variable in the
model. The coefficient represents the overall effect on
survival of the time-dependent variable E(t).
12
Example 2 (2/3)
We picture this as:
E(t) = chemical exposure status at time t (weekly)
0 if unexposed at time t
1 if exposed at time t
E (t ) 01011
A:
t 12345
E (t ) 11010
B:
t 12345
h(t | x(t )) h0 (t ) exp( E (t ))
One coefficient which represents the overall effect of E(t).
13
Example 2 (3/3)
The HR formula:
hˆ(t1 | E (t1 ) 1)
HR(t1 ) exp(ˆ (1 0))
hˆ(t | E (t ) 0)
1 1
eˆ , a constant
hˆ(t2 | E (t2 ) 1)
HR(t 2 ) exp(ˆ (1 1))
hˆ(t | E (t ) 1)
2 2
e 0 1, a different constant
This example illustrates that the hazard ratio HR(t) is
time-dependent. Thus,the PH assumption is not
satisfied.
14
Example 3 (1/3)
Let us again consider a model with the exposure variable
E in Example 1 along with the variable x(t ) E the
“heavyside” function g(t) where
1 if t t0
g (t )
0 if t t0
The extended Cox model is
h(t | x(t )) h0 (t ) exp E E g (t )
The hazard ratio is
h(t | E 1) exp( ) if t t0
HR exp g (t )
h(t | E 0) exp( ) if t t0
15
Example 3 (2/3)
This hazard ratio has two distinct values. It differs over
the two fixed intervals, but is constant over each
individual interval. An alternate form of this model is:
1 if t t0 1 if t t0
g1 (t ) and g 2 (t )
0 if t t0 0 if t t0
16
Example 3 (3/3)
The hazard ratio is now expressed as
h(t | E 1)
HR
h(t | E 0)
exp( 2 ) if t t0
exp 1 g1 (t ) 2 g 2 (t )
exp( 1 ) if t t0
17
Data Example
Dataset: Addicts
Column 1: Subject ID
Column 2: Clinic (1 or 2) → exposure variable
Column 3: Survival status
0 = censored
1 = departed clinic
column 4: Survival time in days
Column 5: Prison record → covariate
0 = none, 1 = any
Column 6: Maximum Methadone dose (mg/day) → covariate
18
Part I
The following is R code, along with modified output,
that fits two K-M curves not adjusted for any
covariates to the survival data, conducts a log-
rank test for significant differences between the
two clinics’ survival curves, and then plots the
two curves.
19
Kaplan-Meier Curve
Result
The log-rank test is highly significant with p -value=
1 × 10−7.
This graph shows curve for clinic 2 is always above
curve for clinic 1.
Curves diverge, with clinic 2 being dramatically
better after about one year in retention of patients in
its treatment program.
Lastly, this suggests the PH assumption is not
satisfied.
22
Part 2
We now fit a Cox PH model which adjusts for the
three predictor variables. This hazard model is
h(t | x) h0 exp( 1Clinic 2 Prison 3Dose)
The Grambsch-Therneau test of the PH assumption
based on the scaled Schoenfeld residuals.
23
Cox PH
24
Grambsch-Therneau test
25
Schoenfeld Residuals
Results
The GLOBAL test (a LRT) for non-PH is highly
statistically significant with p -value = 0.005546.
The p -values for Prison and Dose are very large,
supporting that these variables are time-independent.
The Grambsch-Therneau test has a p -value = 0.000824
for Clinic. This provides strong evidence that the variable
Clinic violates the PH assumption and confirms what the
graph in Figure 1 suggests.
Figure 2 provides further supporting evidence of this
violation.
We recommend finding a function g(t) to multiply Clinic
by; that is, create a defined time-dependent variable, and
then fit an extended Cox model.
27
1 if t 365 1 if t 365
g1 (t ) g 2 (t )
0 if t 365 0 if t 365
28
1 if clinic 1
clinic
0 if clinic 2
The hazard ratio for the exposure variable Clinic now
varies with time. It assumes two distinct values
depending whether time < 365 days or time ≥ 365 days.
The form of the HR (3) is
t 365 : HR exp( 1 )
t 365 : HR exp( 2 )
29
Output
31
Result
The output shows a borderline nonsignificant HR = 1.583
with p-value =0.072 for the effect of Clinic when time
< 365 days. But for t ≥ 365, the HR = 6.224 is highly
significant with p -value = 2.1 × 10−6.
There is strong statistical evidence of a large difference
in clinic survival times after one year in contrast to a
small and probably insignificant difference in clinic
survival times prior to one year, with clinic 2 always
doing better in retention of patients than clinic 1. After
one year, clinic 2 is 6.224 times more likely to retain a
patient longer than clinic 1. Also, clinic 2 has 1/6.224≈
16% the risk of clinic 1 of a patient leaving its methadone
treatment program.