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 of1990, 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 tomake 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 XXX2And 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@drexel.edu [[alternative HTML version deleted]]
David Winsemius
2008-Apr-21 13:24 UTC
[R] How to do survival analysis with time-related IVs?
"Tianxu" <tc332 at drexel.edu> wrote in news:20080421012323.F06A311662F at smtp.mail.drexel.edu:> I am wondering how to do survival analysis with time-related IVs in > R. For example,See section 4 of Fox's contribution: <http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf> <http://cran.r-project.org/doc/contrib/Fox-Companion/cox-regression.txt> <snip example>> > And then run logistic regression using "censor" as the DV? >I was initially unclear about why you were running logistic regression on "censor", but perhaps you are trying to assess the non-informative censoring assumption? The R function that immediately comes to mind is glm( ...., family=binomial). Hmisc package also has lrm(...) and associated summary and diagnostic functions. -- David Winsemius
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.
Maybe Matching Threads
- Can Asterisk ring a specific extension based on the number the outside caller dialed?
- Printer
- Centos7 Samba 4.1.12 -> Centos 5.11 Samba 3.5.2 = Rejecting auth request
- [LLVMdev] how to output the single bitcode file using gold plugin?
- How to split two levels several times?