[R] Weighted Kaplan-Meier estimates with R (with confidenceintervals)?
Blaser Nello
nblaser at ispm.unibe.ch
Mon Mar 25 13:43:42 CET 2013
The two confidence intervals should be different. In the first model you have 3 failures and the second one you have 300. More failures results in narrower confidence intervals.
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of rm
Sent: Montag, 25. März 2013 10:47
To: r-help at r-project.org
Subject: [R] Weighted Kaplan-Meier estimates with R (with confidenceintervals)?
As part of a research paper, I would like to draw both weighted and unweighted Kaplan-Meier estimates, the weight being the ’importance’ of the each project to the mass of projects whose survival I’m trying to estimate.
I know that the function survfit in the package survival accepts weights and produces confidence intervals. However, I suspect that the confidence intervals may not be correct. The reason why I suspect this is that depending on how I define the weights, I get very different confidence intervals, e.g.
require(survival)
s <- Surv(c(50,100),c(1,1))
sf <- survfit(s~1,weights=c(1,2))
plot(sf)
vs.
require(survival)
s <- Surv(c(50,100),c(1,1))
sf <- survfit(s~1,weights=c(100,200))
plot(sf)
Any suggestions would be more than welcome!
--
View this message in context: http://r.789695.n4.nabble.com/Weighted-Kaplan-Meier-estimates-with-R-with-confidence-intervals-tp4662360.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list