Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Cox regression fitting time dependent and time varing covariates


From   Chris Rogers <[email protected]>
To   [email protected]
Subject   st: Cox regression fitting time dependent and time varing covariates
Date   Fri, 17 Dec 2004 11:54:40 +0000

Hi Everyone
I'm trying to reproduce results from Cox and Oakes Analysis of Survival
Data p137 and am not having much luck (as a check before I apply a 
similar analysis to my data). If anyone can explain where I have gone 
wrong I'd be extremely gratful. 

The survival model, using data from the Stanford heart transplant 
programme, involves fitting a time dependent covariate (which is 
"switched on" when the patient receives a transplant) and a time 
varying covariate with exponential decay which is also switched on when
the transplant occurs.  I have expanded the dataset as described in the
Stata manual and fitting the time dependent covariate alone gives the 
same log-likelihood as Cox and Oakes but as soon as I add the time 
varying covariate it all goes wrong.

The model I'm trying to fit is
h(t)=h0(t) if patient has not had a transplant
and
h(t)=h0(t)*exp(b1+b2*exp(-b3*v))
if the patient had a transplant at time t-v

Cox and Oakes estimate b1, b2 and b3. I fixed b3 at 0.0563, a local 
maximum and wanted to estimate b1 and b2 (as I didn't think Stata would 
allow me to estimate all three parameters)

The code I've used is as follows

stime = survival time
died6 = indicator of outcome 6 months after listing
posttx = indicator of transplant 
wtime = time from listing to transplant

stset stime,fail(died6==1) id(id)
***** time dep covariate only
stcox posttx,nohr efron

***** time dep and time varying covariate 
gen posttx2=posttx
stcox posttx, tvc(posttx2) texp(exp(-0.0563*(_t-wtime))) nohr efron

Coc and Oakes report
b1=-0.159; b2=-0.285; max log-likelihood=-554.96
Stata gives 
b1(posttx)=2.411; b2(posttx2)=-3.997; max log-likelihood=-540.50 

Any suggestions would be much appreciated.
=====================================
Dr Chris Rogers
Bristol Heart Institute
University of Bristol
Level 7, Bristol Royal Infirmary
BRISTOL BS2 8HW

Tel: 0117 928 3143
Email: [email protected]

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index