[R] 95% CI of Kaplan-Meier survival in package survival

Wu Gong wg2f at mtmail.mtsu.edu
Fri Sep 24 18:07:30 CEST 2010


Hi:

My result using Kaplan-Meier estimate in survival package was inconsistent
with that from Minitab. The survival probabilities are same, but their 95%
CI are different from other calculation. Could you help me find what is
wrong with the code? Thanks in advance.

library(survival)
raw.a <- c(80,24,22,12,86,-74,48,41,39,38,
	27,24,22,19,18,16,11,10,6.3,76,
	-21,17,12,11,10,9.8,9.5,8.2,6.4,
	4.7,4.3,4.3,4.2,4.1,1.6,31)
data.a <- data.frame(time = abs(raw.a), event = raw.a >= 0)
fit.a <- survfit(Surv(time, event) ~ 1, data=data.a)
summary(fit.a)

Call: survfit(formula = Surv(time, event) ~ 1, data = data.a)

 time n.risk n.event survival std.err lower 95% CI upper 95% CI
  1.6     36       1   0.9722  0.0274      0.92000        1.000
  4.1     35       1   0.9444  0.0382      0.87251        1.000
  4.2     34       1   0.9167  0.0461      0.83069        1.000
  4.3     33       2   0.8611  0.0576      0.75524        0.982
  4.7     31       1   0.8333  0.0621      0.72007        0.964
  6.3     30       1   0.8056  0.0660      0.68611        0.946
  6.4     29       1   0.7778  0.0693      0.65317        0.926
  8.2     28       1   0.7500  0.0722      0.62109        0.906
  9.5     27       1   0.7222  0.0747      0.58978        0.884
  9.8     26       1   0.6944  0.0768      0.55916        0.862
 10.0     25       2   0.6389  0.0801      0.49977        0.817
 11.0     23       2   0.5833  0.0822      0.44261        0.769
 12.0     21       2   0.5278  0.0832      0.38749        0.719
 16.0     19       1   0.5000  0.0833      0.36066        0.693
 17.0     18       1   0.4722  0.0832      0.33432        0.667
 18.0     17       1   0.4444  0.0828      0.30846        0.640
 19.0     16       1   0.4167  0.0822      0.28309        0.613
 22.0     14       2   0.3571  0.0805      0.22962        0.555
 24.0     12       2   0.2976  0.0773      0.17889        0.495
 27.0     10       1   0.2679  0.0751      0.15463        0.464
 31.0      9       1   0.2381  0.0724      0.13120        0.432
 38.0      8       1   0.2083  0.0692      0.10865        0.399
 39.0      7       1   0.1786  0.0654      0.08711        0.366
 41.0      6       1   0.1488  0.0609      0.06673        0.332
 48.0      5       1   0.1190  0.0555      0.04773        0.297
 76.0      3       1   0.0794  0.0492      0.02355        0.267
 80.0      2       1   0.0397  0.0373      0.00628        0.251
 86.0      1       1   0.0000     NaN           NA           NA


-----
A R learner.
-- 
View this message in context: http://r.789695.n4.nabble.com/95-CI-of-Kaplan-Meier-survival-in-package-survival-tp2553696p2553696.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list