2
$\begingroup$

I have some confusion around time-dependent covariates / coefficients. I'm trying to run a cox regression with age as a time-dependent covariate. Lets say the variable is age-at-first-drivers-license (yrs) predicting first crash, among numerous other predictors. Once splitting the file time spans many years for a given id, due to another time-dependent co-variate in the dataset -

[id 1 1 1; age 20 20 20; time 5 10 15]

If I want the effect of age to vary time should I enter age as is, or should it be updated at every interval, age+elapsed time -

[id 1 1 1; newage 20 25 30; time 5 10 15]

I'm basically trying to let the effect of age vary over time, and estimate the time-dependent coefficient. I think my confusion lies in the fact that age and time are perfectly correlated. It seems odd to update it. I hope I've made some sense.

Apologies for the matrix notation.

$\endgroup$

2 Answers 2

3
$\begingroup$

Let $X(t)$ denote the time-dependent covariate representing age at time $t$.

For subject $i$ we thus have $X_i(t) = X_i(0) + t$ where $X_i(0)$ is age at baseline.

For simplicity purpose we consider a model with only one variable.

The Cox regression is hazard-based as follows, for subject $i$:

\begin{align*} h(t \mid X_i(t)) &= h_0(t) \text{exp} ( \beta X_i(t) ) \\ &= h_0(t) \text{exp} ( \beta (X_i(0) + t ) ) \\ &= h_0(t) \text{exp} ( \beta X_i(0) + \beta t ) \end{align*}

Usually $\beta$ is estimated via a partial likelihood :

let $T_1 < \dots < T_K$ the $K$ observed failure time. This partial likelihood is written :

\begin{align*} L(\beta) &= \prod _{i=1}^K \frac{e^{\beta X_i(T_i)}}{\sum_{j : T_j \geq T_i} e^{ \beta X_j(T_i)} } \\ &= \prod _{i=1}^K \frac{e^{\beta T_i + \beta X_i(0)}}{\sum_{j : T_j \geq T_i} e^{ \beta T_i + \beta X_j(0)} } \end{align*}

As $ e^{a+b} = e^a e^b$ the terms $e^{\beta T_i}$ cancelled each other so that the partial likelihood is actually

\begin{align*} L(\beta) = \prod _{i=1}^K \frac{e^{\beta X_i(0)}}{\sum_{j : T_j \geq T_i} e^{\beta X_j(0)} } \end{align*}

That is the estimation of $\beta$ for age as a time-dependent covariate will be the same as for age included as a baseline covariate.

$\endgroup$
2
$\begingroup$

Your variable is "age at first drivers license", thus is does not vary with time and is not a time-dependent covariate so you shouldn't update it.

You estimate the time-varying effect of age by including an interaction between (constant) age and a variable of time.

My answers here and here might help with implementation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.