1
votes

In R, I arranged my database to be a counting process to apply a extended Cox model (with time varying covariates): The end points are the times to event or time to censorship and the cut points are all event times in the data:

newdatabase <- survSplit(database,cut=eventTimes,
                            end=time_to_event_variable,
                            event=Status,start="start",id="newID")

object<-coxph(Surv(newdatabase$start, newdatabase[time_to_event_variable],
                    newdatabase[Status] ~., 
                    data = newdatabase [c(some_covariates)])

now my wish is to plot individual survival curves (for individual i):

S_i_cox <- survfit(object,newdata=newdatabase,id=newID)[i] 

My problem is that survFit object describes the survival curve of patient i only for the previous event times (of other patients) till his event time (of patient i):

in other words, S_i_cox$time and S_i_cox$surv will be different for each patients depending of how many events occur before patient i event. For example, the patient with the lowest time event has only one measurement of his survival curve (in object S_i_cox).

How to have more points of the survival (and get a real estimation of the curve)? I understand that I can change the cut in survSplit to have more points but the idea is to predict also the individual survivals after actual end point event of a patient.

Thanks a lot Ilan

1
Terry Therneau says he doesn't know how to draw predicted survival curves when using models with time-varying coefficients. Search the r-help archives where this has been repeatedly discussed. This is what he said 2 years ago: "The "survival curve" for a time dependent covariate is something that is not easily defined. Read chapter 10.2.4 of the Therneau and Grambch book for a discussion of this (largely informed by the many mistakes I've myself made.)" - IRTFM

1 Answers

-1
votes

I recall doing this with an extended Cox model, like the one you describe above

Kleinbaum explains this in his book: Cox adjusted survival estimates and plots can be obtained by applying the summary or plot function to an object created from the function survfit. The first step is to run the Cox model with the coxph function.

Adjusted survival curves generally depend on the pattern of covariates. Suppose we are interested in plotting the survival curve for the pattern SEX='MALE', BLOOD_PRESSURE=130, and TREATMENT=0. First, we need to create a dataset (or dataframe) with the data.frame function with one observation. E.g:

pattern1=data.frame(SEX='MALE', BLOOD_PRESSURE=130, TREATMENT=0)

This one observation dataframe is called pattern1. To obtain Cox adjusted survival estimates apply the survfit function within the summary function as shown below:

summary(survfit(mod1,newdata=pattern1))

The first argument of the survfit function is the object called mod1 created with coxph function. The second argument supplies the dataframe containing the pattern of covariates of interest (called pattern1).

To plot it:

plot(survfit(mod1,newdata=pattern1))