0
votes

I am plotting a Kaplan-Meier (KM) curve for the readmission data which is available in the R package frailtypack. I used these simple codes which stratifies the curve by sex variable:

library(survival)
library(frailtypack)
data(readmission)
readmission
sobj<-Surv(readmission$time,readmission$event==1)
km.plot <- survfit(sobj ~readmission$sex, data = readmission)
km.plot
plot(km.plot,lty=c(1,2),lwd=2)
legend(x="bottomleft",lty=c(1,2),lwd=2, legend=c("Male","Female"))

The data is on recurrent events (i.e. subjects have multiple failure times). The output from "km.plot" tells me that there are substantial censored event times for both males and females. Under this I expect the KM curves to level-off to non-zero survival probabilities but that of the female goes zero. I still get this when I produce the plot for only the first event times, neglecting subsequent ones.

I think something is probably wrong with my code but finding it hard to figure it out. I greatly appreciate any help on this

1

1 Answers

1
votes

Do NOT create Surv-objects outside the regression arguments, and DO use column names without reference to the dataframes. The violation of those two practices in your code will prevent the ‘predict’ and ‘plot’ methods from knowing where to access the data elements using the terms attributes in the model objects.

The question of the shape of the curve: If the last event is a death then the K-M curve will drop to zero.

And please explain why you think a K-M curve would be meaningful with “repeated events”?