Proyecto para analizar la base de datos de tesis de Dra. Sandra Navarro
Primero, realizamos una limpieza de la base datos, así como recodificación de variables incluidas en la base de datos:
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✔ ggplot2 3.3.6 ✔ purrr 0.3.4
## ✔ tibble 3.1.7 ✔ dplyr 1.0.9
## ✔ tidyr 1.2.0 ✔ stringr 1.4.0
## ✔ readr 2.1.2 ✔ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
##
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
##
## set_names
## The following object is masked from 'package:tidyr':
##
## extract
##
## Attaching package: 'dlookr'
## The following object is masked from 'package:magrittr':
##
## extract
## The following object is masked from 'package:tidyr':
##
## extract
## The following object is masked from 'package:base':
##
## transform
## Warning: Unreplaced values treated as NA as `.x` is not compatible.
## Please specify replacements exhaustively or supply `.default`.
Se diseñarón 2 tablas
La tabla 1 incluye las variables categoricas (Cualitativas)
DBsan %>% select(EDAD, age_group,SEXO, MINIMENTALCAT, KATZCAT, DIABETES, HIPERTENSION, CARDIOPATIA,
EVC, CA, PARKINSON, HIPOTIROIDISMO, ERC, TRASTORNO_DEL_ANIMO,
TIPO,COMORBILIDADES,ESTATINAS, ANTICOL, ANTIPSICOTICO, BZD, POLIFARMACIA,
RIESGO,PAS, PAD, FRAMINGHAN,) %>%
tbl_summary(by=ESTATINAS) %>% add_p() %>% add_overall()
## Warning: The `fmt_missing()` function is deprecated and will soon be removed
## * Use the `sub_missing()` function instead
| Characteristic | Overall, N = 1381 | No, N = 701 | Si, N = 681 | p-value2 |
|---|---|---|---|---|
| EDAD | 79.0 (74.0, 82.8) | 79.5 (74.2, 82.0) | 79.0 (74.0, 83.0) | 0.8 |
| age_group | >0.9 | |||
| 65-70 | 14 (10%) | 8 (11%) | 6 (8.8%) | |
| 71-75 | 30 (22%) | 15 (21%) | 15 (22%) | |
| 76-80 | 35 (25%) | 17 (24%) | 18 (26%) | |
| 81-85 | 59 (43%) | 30 (43%) | 29 (43%) | |
| SEXO | 0.3 | |||
| Femenino | 95 (69%) | 51 (73%) | 44 (65%) | |
| Masculino | 43 (31%) | 19 (27%) | 24 (35%) | |
| MINIMENTALCAT | 0.10 | |||
| SIN DC | 0 (0%) | 0 (0%) | 0 (0%) | |
| DC LEVE | 81 (59%) | 35 (50%) | 46 (68%) | |
| DC MODERADO | 27 (20%) | 16 (23%) | 11 (16%) | |
| DC SEVERO | 30 (22%) | 19 (27%) | 11 (16%) | |
| KATZCAT | 0.060 | |||
| B-C | 84 (61%) | 36 (51%) | 48 (71%) | |
| D-E | 27 (20%) | 16 (23%) | 11 (16%) | |
| F-G | 27 (20%) | 18 (26%) | 9 (13%) | |
| DIABETES | 0.9 | |||
| No | 78 (57%) | 40 (57%) | 38 (56%) | |
| Si | 60 (43%) | 30 (43%) | 30 (44%) | |
| HIPERTENSION | <0.001 | |||
| No | 47 (34%) | 33 (47%) | 14 (21%) | |
| Si | 91 (66%) | 37 (53%) | 54 (79%) | |
| CARDIOPATIA | <0.001 | |||
| No | 112 (81%) | 65 (93%) | 47 (69%) | |
| Si | 26 (19%) | 5 (7.1%) | 21 (31%) | |
| EVC | 0.010 | |||
| No | 115 (83%) | 64 (91%) | 51 (75%) | |
| Si | 23 (17%) | 6 (8.6%) | 17 (25%) | |
| CA | >0.9 | |||
| No | 130 (94%) | 66 (94%) | 64 (94%) | |
| Si | 8 (5.8%) | 4 (5.7%) | 4 (5.9%) | |
| PARKINSON | 0.2 | |||
| No | 130 (94%) | 68 (97%) | 62 (91%) | |
| Si | 8 (5.8%) | 2 (2.9%) | 6 (8.8%) | |
| HIPOTIROIDISMO | 0.8 | |||
| No | 105 (76%) | 54 (77%) | 51 (75%) | |
| Si | 33 (24%) | 16 (23%) | 17 (25%) | |
| ERC | 0.5 | |||
| No | 129 (93%) | 64 (91%) | 65 (96%) | |
| Si | 9 (6.5%) | 6 (8.6%) | 3 (4.4%) | |
| TRASTORNO_DEL_ANIMO | 0.040 | |||
| No | 73 (53%) | 31 (44%) | 42 (62%) | |
| Si | 65 (47%) | 39 (56%) | 26 (38%) | |
| TIPO | <0.001 | |||
| 1 | 46 (33%) | 33 (47%) | 13 (19%) | |
| 2 | 30 (22%) | 8 (11%) | 22 (32%) | |
| 3 | 49 (36%) | 20 (29%) | 29 (43%) | |
| 4 | 8 (5.8%) | 5 (7.1%) | 3 (4.4%) | |
| 5 | 5 (3.6%) | 4 (5.7%) | 1 (1.5%) | |
| COMORBILIDADES | 0.012 | |||
| 1 A 3 | 58 (42%) | 38 (54%) | 20 (29%) | |
| 4 A 5 | 58 (42%) | 24 (34%) | 34 (50%) | |
| >6 | 22 (16%) | 8 (11%) | 14 (21%) | |
| ANTICOL | 0.9 | |||
| No | 68 (49%) | 34 (49%) | 34 (50%) | |
| Si | 70 (51%) | 36 (51%) | 34 (50%) | |
| ANTIPSICOTICO | 0.3 | |||
| No | 100 (72%) | 48 (69%) | 52 (76%) | |
| Si | 38 (28%) | 22 (31%) | 16 (24%) | |
| BZD | 0.008 | |||
| No | 96 (70%) | 42 (60%) | 54 (81%) | |
| Si | 41 (30%) | 28 (40%) | 13 (19%) | |
| Unknown | 1 | 0 | 1 | |
| POLIFARMACIA | 0.092 | |||
| <2 FARMACOS | 16 (12%) | 12 (17%) | 4 (5.9%) | |
| 3 A 5 FARMACOS | 59 (43%) | 30 (43%) | 29 (43%) | |
| >6 FARMACOS | 63 (46%) | 28 (40%) | 35 (51%) | |
| RIESGO | 0.7 | |||
| ALTO | 58 (42%) | 31 (44%) | 27 (40%) | |
| BAJO | 24 (17%) | 13 (19%) | 11 (16%) | |
| MODERADO | 56 (41%) | 26 (37%) | 30 (44%) | |
| PAS | 120 (110, 130) | 120 (110, 130) | 120 (110, 130) | 0.6 |
| PAD | 70 (70, 80) | 70 (70, 80) | 70 (60, 80) | >0.9 |
| FRAMINGHAN | 16 (10, 25) | 16 (10, 22) | 22 (12, 26) | 0.043 |
| 1 Median (IQR); n (%) | ||||
| 2 Wilcoxon rank sum test; Pearson's Chi-squared test; Fisher's exact test | ||||
Se diseñarón 2 tablas
La tabla 2 incluye las variables continuas (Cuantitativas) y el análisis bioestadístico usando prueba chi cuadrada o exacta de fisher
DBsan %>% select(COLESTEROL, TRIGLICERIDOS, HDL, LDL, TSH, HB1AC, GLUCOSA,
SODIO, ALBUMINA,VITAMINAB12, ESTATINAS)%>%
tbl_summary(by=ESTATINAS, # stratify entire table by outcome
statistic = list(all_continuous() ~ "{median} ({IQR})"), # stats and format for categorical columns
digits = all_continuous() ~ 1) %>% add_p() %>% add_overall
## Warning: The `fmt_missing()` function is deprecated and will soon be removed
## * Use the `sub_missing()` function instead
| Characteristic | Overall, N = 1381 | No, N = 701 | Si, N = 681 | p-value2 |
|---|---|---|---|---|
| COLESTEROL | 182.0 (52.2) | 176.0 (43.8) | 189.5 (57.2) | 0.049 |
| TRIGLICERIDOS | 125.5 (71.2) | 119.5 (60.2) | 134.0 (88.2) | 0.059 |
| HDL | 50.5 (18.6) | 51.5 (19.4) | 49.5 (17.0) | 0.6 |
| LDL | 104.5 (44.8) | 99.0 (34.5) | 109.5 (53.5) | 0.11 |
| TSH | 2.5 (2.4) | 3.0 (2.7) | 2.4 (2.0) | 0.5 |
| HB1AC | 5.9 (1.0) | 5.7 (1.0) | 6.1 (1.0) | 0.026 |
| Unknown | 1 | 0 | 1 | |
| GLUCOSA | 97.5 (28.0) | 96.5 (27.2) | 100.5 (29.8) | 0.5 |
| SODIO | 140.0 (5.0) | 140.0 (5.0) | 141.0 (4.0) | 0.8 |
| ALBUMINA | 3.7 (0.7) | 3.7 (0.7) | 3.6 (0.8) | 0.7 |
| Unknown | 10 | 4 | 6 | |
| VITAMINAB12 | 394.3 (505.5) | 373.0 (382.3) | 422.0 (556.6) | 0.8 |
| Unknown | 13 | 8 | 5 | |
| 1 Median (IQR) | ||||
| 2 Wilcoxon rank sum test | ||||
Las graficas que pueden usarse como opción a de las tablas
Antes hicimos un análisis descriptivo de estas variables continuas (Cuantitativas)
en general y despues agrupando por uso o no de estatinas
#Estadisticos descriptivos
DBsan %>% select(COLESTEROL, TRIGLICERIDOS, HDL, LDL, TSH, HB1AC, GLUCOSA,
SODIO, ALBUMINA,VITAMINAB12, PAS, PAD, FRAMINGHAN,ESTATINAS)%>%
describe()
## # A tibble: 13 × 26
## described_varia… n na mean sd se_mean IQR skewness kurtosis
## <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 COLESTEROL 138 0 186. 4.17e+1 3.55e+0 52.2 0.500 0.172
## 2 TRIGLICERIDOS 138 0 145. 9.34e+1 7.95e+0 71.2 4.06 23.3
## 3 HDL 138 0 51.4 1.51e+1 1.28e+0 18.6 0.964 1.53
## 4 LDL 138 0 105. 3.59e+1 3.06e+0 44.8 0.446 0.502
## 5 TSH 138 0 3.61 6.10e+0 5.19e-1 2.39 9.19 97.0
## 6 HB1AC 137 1 6.80 6.10e+0 5.21e-1 1 10.9 124.
## 7 GLUCOSA 138 0 112. 4.18e+1 3.56e+0 28 2.70 8.36
## 8 SODIO 138 0 140. 3.95e+0 3.37e-1 5 -0.119 0.263
## 9 ALBUMINA 128 10 3.66 5.83e-1 5.15e-2 0.725 -0.549 0.753
## 10 VITAMINAB12 125 13 809. 1.38e+3 1.23e+2 506. 4.21 18.3
## 11 PAS 138 0 122. 1.71e+1 1.46e+0 20 0.417 0.746
## 12 PAD 138 0 72.2 9.09e+0 7.73e-1 10 -0.351 0.276
## 13 FRAMINGHAN 138 0 17.8 8.10e+0 6.90e-1 14.8 0.154 -1.26
## # … with 17 more variables: p00 <dbl>, p01 <dbl>, p05 <dbl>, p10 <dbl>,
## # p20 <dbl>, p25 <dbl>, p30 <dbl>, p40 <dbl>, p50 <dbl>, p60 <dbl>,
## # p70 <dbl>, p75 <dbl>, p80 <dbl>, p90 <dbl>, p95 <dbl>, p99 <dbl>,
## # p100 <dbl>
DBsan %>%
group_by(ESTATINAS) %>% describe(COLESTEROL, TRIGLICERIDOS, HDL, LDL, TSH, HB1AC, GLUCOSA,
SODIO, ALBUMINA,VITAMINAB12, PAS, PAD, FRAMINGHAN)
## # A tibble: 26 × 27
## described_variab… ESTATINAS n na mean sd se_mean IQR skewness
## <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 ALBUMINA No 66 4 3.67 0.597 0.0734 0.7 -0.793
## 2 ALBUMINA Si 62 6 3.66 0.573 0.0727 0.850 -0.273
## 3 COLESTEROL No 70 0 179. 38.4 4.59 43.8 0.613
## 4 COLESTEROL Si 68 0 193. 44.0 5.34 57.2 0.344
## 5 FRAMINGHAN No 70 0 16.6 7.89 0.943 11.5 0.412
## 6 FRAMINGHAN Si 68 0 19.1 8.16 0.990 14.0 -0.105
## 7 GLUCOSA No 70 0 112. 44.1 5.27 27.2 2.59
## 8 GLUCOSA Si 68 0 112. 39.7 4.81 29.8 2.90
## 9 HB1AC No 70 0 6.21 1.49 0.178 1.05 3.23
## 10 HB1AC Si 67 1 7.40 8.58 1.05 1 7.98
## # … with 16 more rows, and 18 more variables: kurtosis <dbl>, p00 <dbl>,
## # p01 <dbl>, p05 <dbl>, p10 <dbl>, p20 <dbl>, p25 <dbl>, p30 <dbl>,
## # p40 <dbl>, p50 <dbl>, p60 <dbl>, p70 <dbl>, p75 <dbl>, p80 <dbl>,
## # p90 <dbl>, p95 <dbl>, p99 <dbl>, p100 <dbl>
Determinamos la normalidad en cada una de las variables con la prueba de Shapiro wilks
DBsan %>%
group_by(ESTATINAS) %>%
normality(COLESTEROL, TRIGLICERIDOS, HDL, LDL, TSH, HB1AC, GLUCOSA,
SODIO, ALBUMINA,VITAMINAB12, PAS, PAD, FRAMINGHAN)
## # A tibble: 26 × 5
## variable ESTATINAS statistic p_value sample
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 COLESTEROL No 0.965 5.01e- 2 70
## 2 COLESTEROL Si 0.988 7.78e- 1 68
## 3 TRIGLICERIDOS No 0.832 1.93e- 7 70
## 4 TRIGLICERIDOS Si 0.638 1.15e-11 68
## 5 HDL No 0.906 6.81e- 5 70
## 6 HDL Si 0.962 3.45e- 2 68
## 7 LDL No 0.934 1.15e- 3 70
## 8 LDL Si 0.993 9.66e- 1 68
## 9 TSH No 0.288 1.02e-16 70
## 10 TSH Si 0.718 4.05e-10 68
## # … with 16 more rows
Las variables tuvierón una distribución no normal (p>0.05), por ello usaremos estadística no parametrica para el análisis estadístico
Se desarrollarón gráficas de boxplot para las variables continuas y sus respectivas significancia estadísticas usando la prueba wilcoxon
Te presento las opciones como te lo prefieras, en esta primer opción es todas las variables cualitativas comprando entre usuarios de estatinas y su respectivo valor p
## # A tibble: 1,632 × 3
## ESTATINAS variables level
## <chr> <chr> <dbl>
## 1 Si COLESTEROL 208
## 2 Si COLESTEROL 192
## 3 Si COLESTEROL 258
## 4 No COLESTEROL 174
## 5 Si COLESTEROL 231
## 6 Si COLESTEROL 126
## 7 No COLESTEROL 194
## 8 No COLESTEROL 158
## 9 Si COLESTEROL 197
## 10 No COLESTEROL 188
## # … with 1,622 more rows
Posteriormente, dividi estas graficas en grupos: Lipidos, quimica sanguínea y otros laboratorios
Te muestro lípidos:
#COLESTEROL
col<-DBsan %>% select(ESTATINAS,COLESTEROL)
col
## # A tibble: 138 × 2
## ESTATINAS COLESTEROL
## <chr> <dbl>
## 1 Si 208
## 2 Si 192
## 3 Si 258
## 4 No 174
## 5 Si 231
## 6 Si 126
## 7 No 194
## 8 No 158
## 9 Si 197
## 10 No 188
## # … with 128 more rows
colfig<-ggboxplot(col, x = "ESTATINAS", y = "COLESTEROL",width = 0.7, ylab="Colesterol (mg/dL)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 10) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
colfig
#TRIGLICERIDOS
trig<-DBsan %>% select(ESTATINAS,TRIGLICERIDOS)
trigfig<-ggboxplot(trig, x = "ESTATINAS", y = "TRIGLICERIDOS",width = 0.7, ylab="Trigliceridos (mg/dL)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 6) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
trigfig
#HDL
HDL<-DBsan %>% select(ESTATINAS,HDL)
HDL
## # A tibble: 138 × 2
## ESTATINAS HDL
## <chr> <dbl>
## 1 Si 29
## 2 Si 34
## 3 Si 58
## 4 No 57
## 5 Si 46
## 6 Si 32
## 7 No 84
## 8 No 65.3
## 9 Si 45
## 10 No 48.9
## # … with 128 more rows
HDLfig<-ggboxplot(HDL, x = "ESTATINAS", y = "HDL",width = 0.7, ylab="HDL (mg/dL)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 6) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
HDLfig
#LDL
LDL<-DBsan %>% select(ESTATINAS,LDL)
LDL
## # A tibble: 138 × 2
## ESTATINAS LDL
## <chr> <dbl>
## 1 Si 78
## 2 Si 111
## 3 Si 164
## 4 No 88
## 5 Si 166
## 6 Si 31.6
## 7 No 86
## 8 No 76
## 9 Si 116
## 10 No 114
## # … with 128 more rows
LDLfig<-ggboxplot(LDL, x = "ESTATINAS", y = "LDL",width = 0.7, ylab="LDL (mg/dL)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 6) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
LDLfig
library(cowplot)
##
## Attaching package: 'cowplot'
## The following object is masked from 'package:ggpubr':
##
## get_legend
library(dplyr)
library(gridExtra)
##
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
##
## combine
#FIGURA DE LIPIDOS
FIGLIPID<-plot_grid(colfig, trigfig, LDLfig,HDLfig, labels=c("A", "B","C","D"), ncol = 2, nrow = 2)
FIGLIPID
valores de química sanguínea
#FIGURA DE QS
#ALBUMINA
alb<-DBsan %>% select(ESTATINAS,ALBUMINA)
alb
## # A tibble: 138 × 2
## ESTATINAS ALBUMINA
## <chr> <dbl>
## 1 Si 3.5
## 2 Si NA
## 3 Si 3.8
## 4 No 3.4
## 5 Si 4.4
## 6 Si 3.1
## 7 No 3.6
## 8 No 4.4
## 9 Si 4.2
## 10 No 4.8
## # … with 128 more rows
albfig<-ggboxplot(alb, x = "ESTATINAS", y = "ALBUMINA",width = 0.7, ylab="Albumina (g/dL)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 6) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
albfig
## Warning: Removed 10 rows containing non-finite values (stat_boxplot).
## Warning: Removed 10 rows containing non-finite values (stat_signif).
#glucosa
glu<-DBsan %>% select(ESTATINAS,GLUCOSA)
glu
## # A tibble: 138 × 2
## ESTATINAS GLUCOSA
## <chr> <dbl>
## 1 Si 87
## 2 Si 125
## 3 Si 95
## 4 No 129
## 5 Si 94
## 6 Si 113
## 7 No 129
## 8 No 84
## 9 Si 92
## 10 No 95
## # … with 128 more rows
glufig<-ggboxplot(glu, x = "ESTATINAS", y = "GLUCOSA",width = 0.7, ylab="Glucosa (mg/dL)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 6) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
glufig
#HB1AC
#FIGURA DE QS
hb1<-DBsan %>% select(ESTATINAS,HB1AC)
hb1
## # A tibble: 138 × 2
## ESTATINAS HB1AC
## <chr> <dbl>
## 1 Si 5.3
## 2 Si 6.4
## 3 Si 5.8
## 4 No 6.5
## 5 Si 6.1
## 6 Si 6.8
## 7 No 7.2
## 8 No 6.5
## 9 Si 6.3
## 10 No 5.5
## # … with 128 more rows
hb1fig<-ggboxplot(hb1, x = "ESTATINAS", y = "HB1AC",width = 0.7, ylab="HB1AC (%)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 6) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
hb1fig
## Warning: Removed 1 rows containing non-finite values (stat_boxplot).
## Warning: Removed 1 rows containing non-finite values (stat_signif).
#SODIO
#FIGURA DE QS
Na<-DBsan %>% select(ESTATINAS, SODIO)
Na
## # A tibble: 138 × 2
## ESTATINAS SODIO
## <chr> <dbl>
## 1 Si 142
## 2 Si 140
## 3 Si 141
## 4 No 142
## 5 Si 144
## 6 Si 139
## 7 No 141
## 8 No 143
## 9 Si 132
## 10 No 144
## # … with 128 more rows
Nafig<-ggboxplot(Na, x = "ESTATINAS", y = "SODIO",width = 0.7, ylab="Sodio (mEq/L)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 6) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
Nafig
#TSH
TSH<-DBsan %>% select(ESTATINAS, TSH)
TSH
## # A tibble: 138 × 2
## ESTATINAS TSH
## <chr> <dbl>
## 1 Si 8.22
## 2 Si 4.25
## 3 Si 1.85
## 4 No 3.33
## 5 Si 1.22
## 6 Si 1.18
## 7 No 1.74
## 8 No 10.5
## 9 Si 3.4
## 10 No 2.07
## # … with 128 more rows
TSHfig<-ggboxplot(TSH, x = "ESTATINAS", y = "TSH",width = 0.7, ylab="TSH (nmol/L)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 6) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
TSHfig
#vitamina B12
VB12<-DBsan %>% select(ESTATINAS, VITAMINAB12)
VB12
## # A tibble: 138 × 2
## ESTATINAS VITAMINAB12
## <chr> <dbl>
## 1 Si 971.
## 2 Si NA
## 3 Si 485.
## 4 No 776.
## 5 Si 764
## 6 Si 182.
## 7 No 240.
## 8 No 261
## 9 Si 993
## 10 No 5765.
## # … with 128 more rows
VB12fig<-ggboxplot(VB12, x = "ESTATINAS", y = "VITAMINAB12",width = 0.7, ylab="VITAMINA B12 (pg/mL)",
fill = "ESTATINAS",palette = "jco") +
stat_compare_means(comparisons=list(c("Si","No")),label = "p.signif",label.y.npc = 0.4, size= 6) +theme(legend.position='none')+
scale_y_continuous(expand = expansion(mult = c(0, 0.1)))
VB12fig
## Warning: Removed 13 rows containing non-finite values (stat_boxplot).
## Warning: Removed 13 rows containing non-finite values (stat_signif).
FIGQS <- plot_grid(albfig,glufig,hb1fig,Nafig,TSHfig,VB12fig,labels=c("A", "B","C","D", "E", "F"), ncol = 2, nrow = 3)
## Warning: Removed 10 rows containing non-finite values (stat_boxplot).
## Warning: Removed 10 rows containing non-finite values (stat_signif).
## Warning: Removed 1 rows containing non-finite values (stat_boxplot).
## Warning: Removed 1 rows containing non-finite values (stat_signif).
## Warning: Removed 13 rows containing non-finite values (stat_boxplot).
## Warning: Removed 13 rows containing non-finite values (stat_signif).
FIGQS