Analisis exploratorio de la base de datos

library(readxl)

BASE <- read_excel("Base de datos bariatrica revisada 14 agosto.xlsx", 
    sheet = "CIRUGIA BARIATRICA") #HOJA PRINCIPAL

BASE_BED_Q <- read_excel("Base de datos bariatrica revisada 14 agosto.xlsx", 
    sheet = "BED Q") #ESCALA BED Q

BASE_GERDQ <- read_excel("Base de datos bariatrica revisada 14 agosto.xlsx", 
    sheet = "GERDQ") # ESCALA GERD Q

#En la base general se reemplaza el valor de los datos faltantes
BASE$`Tipo de cirugía bariátrica`[is.na(BASE$`Tipo de cirugía bariátrica`)] <- "Control"

#Se ejecuta el analisis exploratorio de la base (sin número de cédula)

library(summarytools)
print(dfSummary(BASE[,-1]), method = 'render')

Data Frame Summary

BASE

Dimensions: 104 x 23
Duplicates: 0
No Variable Stats / Values Freqs (% of Valid) Graph Valid Missing
1 Manometria [character]
1. No
2. Si
2(1.9%)
102(98.1%)
104 (100.0%) 0 (0.0%)
2 Clasificación [character]
1. Chicago 3.0
2. Chicago 4.0
2(1.9%)
102(98.1%)
104 (100.0%) 0 (0.0%)
3 Edad [numeric]
Mean (sd) : 54.3 (12.2)
min ≤ med ≤ max:
27 ≤ 55 ≤ 78
IQR (CV) : 18 (0.2)
41 distinct values 104 (100.0%) 0 (0.0%)
4 Genero [character]
1. femenino
2. masculino
86(82.7%)
18(17.3%)
104 (100.0%) 0 (0.0%)
5 Indicación de la manometría/ síntoma principal [character]
1. disfagia
2. Disfagia
3. dolor toracico
4. Dolor toracico
5. otro
6. Pirosis
7. regurgitacion
8. Regurgitacion
6(11.1%)
1(1.9%)
2(3.7%)
2(3.7%)
2(3.7%)
27(50.0%)
8(14.8%)
6(11.1%)
54 (51.9%) 50 (48.1%)
6 Especificar cual otro síntoma [character]
1. disfagia
2. dolor toracico
3. Dolor toracico
4. emesis
5. Globus
6. regurgitacion
14(51.9%)
5(18.5%)
2(7.4%)
1(3.7%)
1(3.7%)
4(14.8%)
27 (26.0%) 77 (74.0%)
7 IMC (Índice de masa corporal) [numeric]
Mean (sd) : 24.4 (4.2)
min ≤ med ≤ max:
19 ≤ 23 ≤ 40
IQR (CV) : 6 (0.2)
17 distinct values 104 (100.0%) 0 (0.0%)
8 Tipo de cirugía bariátrica [character]
1. 1 bypass/ Y Roux
2. Control
3. Manga gástrica
18(17.3%)
50(48.1%)
36(34.6%)
104 (100.0%) 0 (0.0%)
9 Diagnostico en endoscopia [character]
1. Hernia hiatal
2. otro
37(35.9%)
66(64.1%)
103 (99.0%) 1 (1.0%)
10 Especificar cual otro diagnostico endoscópico [character]
1. gastritis
2. gastropatia
3. esofagitis grado B
4. normal
5. polipo
6. Esofagitis
7. Gastritis
8. grado A Esofagitis
9. grado A hernia hiatal
10. grado B Esofagitis
[ 2 others ]
57(75.0%)
4(5.3%)
3(3.9%)
3(3.9%)
2(2.6%)
1(1.3%)
1(1.3%)
1(1.3%)
1(1.3%)
1(1.3%)
2(2.6%)
76 (73.1%) 28 (26.9%)
11 Tiempo en años desde la cirugía bariátrica hasta el inicio de síntomas [numeric]
Mean (sd) : 6.5 (3.8)
min ≤ med ≤ max:
1 ≤ 5.5 ≤ 20
IQR (CV) : 3.8 (0.6)
11 distinct values 26 (25.0%) 78 (75.0%)
12 Manometría: DCI promedio [numeric]
Mean (sd) : 1712.9 (1795.7)
min ≤ med ≤ max:
0 ≤ 1301.5 ≤ 15190
IQR (CV) : 1284.2 (1)
99 distinct values 102 (98.1%) 2 (1.9%)
13 Manometría: IRP [character]
1. 2.5
2. 13.4
3. 5.8
4. 6.9
5. 7.6
6. 12.5
7. 13.8
8. 13.9
9. 14.8
10. 2.1
[ 64 others ]
4(3.9%)
3(2.9%)
3(2.9%)
3(2.9%)
3(2.9%)
2(2.0%)
2(2.0%)
2(2.0%)
2(2.0%)
2(2.0%)
76(74.5%)
102 (98.1%) 2 (1.9%)
14 Manometría: Presión intragástrica [character]
1. mayor a 30 mm Hg
2. menor a 30 mm Hg
58(56.9%)
44(43.1%)
102 (98.1%) 2 (1.9%)
15 Manometría: Presión basal del LES [character]
1. 12.1
2. 13
3. 13.5
4. 15.6
5. 18.100000000000001
6. 18.5
7. 19.600000000000001
8. 20.399999999999999
9. 20.6
10. 20.9
[ 76 others ]
2(2.0%)
2(2.0%)
2(2.0%)
2(2.0%)
2(2.0%)
2(2.0%)
2(2.0%)
2(2.0%)
2(2.0%)
2(2.0%)
82(80.4%)
102 (98.1%) 2 (1.9%)
16 Presión intrabolo [character]
1. mayor a 20 mm Hg
2. menor a 20 mm Hg
27(26.5%)
75(73.5%)
102 (98.1%) 2 (1.9%)
17 Aclaramiento del bolo [character]
1. Completo
2. Incompleto
81(83.5%)
16(16.5%)
97 (93.3%) 7 (6.7%)
18 Manometría: Presurización pan esofágica en isocontorno de 20 mm Hg [character]
1. No
2. Si
99(97.1%)
3(2.9%)
102 (98.1%) 2 (1.9%)
19 Manometría: IRP en la prueba de RDC [numeric]
Mean (sd) : 2.5 (5.5)
min ≤ med ≤ max:
0.1 ≤ 0.8 ≤ 47.8
IQR (CV) : 2.6 (2.2)
30 distinct values 99 (95.2%) 5 (4.8%)
20 Manometría: Test de reserva peristáltica [character]
1. Adecuado
2. Inadecuado
80(77.7%)
23(22.3%)
103 (99.0%) 1 (1.0%)
21 Manometría: Ausencia de inhibición deglutoria [character]
1. No
2. Si
93(90.3%)
10(9.7%)
103 (99.0%) 1 (1.0%)
22 Manometría: Diagnostico chicago 4.0 [character]
1. acalasia
2. MEI
3. normal
4. OTS
1(1.0%)
13(12.6%)
87(84.5%)
2(1.9%)
103 (99.0%) 1 (1.0%)
23 ...24 [character]
1. doble presion hernia
2. doble zona, hernia hiatal
3. en posición vertical es m
4. hernia hiatal
5. hernia hiatal 3,8 cm
6. hernia hiatal verificar I
7. LLAMAR A PACIENTE
8. no pasó la unión
9. no tolera posicion secund
10. rectificar presion intrag
1(3.8%)
1(3.8%)
1(3.8%)
15(57.7%)
1(3.8%)
1(3.8%)
1(3.8%)
3(11.5%)
1(3.8%)
1(3.8%)
26 (25.0%) 78 (75.0%)

Generated by summarytools 1.1.4 (R version 4.4.2)
2025-08-25

Cruces por tipo de cirugía

Variable sociodemograficas
level Overall 1 bypass/ Y Roux Control Manga gástrica p test
n 104 18 50 36
Manometria No 2 (1.9) 0 (0.0) 0 (0.0) 2 (5.6) 0.146
X Si 102 (98.1) 18 (100.0) 50 (100.0) 34 (94.4)
Clasificación Chicago 3.0 2 (1.9) 1 (5.6) 0 (0.0) 1 (2.8) 0.304
X 1 Chicago 4.0 102 (98.1) 17 (94.4) 50 (100.0) 35 (97.2)
Edad mean SD 54.31 (12.20) 57.39 (10.72) 57.50 (12.37) 48.33 (10.57) 0.001
Genero femenino 86 (82.7) 16 (88.9) 40 (80.0) 30 (83.3) 0.688
X 2 masculino 18 (17.3) 2 (11.1) 10 (20.0) 6 (16.7)
Indicación de la manometría síntoma principal disfagia 6 (11.1) 3 (16.7) 0 (NaN) 3 (8.3) NaN
X 3 Disfagia 1 (1.9) 1 (5.6) 0 (NaN) 0 (0.0)
X 4 dolor toracico 2 (3.7) 0 (0.0) 0 (NaN) 2 (5.6)
X 5 Dolor toracico 2 (3.7) 0 (0.0) 0 (NaN) 2 (5.6)
X 6 otro 2 (3.7) 2 (11.1) 0 (NaN) 0 (0.0)
X 7 Pirosis 27 (50.0) 9 (50.0) 0 (NaN) 18 (50.0)
X 8 regurgitacion 8 (14.8) 1 (5.6) 0 (NaN) 7 (19.4)
X 9 Regurgitacion 6 (11.1) 2 (11.1) 0 (NaN) 4 (11.1)
IMC Índice de masa corporalmean SD 24.37 (4.18) 26.33 (3.97) 21.28 (1.14) 27.67 (3.90) <0.001
Diagnostico en endoscopia Hernia hiatal 37 (35.9) 10 (58.8) 0 (0.0) 27 (75.0) <0.001
X 10 otro 66 (64.1) 7 (41.2) 50 (100.0) 9 (25.0)
Tiempo en años desde la cirugía bariátrica hasta el inicio de síntomas mean SD 6.46 (3.77) 7.60 (5.10) NaN (NA) 5.75 (2.57) 0.230
Manometría DCI promedio mean SD 1712.92 (1795.69) 1181.28 (966.50) 1705.08 (1258.23) 2005.91 (2606.58) 0.292
Manometría IRP mean SD 8.58 (6.05) 12.68 (10.50) 6.70 (4.24) 9.18 (3.68) 0.001
Manometría Presión intragástrica mayor a 30 mm Hg 58 (56.9) 1 (5.6) 49 (98.0) 8 (23.5) <0.001
X 11 menor a 30 mm Hg 44 (43.1) 17 (94.4) 1 (2.0) 26 (76.5)
Manometría Presión basal del LES mean SD 23.36 (11.73) 29.59 (16.14) 22.99 (10.30) 20.62 (10.01) 0.029
Presión intrabolo mayor a 20 mm Hg 27 (26.5) 5 (27.8) 1 (2.0) 21 (61.8) <0.001
X 12 menor a 20 mm Hg 75 (73.5) 13 (72.2) 49 (98.0) 13 (38.2)
Aclaramiento del bolo Completo 81 (83.5) 8 (53.3) 50 (100.0) 23 (71.9) <0.001
X 13 Incompleto 16 (16.5) 7 (46.7) 0 (0.0) 9 (28.1)
Manometría Presurización pan esofágica en isocontorno de 20 mm Hg No 99 (97.1) 17 (94.4) 50 (100.0) 32 (94.1) 0.226
X 14 Si 3 (2.9) 1 (5.6) 0 (0.0) 2 (5.9)
Manometría IRP en la prueba de RDC mean SD 2.53 (5.47) 6.56 (12.09) 1.66 (1.72) 1.76 (1.91) 0.003
Manometría Test de reserva peristáltica Adecuado 80 (77.7) 11 (61.1) 47 (94.0) 22 (62.9) 0.001
X 15 Inadecuado 23 (22.3) 7 (38.9) 3 (6.0) 13 (37.1)
Manometría Ausencia de inhibición deglutoria No 93 (90.3) 13 (72.2) 48 (96.0) 32 (91.4) 0.013
X 16 Si 10 (9.7) 5 (27.8) 2 (4.0) 3 (8.6)
Manometría Diagnostico chicago 4 0 acalasia 1 (1.0) 1 (5.6) 0 (0.0) 0 (0.0) <0.001
X 17 MEI 13 (12.6) 4 (22.2) 0 (0.0) 9 (25.7)
X 18 normal 87 (84.5) 11 (61.1) 50 (100.0) 26 (74.3)
X 19 OTS 2 (1.9) 2 (11.1) 0 (0.0) 0 (0.0)

Verificar en donde está la diferencia entre las variables cuantitativas

#Pruebas de normalidad
library(broom)
library(tidyr)
library(purrr)
library(dplyr)


tabla_shapiro <- BASE %>%
  group_by(`Tipo de cirugía bariátrica`) %>%
  summarise(
    shapiro = list(shapiro.test(Edad)),
    .groups = "drop"
  ) %>%
  mutate(shapiro = map(shapiro, tidy)) %>%
  unnest(shapiro)


library(gt)
tabla_shapiro %>%
  gt() %>%
  tab_header(
    title = md("**Prueba de normalidad Shapiro-Wilk EDAD por tipo de cirugía**"),
    subtitle = "Resultados agrupados"
  ) %>%
  tab_style(
    style = cell_text(align = "center", weight = "bold", color = "darkblue"),
    locations = cells_column_labels(everything())
  ) %>%
  tab_style(
    style = cell_text(align = "center"),
    locations = cells_body(columns = everything())
  ) %>%
  fmt_number(
    columns = where(is.numeric),
    decimals = 4
  ) %>%
  opt_table_outline() %>%
  opt_row_striping()
Prueba de normalidad Shapiro-Wilk EDAD por tipo de cirugía
Resultados agrupados
Tipo de cirugía bariátrica statistic p.value method
1 bypass/ Y Roux 0.9522 0.4598 Shapiro-Wilk normality test
Control 0.9541 0.0504 Shapiro-Wilk normality test
Manga gástrica 0.9779 0.6730 Shapiro-Wilk normality test

Comparación por pares

library(FSA)

# Correr la prueba de Dunn
dunn_res <- dunnTest(Edad ~ `Tipo de cirugía bariátrica`, 
                     data = BASE, 
                     method = "bonferroni")

# Extraer la tabla de resultados
tabla_dunn <- dunn_res$res

# Pasar a gt para embellecer
tabla_dunn %>%
  gt() %>%
  tab_header(
    title = "Prueba de Dunn post-hoc EDAD",
    subtitle = "Ajuste por Bonferroni"
  ) %>%
  cols_label(
    Comparison = "Comparación",
    Z          = "Estadístico Z",
    P.unadj    = "p-valor sin ajuste",
    P.adj      = "p-valor ajustado"
  ) %>%
  fmt_number(
    columns = c(Z, P.unadj, P.adj),
    decimals = 4
  ) %>%
  tab_style(
    style = list(
      cell_text(weight = "bold", align = "center")
    ),
    locations = cells_column_labels(everything())
  )
Prueba de Dunn post-hoc EDAD
Ajuste por Bonferroni
Comparación Estadístico Z p-valor sin ajuste p-valor ajustado
1 bypass/ Y Roux - Control −0.2001 0.8414 1.0000
1 bypass/ Y Roux - Manga gástrica 2.4133 0.0158 0.0474
Control - Manga gástrica 3.4388 0.0006 0.0018

La diferencia esta entre: “Control - Manga gástrica y”1 bypass/Roux - Manga gástrica”

tabla_shapiro2 <- BASE %>%
  group_by(`Tipo de cirugía bariátrica`) %>%
  summarise(
    shapiro = list(shapiro.test(`IMC (Índice de masa corporal)`)),
    .groups = "drop"
  ) %>%
  mutate(shapiro = map(shapiro, tidy)) %>%
  unnest(shapiro)


library(gt)
tabla_shapiro2 %>%
  gt() %>%
  tab_header(
    title = md("**Prueba de normalidad Shapiro-Wilk IMC por tipo de cirugía**"),
    subtitle = "Resultados agrupados"
  ) %>%
  tab_style(
    style = cell_text(align = "center", weight = "bold", color = "darkblue"),
    locations = cells_column_labels(everything())
  ) %>%
  tab_style(
    style = cell_text(align = "center"),
    locations = cells_body(columns = everything())
  ) %>%
  fmt_number(
    columns = where(is.numeric),
    decimals = 4
  ) %>%
  opt_table_outline() %>%
  opt_row_striping()
Prueba de normalidad Shapiro-Wilk IMC por tipo de cirugía
Resultados agrupados
Tipo de cirugía bariátrica statistic p.value method
1 bypass/ Y Roux 0.9422 0.3154 Shapiro-Wilk normality test
Control 0.9275 0.0044 Shapiro-Wilk normality test
Manga gástrica 0.9509 0.1120 Shapiro-Wilk normality test
dunn_res2 <- dunnTest(`IMC (Índice de masa corporal)` ~ `Tipo de cirugía bariátrica`, 
                     data = BASE, 
                     method = "bonferroni")

tabla_dunn2 <- dunn_res2$res

tabla_dunn2 %>%
  gt() %>%
  tab_header(
    title = "Prueba de Dunn post-hoc IMC",
    subtitle = "Ajuste por Bonferroni"
  ) %>%
  cols_label(
    Comparison = "Comparación",
    Z          = "Estadístico Z",
    P.unadj    = "p-valor sin ajuste",
    P.adj      = "p-valor ajustado"
  ) %>%
  fmt_number(
    columns = c(Z, P.unadj, P.adj),
    decimals = 4
  ) %>%
  tab_style(
    style = list(
      cell_text(weight = "bold", align = "center")
    ),
    locations = cells_column_labels(everything())
  )
Prueba de Dunn post-hoc IMC
Ajuste por Bonferroni
Comparación Estadístico Z p-valor sin ajuste p-valor ajustado
1 bypass/ Y Roux - Control 4.8587 0.0000 0.0000
1 bypass/ Y Roux - Manga gástrica −1.0343 0.3010 0.9030
Control - Manga gástrica −7.4759 0.0000 0.0000

Diferencias entre: 1 bypass/ Y Roux - Control & Control - Manga gástrica

tabla_shapiro3 <- BASE %>%
  group_by(`Tipo de cirugía bariátrica`) %>%
  summarise(
    shapiro = list(shapiro.test(`Manometría: IRP`)),
    .groups = "drop"
  ) %>%
  mutate(shapiro = map(shapiro, tidy)) %>%
  unnest(shapiro)

tabla_shapiro3 %>%
  gt() %>%
  tab_header(
    title = md("**Prueba de normalidad Shapiro-Wilk Manometría: IRP por tipo de cirugía**"),
    subtitle = "Resultados agrupados"
  ) %>%
  tab_style(
    style = cell_text(align = "center", weight = "bold", color = "darkblue"),
    locations = cells_column_labels(everything())
  ) %>%
  tab_style(
    style = cell_text(align = "center"),
    locations = cells_body(columns = everything())
  ) %>%
  fmt_number(
    columns = where(is.numeric),
    decimals = 4
  ) %>%
  opt_table_outline() %>%
  opt_row_striping()
Prueba de normalidad Shapiro-Wilk Manometría: IRP por tipo de cirugía
Resultados agrupados
Tipo de cirugía bariátrica statistic p.value method
1 bypass/ Y Roux 0.7717 0.0006 Shapiro-Wilk normality test
Control 0.9132 0.0014 Shapiro-Wilk normality test
Manga gástrica 0.9488 0.1129 Shapiro-Wilk normality test
dunn_res3 <- dunnTest(`Manometría: IRP` ~ `Tipo de cirugía bariátrica`, 
                     data = BASE, 
                     method = "bonferroni")

# Extraer la tabla de resultados
tabla_dunn3 <- dunn_res3$res

# Pasar a gt para embellecer
tabla_dunn3 %>%
  gt() %>%
  tab_header(
    title = "Prueba de Dunn post-hoc Manometría: IRP",
    subtitle = "Ajuste por Bonferroni"
  ) %>%
  cols_label(
    Comparison = "Comparación",
    Z          = "Estadístico Z",
    P.unadj    = "p-valor sin ajuste",
    P.adj      = "p-valor ajustado"
  ) %>%
  fmt_number(
    columns = c(Z, P.unadj, P.adj),
    decimals = 4
  ) %>%
  tab_style(
    style = list(
      cell_text(weight = "bold", align = "center")
    ),
    locations = cells_column_labels(everything())
  )
Prueba de Dunn post-hoc Manometría: IRP
Ajuste por Bonferroni
Comparación Estadístico Z p-valor sin ajuste p-valor ajustado
1 bypass/ Y Roux - Control 2.9262 0.0034 0.0103
1 bypass/ Y Roux - Manga gástrica 0.5224 0.6014 1.0000
Control - Manga gástrica −2.9335 0.0034 0.0101

Diferencias entre: 1 bypass/ Y Roux - Control & Control - Manga gástrica

tabla_shapiro4 <- BASE %>%
  group_by(`Tipo de cirugía bariátrica`) %>%
  summarise(
    shapiro = list(shapiro.test(`Manometría: Presión basal del LES`)),
    .groups = "drop"
  ) %>%
  mutate(shapiro = map(shapiro, tidy)) %>%
  unnest(shapiro)

tabla_shapiro4 %>%
  gt() %>%
  tab_header(
    title = md("**Prueba de normalidad Shapiro-Wilk Manometría: Presión basal del LES por tipo de cirugía**"),
    subtitle = "Resultados agrupados"
  ) %>%
  tab_style(
    style = cell_text(align = "center", weight = "bold", color = "darkblue"),
    locations = cells_column_labels(everything())
  ) %>%
  tab_style(
    style = cell_text(align = "center"),
    locations = cells_body(columns = everything())
  ) %>%
  fmt_number(
    columns = where(is.numeric),
    decimals = 4
  ) %>%
  opt_table_outline() %>%
  opt_row_striping()
Prueba de normalidad Shapiro-Wilk Manometría: Presión basal del LES por tipo de cirugía
Resultados agrupados
Tipo de cirugía bariátrica statistic p.value method
1 bypass/ Y Roux 0.8772 0.0234 Shapiro-Wilk normality test
Control 0.9614 0.1015 Shapiro-Wilk normality test
Manga gástrica 0.9375 0.0519 Shapiro-Wilk normality test
dunn_res4 <- dunnTest(`Manometría: Presión basal del LES` ~ `Tipo de cirugía bariátrica`, 
                     data = BASE, 
                     method = "bonferroni")

# Extraer la tabla de resultados
tabla_dunn4 <- dunn_res4$res

# Pasar a gt para embellecer
tabla_dunn4 %>%
  gt() %>%
  tab_header(
    title = "Prueba de Dunn post-hoc Manometría: Presión basal del LES",
    subtitle = "Ajuste por Bonferroni"
  ) %>%
  cols_label(
    Comparison = "Comparación",
    Z          = "Estadístico Z",
    P.unadj    = "p-valor sin ajuste",
    P.adj      = "p-valor ajustado"
  ) %>%
  fmt_number(
    columns = c(Z, P.unadj, P.adj),
    decimals = 4
  ) %>%
  tab_style(
    style = list(
      cell_text(weight = "bold", align = "center")
    ),
    locations = cells_column_labels(everything())
  )
Prueba de Dunn post-hoc Manometría: Presión basal del LES
Ajuste por Bonferroni
Comparación Estadístico Z p-valor sin ajuste p-valor ajustado
1 bypass/ Y Roux - Control 1.4230 0.1547 0.4642
1 bypass/ Y Roux - Manga gástrica 2.1428 0.0321 0.0964
Control - Manga gástrica 1.0502 0.2936 0.8809

Hubo “mayo diferencia” entre: 1 bypass/ Y Roux - Manga gástrica

tabla_shapiro5 <- BASE %>%
  group_by(`Tipo de cirugía bariátrica`) %>%
  summarise(
    shapiro = list(shapiro.test(`Manometría: IRP en la prueba de RDC`)),
    .groups = "drop"
  ) %>%
  mutate(shapiro = map(shapiro, tidy)) %>%
  unnest(shapiro)

tabla_shapiro5 %>%
  gt() %>%
  tab_header(
    title = md("**Prueba de normalidad Shapiro-Wilk `Manometría: IRP en la prueba de RDC` por tipo de cirugía**"),
    subtitle = "Resultados agrupados"
  ) %>%
  tab_style(
    style = cell_text(align = "center", weight = "bold", color = "darkblue"),
    locations = cells_column_labels(everything())
  ) %>%
  tab_style(
    style = cell_text(align = "center"),
    locations = cells_body(columns = everything())
  ) %>%
  fmt_number(
    columns = where(is.numeric),
    decimals = 4
  ) %>%
  opt_table_outline() %>%
  opt_row_striping()
Prueba de normalidad Shapiro-Wilk Manometría: IRP en la prueba de RDC por tipo de cirugía
Resultados agrupados
Tipo de cirugía bariátrica statistic p.value method
1 bypass/ Y Roux 0.5911 0.0000 Shapiro-Wilk normality test
Control 0.7838 0.0000 Shapiro-Wilk normality test
Manga gástrica 0.8205 0.0001 Shapiro-Wilk normality test
dunn_res5 <- dunnTest(`Manometría: IRP en la prueba de RDC` ~ `Tipo de cirugía bariátrica`, 
                     data = BASE, 
                     method = "bonferroni")

tabla_dunn5 <- dunn_res5$res

tabla_dunn5 %>%
  gt() %>%
  tab_header(
    title = "Prueba de Dunn post-hoc Manometría: IRP en la prueba de RDC",
    subtitle = "Ajuste por Bonferroni"
  ) %>%
  cols_label(
    Comparison = "Comparación",
    Z          = "Estadístico Z",
    P.unadj    = "p-valor sin ajuste",
    P.adj      = "p-valor ajustado"
  ) %>%
  fmt_number(
    columns = c(Z, P.unadj, P.adj),
    decimals = 4
  ) %>%
  tab_style(
    style = list(
      cell_text(weight = "bold", align = "center")
    ),
    locations = cells_column_labels(everything())
  )
Prueba de Dunn post-hoc Manometría: IRP en la prueba de RDC
Ajuste por Bonferroni
Comparación Estadístico Z p-valor sin ajuste p-valor ajustado
1 bypass/ Y Roux - Control 0.7374 0.4609 1.0000
1 bypass/ Y Roux - Manga gástrica 0.9299 0.3524 1.0000
Control - Manga gástrica 0.3183 0.7503 1.0000

No se encontraron diferencias especificas

Analisis global escalas BED-Q

#dput(names(BASE_BED_Q))
myVars2 <- c("Total", "Mayor o igual a 1")

catVars2 <-  c("Mayor o igual a 1")

tab2 <- CreateTableOne(vars = myVars2, factorVars= catVars2, data = BASE_BED_Q,strata = "Tipo de cirugía bariátrica", includeNA = F, addOverall = T, testNonNormal = T)

table2 <- as.data.frame(print(tab2, showAllLevels= TRUE, printToggle = FALSE, noSpaces = TRUE))
rownames(table2) <- gsub("\\.{3,}", "", rownames(table2))  # Quita puntos suspensivos "..."
rownames(table2) <- gsub("\\.{1,}", "_", rownames(table2))  # Quita puntos suspensivos "..."
rownames(table2) <- gsub("\\_{1,}", " ", rownames(table2))  # Quita puntos suspensivos "..."


kable(table2, format = "html", caption = "BED-Q") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"), full_width = F,position = "center") %>%
  column_spec(1, bold = T, color = "white", background = "black") %>%
  column_spec(2, border_left = T, color = "white", background = "grey")
BED-Q
level Overall 1 bypass/ Y Roux Manga gástrica p test
n 60 18 36
Total (mean (SD)) 2.53 (4.38) 2.67 (2.09) 1.69 (2.29) 0.136
Mayor o igual a 1 (%) no 24 (44.4) 5 (27.8) 19 (52.8) 0.146
Si 30 (55.6) 13 (72.2) 17 (47.2)

Analisis global escalas GERD-Q

dput(names(BASE_GERDQ))
## c("cedula", "Telefono", "¿En la última semana cuantos días ha tenido sensación de quemazón o ardor en el pecho?", 
## "¿En la última semana cuantos días ha notado que el contenido del estómago le ha subido a la garganta o la boca?", 
## "¿En la última semana cuantos días ha sentido dolor en la boca del estómago?", 
## "¿En la última semana cuantos días ha tenido nauseas o ganas de vomitar?", 
## "¿En la última semana cuantas noches ha tenido problemas para dormir bien a causa de tener ardor o por notar que el contenido del estómago le subía a la garganta o a la boca?", 
## "¿En la última semana cuantos días ha tomado alguna medicina por tener ardor o por notar que el contenido del estómago le sube a la garganta o a la boca, aparte que le receto el medico?", 
## "Total", "Sintomas >1", "Tipo de cirugia bariatrica", "Hernia hiatal"
## )
myVars3 <- c("Total", "Sintomas >1",  "Hernia hiatal")

catVars3 <-  c("Sintomas >1",  "Hernia hiatal")

tab3 <- CreateTableOne(vars = myVars3, factorVars= catVars3, data = BASE_GERDQ,strata = "Tipo de cirugia bariatrica", includeNA = F, addOverall = T, testNonNormal = T)

table3 <- as.data.frame(print(tab3, showAllLevels= TRUE, printToggle = FALSE, noSpaces = TRUE))
rownames(table3) <- gsub("\\.{3,}", "", rownames(table3))  # Quita puntos suspensivos "..."
rownames(table3) <- gsub("\\.{1,}", "_", rownames(table3))  # Quita puntos suspensivos "..."
rownames(table3) <- gsub("\\_{1,}", " ", rownames(table3))  # Quita puntos suspensivos "..."


kable(table3, format = "html", caption = "GERDQ") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"), full_width = F,position = "center") %>%
  column_spec(1, bold = T, color = "white", background = "black") %>%
  column_spec(2, border_left = T, color = "white", background = "grey")
GERDQ
level Overall 1 bypass/ Y Roux Manga gástrica p test
n 55 18 36
Total mean SD 6.31 (4.67) 6.39 (3.82) 5.94 (4.75) 0.732
Sintomas 1 No 10 (18.2) 3 (16.7) 7 (19.4) 1.000
X Si 45 (81.8) 15 (83.3) 29 (80.6)
Hernia hiatal 0 1 (1.9) 1 (5.6) 0 (0.0) 0.179
X 1 Hernia hiatal 37 (68.5) 10 (55.6) 27 (75.0)
X 2 otro 16 (29.6) 7 (38.9) 9 (25.0)