Análisis de Supervivencia mediante el Estimador de Kaplan-Meier en Pacientes con Diferentes Tipos de Tumor

Aplicación del análisis de supervivencia utilizando el conjunto de datos tongue

Autor/a
Afiliación

Manuel Jesús Reyes Méndez

Tecnológico Nacional de México

Fecha de publicación

10 de noviembre de 2026

1 Resumen

El análisis de supervivencia constituye una herramienta fundamental para estudiar el tiempo transcurrido hasta la ocurrencia de un evento de interés.

2 Abstract

Survival analysis is a fundamental statistical methodology for studying time-to-event data.

3 Introducción

El análisis de supervivencia permite modelar el tiempo transcurrido hasta la ocurrencia de un evento de interés Kleinbaum y Klein (2012).

Los datos censurados son una característica distintiva de este tipo de estudios Klein y Moeschberger (2003).

4 Marco Teórico

El estimador no paramétrico más utilizado para estimar la función de supervivencia es el propuesto por Kaplan y Meier (1958).

Para comparar curvas de supervivencia entre grupos suele emplearse la prueba Log-Rank propuesta por Mantel (1966).

5 Metodología

La implementación computacional se realizó mediante el paquete survival de R Therneau (2024) y la visualización mediante survminer Kassambara, Kosinski, y Biecek (2024).

5.1 Análisis de Supervivencia

\[ S(t)=P(T>t) \]

5.2 Estimador de Kaplan-Meier

\[ \hat S(t)=\prod_{t_i\leq t}\left(1-\frac{d_i}{n_i}\right) \]

5.3 Paquetes utilizados

Código
library(survival)
library(KMsurv)
library(survminer)
library(ggfortify)
library(flexsurv)
library(actuar)
library(dplyr)
library(knitr)
library(kableExtra)

5.4 Datos utilizados

Código
data("tongue")
head(tongue)
  type time delta
1    1    1     1
2    1    3     1
3    1    3     1
4    1    4     1
5    1   10     1
6    1   13     1

5.5 Descripción de variables

Variable Descripción
type Tipo de tumor
time Tiempo de seguimiento
delta Indicador del evento

5.6 Estadísticas descriptivas

Código
tongue %>%
  summarise(
    n = n(),
    tiempo_promedio = mean(time),
    tiempo_mediana = median(time),
    tiempo_maximo = max(time)
  ) %>%
  kable(caption = "Estadísticas descriptivas generales")
Estadísticas descriptivas generales
n tiempo_promedio tiempo_mediana tiempo_maximo
80 73.825 69.5 400

6 Construcción del Objeto de Supervivencia

Código
objeto_surv <- Surv(
  time = tongue$time,
  event = tongue$delta
)
objeto_surv
 [1]   1    3    3    4   10   13   13   16   16   24   26   27   28   30   30 
[16]  32   41   51   65   67   70   72   73   77   91   93   96  100  104  157 
[31] 167   61+  74+  79+  80+  81+  87+  87+  88+  89+  93+  97+ 101+ 104+ 108+
[46] 109+ 120+ 131+ 150+ 231+ 240+ 400+   1    3    4    5    5    8   12   13 
[61]  18   23   26   27   30   42   56   62   69  104  104  112  129  181    8+
[76]  67+  76+ 104+ 176+ 231+

7 Estimación de Kaplan-Meier

El estimador de Kaplan-Meier fue propuesto por Kaplan y Meier (1958).

Código
fit <- survfit(
  Surv(time, delta) ~ type,
  data = tongue
)
fit
Call: survfit(formula = Surv(time, delta) ~ type, data = tongue)

        n events median 0.95LCL 0.95UCL
type=1 52     31     93      67      NA
type=2 28     22     42      23     112

7.1 Curvas de Kaplan-Meier

Código
p <- ggsurvplot(
  fit,
  data = tongue,
  conf.int = TRUE,
  pval = TRUE,
  risk.table = TRUE,
  risk.table.height = 0.25,
  palette = c("#D55E00", "#0072B2"),
  ggtheme = theme_bw(),
  legend.title = "Tipo de Tumor",
  legend.labs = c("Tipo 1", "Tipo 2")
)
p

8 Comparación mediante Prueba Log-Rank

Código
logrank <- survdiff(
  Surv(time, delta) ~ type,
  data = tongue
)

pvalor <- 1 - pchisq(
  logrank$chisq,
  length(logrank$n)-1
)

pvalor
[1] 0.0948707

9 Discusión

La curva correspondiente al grupo de tumor tipo 1 permanece por encima de la curva del grupo tipo 2 durante gran parte del seguimiento.

Los resultados obtenidos son consistentes con los procedimientos descritos por Therneau y Grambsch (2000) y Lee y Wang (2013).

10 Conclusiones

  1. El análisis Kaplan-Meier permitió estimar adecuadamente la función de supervivencia.
  2. El grupo correspondiente al tipo de tumor 1 presentó una supervivencia aparentemente superior.
  3. La diferencia observada no alcanzó significancia estadística.

11 Referencias

Kaplan, Edward L., y Paul Meier. 1958. «Nonparametric Estimation from Incomplete Observations». Journal of the American Statistical Association 53 (282): 457-81. https://doi.org/10.1080/01621459.1958.10501452.
Kassambara, Alboukadel, Marcin Kosinski, y Przemyslaw Biecek. 2024. survminer: Drawing Survival Curves Using ggplot2.
Klein, John P., y Melvin L. Moeschberger. 2003. Survival Analysis: Techniques for Censored and Truncated Data. 2.ª ed. New York: Springer.
Kleinbaum, David G., y Mitchel Klein. 2012. Survival Analysis: A Self-Learning Text. 3.ª ed. Springer.
Lee, Elisa T., y John Wenyu Wang. 2013. Statistical Methods for Survival Data Analysis. 4.ª ed. John Wiley; Sons.
Mantel, Nathan. 1966. «Evaluation of Survival Data and Two New Rank Order Statistics Arising in Its Consideration». Cancer Chemotherapy Reports 50 (3): 163-70.
Therneau, Terry M. 2024. A Package for Survival Analysis in R.
Therneau, Terry M., y Patricia M. Grambsch. 2000. Modeling Survival Data: Extending the Cox Model. New York: Springer.

12 Anexo A. Información de la Sesión de R

Código
sessionInfo()
R version 4.6.0 (2026-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26200)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=Spanish_Mexico.utf8  LC_CTYPE=Spanish_Mexico.utf8   
[3] LC_MONETARY=Spanish_Mexico.utf8 LC_NUMERIC=C                   
[5] LC_TIME=Spanish_Mexico.utf8    

time zone: America/Ciudad_Juarez
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] kableExtra_1.4.1 knitr_1.52       dplyr_1.2.1      actuar_3.3-7    
 [5] flexsurv_2.3.2   ggfortify_0.4.24 survminer_0.5.2  ggpubr_1.0.0    
 [9] ggplot2_4.0.3    KMsurv_0.1-6     survival_3.8-6  

loaded via a namespace (and not attached):
 [1] gtable_0.3.6        xfun_0.57           htmlwidgets_1.6.4  
 [4] rstatix_1.1.0       lattice_0.22-9      numDeriv_2016.8-1.1
 [7] quadprog_1.5-8      vctrs_0.7.3         tools_4.6.0        
[10] generics_0.1.4      tibble_3.3.1        pkgconfig_2.0.3    
[13] Matrix_1.7-5        data.table_1.18.6.1 RColorBrewer_1.1-3 
[16] S7_0.2.2            lifecycle_1.0.5     compiler_4.6.0     
[19] farver_2.1.2        stringr_1.6.0       textshaping_1.0.5  
[22] statmod_1.5.2       carData_3.0-6       mstate_0.3.3       
[25] litedown_0.9        htmltools_0.5.9     yaml_2.3.12        
[28] Formula_1.2-6       pillar_1.11.1       car_3.1-5          
[31] tidyr_1.3.2         muhaz_1.2.6.5       abind_1.4-8        
[34] commonmark_2.0.0    tidyselect_1.2.1    digest_0.6.39      
[37] mvtnorm_1.4-2       stringi_1.8.7       purrr_1.2.2        
[40] labeling_0.4.3      splines_4.6.0       fastmap_1.2.0      
[43] grid_4.6.0          cli_3.6.6           magrittr_2.0.5     
[46] broom_1.0.13        withr_3.0.3         scales_1.4.0       
[49] backports_1.5.1     rmarkdown_2.31      ggtext_0.2.0       
[52] otel_0.2.0          gridExtra_2.3.1     deSolve_1.42       
[55] ggsignif_0.6.4      expint_0.2-1        evaluate_1.0.5     
[58] viridisLite_0.4.3   markdown_2.0        rlang_1.2.0        
[61] gridtext_0.1.6      Rcpp_1.1.1-1.1      glue_1.8.1         
[64] xml2_1.5.2          svglite_2.2.2       rstudioapi_0.18.0  
[67] jsonlite_2.0.0      R6_2.6.1            systemfonts_1.3.2