[R] Kaplan Meier - not for dates

Lancaster, Robert (Orbitz) ROBERT.LANCASTER at orbitz.com
Thu Nov 3 20:55:14 CET 2011


I think it really depends on what your event of interest is.  If your event is that the patient got better and "left treatment" then I think this could work.  You would have to mark as censored any patient still in treatment or any patient that stopped treatment w/o getting better (e.g. in the case of death).  You would then be predicting the cost required to make the patient well enough to leave treatment.  It is a little non-standard to use $ instead of time, but time is money after all.

You could set up your data frame with two columns: 1) cost 2) event/censored.  

Then create your survival object:
mySurv = Surv(my_data$cost,my_data$event)

And then use survfit to create your KM curves:
myFit = survfit(mySurv~NULL)


If you have other explanatory variables that you think may influence the cost, you can of course add them to your data frame and change the formula you use in survfit.  For instance, you could have some severity measure, e.g. High, Medium, Low.  You could then do:
myFit = survfit(mySurv~my_data$severity)




-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST)
Sent: Monday, October 31, 2011 1:29 PM
To: r-help at r-project.org
Subject: [R] Kaplan Meier - not for dates

I have some data which is censored and I want to determine the median.  Its actually cost data for a cohort of patients, many of whom are still on treatment and so are censored.

I can do the same sort of analysis for a survival curve and get the median survival... ...but can I just use the survival curve functions to plot an X axis that is $ rather than date? If not is there some other way to achieve this?

Thanks

Calum

********************************************************************************************************************

This message may contain confidential information. If yo...{{dropped:9}}



More information about the R-help mailing list