Tratamientos recibidos

library(readxl)
GAT <- read_excel("GAT.xlsx")
#se unifican las variables antes y después del diagnóstico por tipo de tratamiento. 

library(dplyr)
GAT <- GAT %>% 
  mutate(QUIM = ifelse(AQuimioTerSiste == "Checked" | BQuimioTerSiste == "Checked", 1, 0)) %>% 
  mutate(RAD = ifelse(ARadio == "Checked" | BRadio == "Checked", 1, 0)) %>% 
  mutate(CIR = ifelse(ACirugia == "Checked" | BCirugia == "Checked", 1, 0)) %>% 
  mutate(PAL = ifelse(APaliativo == "Checked" | BPaliativo == "Checked", 1, 0))

library(limma)
V <- vennCounts(GAT[,139:142])
V
##    QUIM RAD CIR PAL Counts
## 1     0   0   0   0      3
## 2     0   0   0   1     30
## 3     0   0   1   0     71
## 4     0   0   1   1      8
## 5     0   1   0   0     16
## 6     0   1   0   1      2
## 7     0   1   1   0     20
## 8     0   1   1   1      2
## 9     1   0   0   0   1141
## 10    1   0   0   1      4
## 11    1   0   1   0    747
## 12    1   0   1   1     15
## 13    1   1   0   0    335
## 14    1   1   0   1      6
## 15    1   1   1   0    702
## 16    1   1   1   1     15
## attr(,"class")
## [1] "VennCounts"
vennDiagram(V, cex = 1, circle.col = c("black", "#8B7E66", "grey", "#B4CDCD"),
            counts.col = "black", lwd = 2)

Otra visualizacion

#sapply(GAT[139:142], class)
library(UpSetR)
GATPLOT <- as.data.frame(GAT[139:142])
upset(GATPLOT, order.by = "freq", nsets = 4, nintersects = NA, matrix.color = "#8B5A2B", 
      main.bar.color = "black", sets.bar.color = "#8B8386", mainbar.y.label = "Frecuencia Tratamiento", 
      sets.x.label = "Tratamiento", point.size = 2, line.size = 0.5, number.angles = 0, 
      group.by = "degree", shade.alpha = 1, matrix.dot.alpha = 1, 
      scale.intersections = "identity", scale.sets = "identity", text.scale = 1.5, set_size.show = T)

2965 en quimioterapia (antes o despues del diagnostico)

Cruce tratamiento con variables sociodemográficas filtrando por uso de MAC

GAT_MAC <- GAT %>% filter(AlternativaActual == "Si")
GATPLOT2 <- as.data.frame(GAT_MAC[139:142])
upset(GATPLOT2, order.by = "freq", nsets = 4, nintersects = NA, matrix.color = "#8B5A2B", 
      main.bar.color = "black", sets.bar.color = "#8B8386", mainbar.y.label = "Frecuencia Tratamiento", 
      sets.x.label = "Tratamiento", point.size = 2, line.size = 0.5, number.angles = 0, 
      group.by = "degree", shade.alpha = 1, matrix.dot.alpha = 1, 
      scale.intersections = "identity", scale.sets = "identity", text.scale = 1.5, set_size.show = T)

1549 QUIMIOTERAPIA

Cruce de variables

#categorizacion edad
GAT_MAC <- GAT_MAC %>% mutate(Edadcat = cut(Edad, breaks = c(-Inf, 49, 64, Inf), right = F, labels = c("< 50 años", "50 - 64 años", ">=65")))
library(tableone)
GAT_MAC$Sexo <- as.factor(GAT_MAC$Sexo)
GAT_MAC$Ocupacion <- as.factor(GAT_MAC$Ocupacion)
GAT_MAC$Religion <- as.factor(GAT_MAC$Religion)

#codificacion tratamientos
GAT_MAC$QUIM <- ifelse(GAT_MAC$QUIM == 1, "Sí", "No")
GAT_MAC$RAD <- ifelse(GAT_MAC$RAD == 1, "Sí", "No")
GAT_MAC$CIR <- ifelse(GAT_MAC$CIR == 1, "Sí", "No")
GAT_MAC$PAL <- ifelse(GAT_MAC$PAL == 1, "Sí", "No")

GAT_MAC$QUIM <- as.factor(GAT_MAC$QUIM)
GAT_MAC$RAD <- as.factor(GAT_MAC$RAD)
GAT_MAC$CIR <- as.factor(GAT_MAC$CIR)
GAT_MAC$PAL <- as.factor(GAT_MAC$PAL)

myVars1 <- c("Sexo", "Ocupacion", "Religion", "Edadcat")
catVars1 <- c("Sexo", "Ocupacion", "Religion", "Edadcat")
table1 <- CreateTableOne(vars = myVars1, data = GAT_MAC, factorVars = catVars1, includeNA = FALSE, strata = "QUIM")
table2 <- CreateTableOne(vars = myVars1, data = GAT_MAC, factorVars = catVars1, includeNA = FALSE, strata = "RAD")
table3 <- CreateTableOne(vars = myVars1, data = GAT_MAC, factorVars = catVars1, includeNA = FALSE, strata = "CIR")
table4 <- CreateTableOne(vars = myVars1, data = GAT_MAC, factorVars = catVars1, includeNA = FALSE, strata = "PAL")
table1 <- as.data.frame(print(table1, show.all = TRUE, printToggle = FALSE))
table2 <- as.data.frame(print(table2, show.all = TRUE, printToggle = FALSE))
table3 <- as.data.frame(print(table3, show.all = TRUE, printToggle = FALSE))
table4 <- as.data.frame(print(table4, show.all = TRUE, printToggle = FALSE))
library(knitr)
library(kableExtra)
kable(table1, format = "html", caption = "Cruce Quim - VRBLS SOCIO_DEM.") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"), 
                full_width = F, 
                position = "center") %>%
  column_spec(1, bold = T, color = "white", background = "#D7261E") %>%
  column_spec(2, border_left = T, background = "#F3E6E3")
Cruce Quim - VRBLS SOCIO_DEM.
No p test
n 61 1549
Sexo = Masculino (%) 24 (39.3) 458 (29.6) 0.135
Ocupacion (%) 0.281
Cesante 7 (11.5) 156 (10.1)
Empleado 8 (13.1) 227 (14.7)
Estudiante 2 ( 3.3) 14 ( 0.9)
Hogar 21 (34.4) 674 (43.5)
Independiente 11 (18.0) 268 (17.3)
Pensionado 12 (19.7) 210 (13.6)
Religion (%) 0.007
Católica 45 (73.8) 1177 (76.0)
Cristiana 6 ( 9.8) 273 (17.6)
Judía 0 ( 0.0) 2 ( 0.1)
No profesa religión 7 (11.5) 50 ( 3.2)
Otra 3 ( 4.9) 47 ( 3.0)
Edadcat (%) 0.017
< 50 años 10 (16.4) 369 (23.8)
50 - 64 años 18 (29.5) 620 (40.0)
>=65 33 (54.1) 560 (36.2)
kable(table2, format = "html", caption = "Cruce RAD - VRBLS SOCIO_DEM.") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"), 
                full_width = F, 
                position = "center") %>%
  column_spec(1, bold = T, color = "white", background = "blue") %>%
  column_spec(2, border_left = T, background = "#ADD8E6")
Cruce RAD - VRBLS SOCIO_DEM.
No p test
n 1033 577
Sexo = Masculino (%) 313 (30.3) 169 (29.3) 0.713
Ocupacion (%) 0.083
Cesante 102 ( 9.9) 61 (10.6)
Empleado 166 (16.1) 69 (12.0)
Estudiante 7 ( 0.7) 9 ( 1.6)
Hogar 450 (43.6) 245 (42.5)
Independiente 176 (17.0) 103 (17.9)
Pensionado 132 (12.8) 90 (15.6)
Religion (%) 0.026
Católica 765 (74.1) 457 (79.2)
Cristiana 185 (17.9) 94 (16.3)
Judía 1 ( 0.1) 1 ( 0.2)
No profesa religión 47 ( 4.5) 10 ( 1.7)
Otra 35 ( 3.4) 15 ( 2.6)
Edadcat (%) 0.064
< 50 años 260 (25.2) 119 (20.6)
50 - 64 años 410 (39.7) 228 (39.5)
>=65 363 (35.1) 230 (39.9)
kable(table3, format = "html", caption = "Cruce CIR - VRBLS SOCIO_DEM.") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"), 
                full_width = F, 
                position = "center") %>%
  column_spec(1, bold = T, color = "white", background = "#698B22") %>%
  column_spec(2, border_left = T, background = "#98FB98")
Cruce CIR - VRBLS SOCIO_DEM.
No p test
n 782 828
Sexo = Masculino (%) 257 (32.9) 225 (27.2) 0.015
Ocupacion (%) 0.890
Cesante 78 (10.0) 85 (10.3)
Empleado 114 (14.6) 121 (14.6)
Estudiante 7 ( 0.9) 9 ( 1.1)
Hogar 345 (44.1) 350 (42.3)
Independiente 138 (17.6) 141 (17.0)
Pensionado 100 (12.8) 122 (14.7)
Religion (%) 0.078
Católica 572 (73.1) 650 (78.5)
Cristiana 145 (18.5) 134 (16.2)
Judía 1 ( 0.1) 1 ( 0.1)
No profesa religión 33 ( 4.2) 24 ( 2.9)
Otra 31 ( 4.0) 19 ( 2.3)
Edadcat (%) 0.089
< 50 años 202 (25.8) 177 (21.4)
50 - 64 años 295 (37.7) 343 (41.4)
>=65 285 (36.4) 308 (37.2)
kable(table4, format = "html", caption = "Cruce PAL - VRBLS SOCIO_DEM.") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"), 
                full_width = F, 
                position = "center") %>%
  column_spec(1, bold = T, color = "white", background = "#8B475D") %>%
  column_spec(2, border_left = T, background = "#FFC0CB")
Cruce PAL - VRBLS SOCIO_DEM.
No p test
n 1569 41
Sexo = Masculino (%) 466 (29.7) 16 (39.0) 0.265
Ocupacion (%) 0.038
Cesante 153 ( 9.8) 10 (24.4)
Empleado 231 (14.7) 4 ( 9.8)
Estudiante 15 ( 1.0) 1 ( 2.4)
Hogar 681 (43.4) 14 (34.1)
Independiente 274 (17.5) 5 (12.2)
Pensionado 215 (13.7) 7 (17.1)
Religion (%) 0.219
Católica 1195 (76.2) 27 (65.9)
Cristiana 271 (17.3) 8 (19.5)
Judía 2 ( 0.1) 0 ( 0.0)
No profesa religión 53 ( 3.4) 4 ( 9.8)
Otra 48 ( 3.1) 2 ( 4.9)
Edadcat (%) 0.005
< 50 años 374 (23.8) 5 (12.2)
50 - 64 años 627 (40.0) 11 (26.8)
>=65 568 (36.2) 25 (61.0)

Tipo de cáncer

table(GAT_MAC$EstadoCancer)
## 
## Con ganglios comprometidos, pero sin metástasis a otros órganos 
##                                                             301 
##                                  Con metástasis a otros órganos 
##                                                             425 
##                                                      Localizado 
##                                                             739 
##                                                         No sabe 
##                                                             145
GAT_TRAT <- GAT %>% filter(EstadoCancer != "No sabe")
table(GAT_TRAT$EstadoCancer)
## 
## Con ganglios comprometidos, pero sin metástasis a otros órganos 
##                                                             549 
##                                  Con metástasis a otros órganos 
##                                                             826 
##                                                      Localizado 
##                                                            1455
GAT_TRAT <- GAT_TRAT %>%
  mutate(EstadoCancer = case_when(
    EstadoCancer == "Con ganglios comprometidos, pero sin metástasis a otros órganos" | EstadoCancer == "Localizado" ~ "Localizado/Con ganglios comprometidos",
    EstadoCancer == "Con metástasis a otros órganos" ~ "Metastasis"
  ))
table(GAT_TRAT$EstadoCancer)
## 
## Localizado/Con ganglios comprometidos                            Metastasis 
##                                  2004                                   826

CRUCE DIAGNOSTICO

GAT_TRAT$AlternativaActual <- as.factor(GAT_TRAT$AlternativaActual)
GAT_TRAT$Sexo <- as.factor(GAT_TRAT$Sexo)
GAT_TRAT$Ocupacion <- as.factor(GAT_TRAT$Ocupacion)
GAT_TRAT$Religion <- as.factor(GAT_TRAT$Religion)
GAT_TRAT <- GAT_TRAT %>% mutate(Edadcat = cut(Edad, breaks = c(-Inf, 49, 64, Inf), right = F, labels = c("< 50 años", "50 - 64 años", ">=65")))
GAT_TRAT$EstadoCancer <- as.factor(GAT_TRAT$EstadoCancer)

myVars2 <- c("Sexo", "Ocupacion", "Religion", "Edadcat", "EstadoCancer")
catVars2 <- c("Sexo", "Ocupacion", "Religion", "Edadcat", "EstadoCancer")
table5 <- CreateTableOne(vars = myVars2, data = GAT_TRAT, factorVars = catVars2, includeNA = FALSE, strata = "AlternativaActual", addOverall = TRUE)
table5 <- as.data.frame(print(table5, show.all = TRUE, printToggle = FALSE))
kable(table5, format = "html", caption = "Cruce MAC - VRBLS SOCIO_DEM.") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"), 
                full_width = F, 
                position = "center") %>%
  column_spec(1, bold = T, color = "white", background = "orange") %>%
  column_spec(2, border_left = T, background = "#EEDD82")
Cruce MAC - VRBLS SOCIO_DEM.
Overall No Si p test
n 2830 1365 1465
Sexo = Masculino (%) 1044 (36.9) 607 (44.5) 437 (29.8) <0.001
Ocupacion (%) <0.001
Cesante 362 (12.8) 223 (16.3) 139 ( 9.5)
Empleado 412 (14.6) 192 (14.1) 220 (15.0)
Estudiante 28 ( 1.0) 12 ( 0.9) 16 ( 1.1)
Hogar 1152 (40.7) 517 (37.9) 635 (43.3)
Independiente 445 (15.7) 187 (13.7) 258 (17.6)
Pensionado 431 (15.2) 234 (17.1) 197 (13.4)
Religion (%) <0.001
Católica 2214 (78.2) 1104 (80.9) 1110 (75.8)
Cristiana 417 (14.7) 164 (12.0) 253 (17.3)
Judía 3 ( 0.1) 1 ( 0.1) 2 ( 0.1)
No profesa religión 120 ( 4.2) 68 ( 5.0) 52 ( 3.5)
Otra 76 ( 2.7) 28 ( 2.1) 48 ( 3.3)
Edadcat (%) <0.001
< 50 años 638 (22.5) 277 (20.3) 361 (24.6)
50 - 64 años 1044 (36.9) 450 (33.0) 594 (40.5)
>=65 1148 (40.6) 638 (46.7) 510 (34.8)
EstadoCancer = Metastasis (%) 826 (29.2) 401 (29.4) 425 (29.0) 0.862

Cruce 2

myVars3 <- c("Sexo", "Ocupacion", "Religion", "Edadcat")
catVars3 <- c("Sexo", "Ocupacion", "Religion", "Edadcat")
table6 <- CreateTableOne(vars = myVars3, data = GAT_TRAT, factorVars = catVars3, includeNA = FALSE, strata = "EstadoCancer", addOverall = TRUE)
table6 <- as.data.frame(print(table6, show.all = TRUE, printToggle = FALSE))
kable(table6, format = "html", caption = "Cruce MAC - VRBLS SOCIO_DEM.") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"), 
                full_width = F, 
                position = "center") %>%
  column_spec(1, bold = T, color = "white", background = "brown") %>%
  column_spec(2, border_left = T, background = "#D2691E")
Cruce MAC - VRBLS SOCIO_DEM.
Overall Localizado/Con ganglios comprometidos Metastasis p test
n 2830 2004 826
Sexo = Masculino (%) 1044 (36.9) 685 (34.2) 359 (43.5) <0.001
Ocupacion (%) <0.001
Cesante 362 (12.8) 213 (10.6) 149 (18.0)
Empleado 412 (14.6) 317 (15.8) 95 (11.5)
Estudiante 28 ( 1.0) 21 ( 1.0) 7 ( 0.8)
Hogar 1152 (40.7) 834 (41.6) 318 (38.5)
Independiente 445 (15.7) 338 (16.9) 107 (13.0)
Pensionado 431 (15.2) 281 (14.0) 150 (18.2)
Religion (%) 0.289
Católica 2214 (78.2) 1557 (77.7) 657 (79.5)
Cristiana 417 (14.7) 309 (15.4) 108 (13.1)
Judía 3 ( 0.1) 2 ( 0.1) 1 ( 0.1)
No profesa religión 120 ( 4.2) 88 ( 4.4) 32 ( 3.9)
Otra 76 ( 2.7) 48 ( 2.4) 28 ( 3.4)
Edadcat (%) <0.001
< 50 años 638 (22.5) 493 (24.6) 145 (17.6)
50 - 64 años 1044 (36.9) 735 (36.7) 309 (37.4)
>=65 1148 (40.6) 776 (38.7) 372 (45.0)