[R] How to do survival analysis with time-related IVs?

Tianxu tc332 at drexel.edu
Mon Apr 21 22:49:39 CEST 2008


Thanks. The first two links are helpful.

For the log-reg, I was initially thinking that we need to re-arrange the
dataset to make ID-Year observations (I think some books are suggesting
this), and then run regression on "hazard rate". I did not know whether we
should write code to calculate the hazard rate by ourselves. However, the
paper solved my puzzle. Thanks!



Tianxu wrote:
> 
> Hello folks,
> 
>  
> 
> I am wondering how to do survival analysis with time-related IVs in R. For
> example,
> 
>  
> 
>> > If we have time-related variables, such as the Overall Condition of
> 1990, 1991 etc., how can we include these variables in coxph model? 
> 
>> > 
> 
>> > If we can not use coxph model, do we need to rearrange the dataset to
> make it something like:
> 
>> >      ID time age drug censor     Year   Overall Condition 
> 
>> > 1     1    5  46    1      0     1990              XXX
> 
>> > 2     1    5  35    1      0     1991              XXX1
> 
>> > 3     1    6  35    1      1     1992              XXX2
> 
>> > 4     2    5  46    1      0     1990              XXX
> 
>> > 5     2    6  35    1      1     1991              XXX1
> 
>> > 6     3    6  35    1      1     1990              XXX2
> 
>  
> 
> And then run logistic regression using "censor" as the DV? 
> 
>  
> 
>  
> 
>  
> 
> Tianxu Chen 
> 
> 101 N. 33rd Street
> Academic Building, 3FL
> Drexel University
> Philadelphia, PA 19104
> Phone: 1-215-895-2884(O)
> Email: tc332 at drexel.edu  
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-do-survival-analysis-with-time-related-IVs--tp16801272p16812343.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list