[R] Weighted Kaplan-Meier estimates with R

rm rm at wippies.se
Wed Mar 27 17:07:32 CET 2013


Thanks to all of you for your very helpful comments! As Terry suggested,
svykm is what I was looking for.

While testing that I get the same results with the package survey as with
the package survival, I encountered the issue of how to draw survival
curves.  Apparently the implementations in the two packages differ, as I
show below.

I would very much welcome your views, since the tail of the survival curve
has a major impact on the interpretation of my results. In my data, the last
‘death’ occurs at 2094 days, while the last censoring time is 3297 days.  If
possible, I would like to say something about the probability between 2100
days and 3300 days.

So, my question is that after the last observed death, in the very simple
example below at 883 days, how should one draw the survival curve? The graph
produced by svykm (package survey) ends at 883 days, whereas survfit
(package survival) continues the graph all the way to the last censoring
time, which is at 1022 days.

Please run the code below to see my point. There are no weights. With
weights, I face the same issue.

require(survival)
lungSubSet <- lung
S <- Surv(lung$time,lung$status)
sKm <- survfit(S~1)
##
require(survey)
svyDesignObject<- svydesign(id=~1,weights=~1,data=lungSubSet)
svyKm <- svykm(S~1,design=svyDesignObject,se=T)
##
plot(svyKm,xlim=c(0,1200))
lines(sKm,conf.int=T,mark.time=F,col='green')




--
View this message in context: http://r.789695.n4.nabble.com/Re-Weighted-Kaplan-Meier-estimates-with-R-tp4662494p4662619.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list