-2

I am trying to create an inverse KM plot of the time it takes for patients to respond to drug therapy.

Time    response
3   57
4   35
4   85
4   90
5   55
6   65
6   89
6   72
9   97
9   89
9   98
10  99
10  92
13  99
14  50
15  97
18  60
21  70
25  76
28  77
40  82
48  86

Time is in days and response is percentage. At first I thought I could try this using survival analysis but figured a hazard plot would work better. I'm not sure how to go about this.

Here is a link to a published article where the third figure shows this. I'm not an expert on KMplots yet, but any help and criticism would be highly appreciated!

https://www.researchgate.net/publication/7789803_Bortezomib_therapy_alone_and_in_combination_with_dexamethasone_for_previously_untreated_symptomatic_multiple_myeloma

Reeham
  • 1
  • 3
  • 1
    Could you please add to your question 1) a `dput()` of your data so it is easier for people to copy and paste it more easily. 2) an example of the code you tried and why it isn't what you were looking for. Also, this is not like any survival data I have ever seen before. It is usually formatted as `time` `censoring` pairs which indicate the time of an observation and whether the event occurred (ie the patient responded) or not (ie the observational period ended with no response). The way you have it, it is very difficult to tell what to plot since most times have multiple percentages. – Barker Oct 13 '16 at 19:35
  • I'm with Barker. If the "percentage" is a cumulative value it should be monotonic. If it's not cumulative ... then what is it? – IRTFM Oct 14 '16 at 04:18

1 Answers1

-1

For your question to solve I first reorganized your data into survival data I am used to. That is one row per event/censor. Then I fit a survival model and plot the KM.

dt <- as.data.frame(matrix(c(3,57
,4,35
,4,85
,4,90
,5,55
,6,65
,6,89
,6,72
,9,97
,9,89
,9,98
,10,99
,10,92
,13,99
,14,50
,15,97
,18,60
,21,70
,25,76
,28,77
,40,82
,48,86),ncol=2,byrow = TRUE))

colnames(dt) <- c("time","response")

#translate percentage of responders at each time to number of responders if we start with a population of 10000
dt$individuals <- round(10000*sapply((1:nrow(dt)),function(x){prod(dt[1:x,"response"]/100)}))

s <- data.frame(time = with(dt,rep(time, individuals))
                ,event = 1)

library(survival)

sobj <- Surv(s$time, s$event)
fit <- survfit(sobj ~ 1)
plot(fit, fun="event")

enter image description here

Wietze314
  • 5,942
  • 2
  • 21
  • 40
  • How are you interpreting the "percentage" value? I cannot tell what your plot represents since you did not interpret that value as a percentage of any particular denominator. – IRTFM Oct 14 '16 at 04:21
  • I am unsure what your response variable actually means. I guess the percentage of the population left that is responding to the treatment. If not you should clarify your data. – Wietze314 Oct 14 '16 at 09:20
  • Ah I'm sorry- the percentage is based on treatment response of drug therapy based on decreasing M-protein values over the original baseline lab value. – Reeham Oct 14 '16 at 14:14
  • ok where are the protein values in your data? And if you are looking for a survival analysis or hazard, what is the event? Can you in some way construct a life table from your data, as I have tried to do? – Wietze314 Oct 14 '16 at 18:41