Hi David,

Thanks for sharing your thoughts. I agree on that. I only use this example to 
show how time dependent hazard ratios were generated, i.e. the time dependent 
hazard ratios can be generated by including an interaction term (with the time 
interval indicator variable) in the Cox model on reformatted data frame. This 
is 
what I am uncertain about and would like to confirm from the list.

Thanks again,

John




________________________________
From: David Winsemius <dwinsem...@comcast.net>

Cc: r-help@r-project.org
Sent: Mon, April 18, 2011 1:49:14 PM
Subject: Re: [R] time dependent hazard ratios


On Apr 18, 2011, at 4:09 PM, array chip wrote:

> Sorry this is a re-post. I posted it last night, haven't heard from anyone, 
>hope
> this moves the thread up a little and anyone can comment?

My observation is that coefficients of 19 in Cox (or other exponential models)  
models generally indicate numerical difficulties rather than correct estimates.

--David.
> 
> Thanks!
> 
> John
> 
> 
> 
> ----- Forwarded Message ----

> To: r-help@r-project.org
> Sent: Sun, April 17, 2011 11:33:32 PM
> Subject: time dependent hazard ratios
> 
> 
> Hi, I am new to time-dependent Cox model to estimate time dependent hazard
> ratios. Let me use aml dataset from survival package as an example:
> 
>> aml3<-survSplit(aml,cut=c(5,10,20),end="time",start="start",
>     event="status",episode="i")
> 
> This will generate the new data frame based on the time cut points 5, 10 and 
20
> and produce a indicator variable "i" that indicates the time interval 
>membership
> for each observation.
> 
> If I want to esimate hazard ratio of variable "x" (Nonmaintained vs 
Maintained)
> for each of the time intervals 0-5, 5-10, 10-20 and >=20, would the following
> calculate such HRs?
> 
>> coxph(Surv(start,time,status)~x*as.factor(i),data=aml3)
> Call:
> coxph(formula = Surv(start, time, status) ~ x * as.factor(i),
>    data = aml3)
> 
> 
>                              coef exp(coef)  se(coef)        z  p
> xNonmaintained                19.2  2.10e+08    10461  0.00183  1
> as.factor(i)1                   NA        NA        0       NA NA
> as.factor(i)2                   NA        NA        0       NA NA
> as.factor(i)3                   NA        NA         0       NA NA
> xNonmaintained:as.factor(i)1 -18.3  1.17e-08    10461 -0.00175  1
> xNonmaintained:as.factor(i)2 -19.6  3.18e-09    10461 -0.00187  1
> xNonmaintained:as.factor(i)3 -18.0  1.46e-08    10461 -0.00172  1
> 
> So my understanding is that:
> for time interval 0-5, HR=exp(19.2)=2.1e+08
> for time interval 5-10, HR=exp(19.2-18.3)=2.46
> for time interval 10-20, HR=exp(19.2-19.6)=0.67
> for time interval >=20, HR=exp(19.2-18.0)=3.32
> 
> Am I correct on estimating these time dependent HRs?
> 
> Thanks
> 
> John
> 
>     [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
West Hartford, CT
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to