[R] predict.coxph and predict.survreg

2010-11-11 Thread Michael Haenlein
Dear all, I'm struggling with predicting expected time until death for a coxph and survreg model. I have two datasets. Dataset 1 includes a certain number of people for which I know a vector of covariates (age, gender, etc.) and their event times (i.e., I know whether they have died and when if

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread David Winsemius
On Nov 11, 2010, at 3:44 AM, Michael Haenlein wrote: Dear all, I'm struggling with predicting expected time until death for a coxph and survreg model. I have two datasets. Dataset 1 includes a certain number of people for which I know a vector of covariates (age, gender, etc.) and their

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread Mattia Prosperi
Indeed, from the predict() function of the coxph you cannot get directly time predictions, but only linear and exponential risk scores. This is because, in order to get the time, a baseline hazard has to be computed and it is not straightforward since it is implicit in the Cox model. 2010/11/11

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread Michael Haenlein
Thanks very much for your answers, David and Mattia. I understand that the baseline hazard in a Cox model is unknown and that this makes the calculation of expected survival difficult. Does this change when I move to a survreg model instead? I think I'm OK with estimating a Cox model (or a

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread James C. Whanger
Michael, You are looking to compute an estimated time to death -- rather than the odds of death conditional upon time. Thus, you will want to use time to death as your dependent variable rather than a dichotomous outcome ( 0=alive, 1=death). You can accomplish this with a straight forward

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread Michael Haenlein
Thanks for the comment, James! The problem is that my initial sample (Dataset 1) is truncated. That means I only observe time to death for those individuals who actually died before end of my observation period. It is my understanding that this type of truncation creates a bias when I use a

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread David Winsemius
On Nov 11, 2010, at 12:14 PM, Michael Haenlein wrote: Thanks for the comment, James! The problem is that my initial sample (Dataset 1) is truncated. That means I only observe time to death for those individuals who actually died before end of my observation period. It is my understanding

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread Michael Haenlein
David, Mattia, James -- thanks so much for all your helpful comments! I now have a much better understanding of how to calculate what I'm interested in ... and what the risks are of doing so. Thanks and all the best, Michael On Thu, Nov 11, 2010 at 7:33 PM, David Winsemius