http://rstudio-pubs-static.s3.amazonaws.com/316989_83cbe556125645b698c9ff6cf88c4c1a.html
surv_object <- Surv(time = Datos$tsuper, event = Datos$exitus)
fit1 <- survfit(surv_object ~ 1, data = Datos)
fit1.km <- survfit(surv_object ~ 1, data = Datos, type = "kaplan-meier")
fit1.km
## Call: survfit(formula = surv_object ~ 1, data = Datos, type = "kaplan-meier")
##
## n events median 0.95LCL 0.95UCL
## 63 23 190 70 NA
summary(fit1)
## Call: survfit(formula = surv_object ~ 1, data = Datos)
##
## time n.risk n.event survival std.err lower 95% CI upper 95% CI
## 1 63 1 0.984 0.0157 0.9537 1.000
## 3 62 1 0.968 0.0221 0.9259 1.000
## 5 61 1 0.952 0.0268 0.9012 1.000
## 8 59 2 0.920 0.0343 0.8553 0.990
## 9 57 1 0.904 0.0373 0.8337 0.980
## 11 55 1 0.888 0.0401 0.8124 0.970
## 12 54 1 0.871 0.0426 0.7915 0.959
## 20 47 1 0.853 0.0455 0.7678 0.947
## 23 43 1 0.833 0.0486 0.7427 0.934
## 30 40 1 0.812 0.0516 0.7168 0.920
## 34 38 1 0.791 0.0545 0.6906 0.905
## 35 37 1 0.769 0.0571 0.6651 0.890
## 37 35 1 0.747 0.0595 0.6392 0.873
## 41 33 1 0.725 0.0619 0.6129 0.857
## 47 29 1 0.700 0.0646 0.5838 0.838
## 52 26 1 0.673 0.0675 0.5526 0.819
## 58 22 1 0.642 0.0710 0.5170 0.797
## 70 19 1 0.608 0.0749 0.4779 0.774
## 86 18 1 0.574 0.0780 0.4403 0.750
## 101 15 1 0.536 0.0816 0.3979 0.723
## 190 5 1 0.429 0.1160 0.2524 0.729
## 205 2 1 0.214 0.1624 0.0486 0.946
ggsurvplot(fit1, data = Datos, pval = FALSE, conf.int = T, title = "Curva de Supervivencia", xlab = "Tiempo", ylab = "Probabilidad de supervivencia", legend.title = "Estimación", legend.labs = "Kaplan-Meier")