Burnout_2

library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.3.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.2     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.2     ✔ tibble    3.2.1
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.1     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(gt)
library(gtsummary)

Tablas del manuscrito

Demographics

load(file="data_clean.RData")
base<-base %>%filter(origin=="Fleni")
base %>% select(age, gender, work_type, work_md,burnout_diagnosis) %>%
  tbl_summary(by=burnout_diagnosis, statistic = list(all_continuous() ~ "{mean} ({sd})")) %>% 
  add_overall %>%
  add_p() %>%
  add_q() 
3 observations missing `burnout_diagnosis` have been removed. To include these observations, use `forcats::fct_na_value_to_level()` on `burnout_diagnosis` column before passing to `tbl_summary()`.
add_q: Adjusting p-values with
`stats::p.adjust(x$table_body$p.value, method = "fdr")`
Characteristic Overall, N = 6121 Burnout, N = 1131 Normal, N = 891 at Risk, N = 4101 p-value2 q-value3
age 42 (12) 39 (10) 49 (13) 42 (11) 0.002 0.004
    Unknown 346 59 62 225
gender 0.3 0.3
    Male 188 (31%) 33 (29%) 34 (38%) 121 (30%)
    Female 422 (69%) 79 (70%) 55 (62%) 288 (70%)
    Other 2 (0.3%) 1 (0.9%) 0 (0%) 1 (0.2%)
work_type 0.052 0.069
    Public-facing customer service (receptionists and secretaries) 78 (13%) 15 (13%) 12 (13%) 51 (12%)
    Direct patient care (physician, nurse, physiotherapist, therapist, etc.) 368 (60%) 71 (63%) 63 (71%) 234 (57%)
    Indirect patient care (biochemist, imaging studies report, etc.) 71 (12%) 16 (14%) 4 (4.5%) 51 (12%)
     Administrative tasks related to healthcare without public-facing duties (commercial administrative sector) 95 (16%) 11 (9.7%) 10 (11%) 74 (18%)
work_md 189 (31%) 57 (50%) 22 (25%) 110 (27%) <0.001 <0.001
1 Mean (SD); n (%)
2 Kruskal-Wallis rank sum test; Fisher’s exact test; Pearson’s Chi-squared test
3 False discovery rate correction for multiple testing
base %>% select( work_type, burnout_diagnosis) %>%
  tbl_summary(by=work_type, statistic = list(all_continuous() ~ "{mean} ({sd})")) %>% 
  add_overall %>%
  add_p() %>%
  add_q() 
add_q: Adjusting p-values with
`stats::p.adjust(x$table_body$p.value, method = "fdr")`
Characteristic Overall, N = 6151 Public-facing customer service (receptionists and secretaries), N = 781 Direct patient care (physician, nurse, physiotherapist, therapist, etc.), N = 3691 Indirect patient care (biochemist, imaging studies report, etc.), N = 711 ** Administrative tasks related to healthcare without public-facing duties (commercial administrative sector)**, N = 971 p-value2 q-value3
burnout_diagnosis 0.052 0.052
    at Risk 410 (67%) 51 (65%) 234 (64%) 51 (72%) 74 (78%)
    Burnout 113 (18%) 15 (19%) 71 (19%) 16 (23%) 11 (12%)
    Normal 89 (15%) 12 (15%) 63 (17%) 4 (5.6%) 10 (11%)
    Unknown 3 0 1 0 2
1 n (%)
2 Pearson’s Chi-squared test
3 False discovery rate correction for multiple testing
base %>% select( work_md, burnout_diagnosis) %>%
  tbl_summary(by=work_md, statistic = list(all_continuous() ~ "{mean} ({sd})")) %>% 
  add_overall %>%
  add_p() %>%
  add_q() 
add_q: Adjusting p-values with
`stats::p.adjust(x$table_body$p.value, method = "fdr")`
Characteristic Overall, N = 6151 No, N = 4261 Yes, N = 1891 p-value2 q-value3
burnout_diagnosis <0.001 <0.001
    at Risk 410 (67%) 300 (71%) 110 (58%)
    Burnout 113 (18%) 56 (13%) 57 (30%)
    Normal 89 (15%) 67 (16%) 22 (12%)
    Unknown 3 3 0
1 n (%)
2 Pearson’s Chi-squared test
3 False discovery rate correction for multiple testing
base %>% select(age, gender, family_income_recode, personal_income_recode,only_provider, laboral, work_type, work_md) %>%
  tbl_summary(by=work_type) %>% 
  add_overall %>%
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 1** Demographics features for center (N = {N})")
Table 1 Demographics features for center (N = 615)
Characteristic Overall, N = 6151 Public-facing customer service (receptionists and secretaries), N = 781 Direct patient care (physician, nurse, physiotherapist, therapist, etc.), N = 3691 Indirect patient care (biochemist, imaging studies report, etc.), N = 711 ** Administrative tasks related to healthcare without public-facing duties (commercial administrative sector)**, N = 971 p-value2 q-value3
age 40 (33, 51) 37 (31, 46) 42 (34, 52) 41 (33, 50) 40 (32, 46) 0.032 0.047
    Unknown 348 40 220 32 56
gender 0.005 0.012
    Male 190 (31%) 14 (18%) 107 (29%) 31 (44%) 38 (39%)
    Female 423 (69%) 64 (82%) 260 (70%) 40 (56%) 59 (61%)
    Other 2 (0.3%) 0 (0%) 2 (0.5%) 0 (0%) 0 (0%)
family_income_recode 0.9 0.9
    Less than 250.000 5 (0.8%) 1 (1.3%) 3 (0.8%) 0 (0%) 1 (1.0%)
    More than 250.000 610 (99%) 77 (99%) 366 (99%) 71 (100%) 96 (99%)
personal_income_recode 0.061 0.073
    Less than 250.000 9 (1.5%) 3 (3.8%) 3 (0.8%) 0 (0%) 3 (3.1%)
    More than 250.000 606 (99%) 75 (96%) 366 (99%) 71 (100%) 94 (97%)
only_provider 396 (64%) 37 (47%) 251 (68%) 48 (68%) 60 (62%) 0.006 0.012
laboral
    Private practice 519 (85%) 67 (86%) 303 (82%) 57 (81%) 92 (95%)
    Public 15 (2.4%) 6 (7.7%) 6 (1.6%) 2 (2.9%) 1 (1.0%)
    Both mostly public 18 (2.9%) 3 (3.8%) 12 (3.3%) 3 (4.3%) 0 (0%)
    Both mostly private 62 (10%) 2 (2.6%) 48 (13%) 8 (11%) 4 (4.1%)
    Unknown 1 0 0 1 0
work_md 189 (31%) 0 (0%) 162 (44%) 24 (34%) 3 (3.1%) <0.001 <0.001
1 Median (IQR); n (%)
2 Kruskal-Wallis rank sum test; Fisher’s exact test; Pearson’s Chi-squared test
3 False discovery rate correction for multiple testing
base %>% select(age, gender, family_income_recode, personal_income_recode,only_provider, laboral, work_type, work_md) %>%
  tbl_summary(by=work_md) %>% 
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 2** Demographics MD vs non-MD (N = {N})")
Table 2 Demographics MD vs non-MD (N = 615)
Characteristic No, N = 4261 Yes, N = 1891 p-value2 q-value3
age 41 (33, 51) 39 (34, 50) >0.9 >0.9
    Unknown 244 104
gender 0.002 0.005
    Male 115 (27%) 75 (40%)
    Female 310 (73%) 113 (60%)
    Other 1 (0.2%) 1 (0.5%)
family_income_recode 0.3 0.4
    Less than 250.000 5 (1.2%) 0 (0%)
    More than 250.000 421 (99%) 189 (100%)
personal_income_recode 0.3 0.4
    Less than 250.000 8 (1.9%) 1 (0.5%)
    More than 250.000 418 (98%) 188 (99%)
only_provider 248 (58%) 148 (78%) <0.001 <0.001
laboral 0.010 0.018
    Private practice 367 (86%) 152 (81%)
    Public 14 (3.3%) 1 (0.5%)
    Both mostly public 10 (2.3%) 8 (4.3%)
    Both mostly private 35 (8.2%) 27 (14%)
    Unknown 0 1
work_type <0.001 <0.001
    Public-facing customer service (receptionists and secretaries) 78 (18%) 0 (0%)
    Direct patient care (physician, nurse, physiotherapist, therapist, etc.) 207 (49%) 162 (86%)
    Indirect patient care (biochemist, imaging studies report, etc.) 47 (11%) 24 (13%)
     Administrative tasks related to healthcare without public-facing duties (commercial administrative sector) 94 (22%) 3 (1.6%)
1 Median (IQR); n (%)
2 Wilcoxon rank sum test; Fisher’s exact test; Pearson’s Chi-squared test
3 False discovery rate correction for multiple testing
base %>% select(burnout_diagnosis,work_md) %>%
  tbl_summary(by=work_md, missing = "no") %>% 
  add_p() %>%
  modify_caption("**Table 3** Comparison by burnout diagnosisin MD vs non-MD (N = {N})")
Table 3 Comparison by burnout diagnosisin MD vs non-MD (N = 615)
Characteristic No, N = 4261 Yes, N = 1891 p-value2
burnout_diagnosis <0.001
    at Risk 300 (71%) 110 (58%)
    Burnout 56 (13%) 57 (30%)
    Normal 67 (16%) 22 (12%)
1 n (%)
2 Pearson’s Chi-squared test
base %>% select(age, gender, family_income_recode, personal_income_recode,only_provider, laboral, work_type, work_md, burnout_diagnosis) %>%
  tbl_summary(by=burnout_diagnosis, missing="no") %>% 
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 4** Comparison by burnout diagnosis (N = {N})")
Table 4 Comparison by burnout diagnosis (N = 612)
Characteristic Burnout, N = 1131 Normal, N = 891 at Risk, N = 4101 p-value2 q-value3
age 37 (32, 46) 49 (40, 61) 41 (34, 51) 0.002 0.009
gender 0.3 0.5
    Male 33 (29%) 34 (38%) 121 (30%)
    Female 79 (70%) 55 (62%) 288 (70%)
    Other 1 (0.9%) 0 (0%) 1 (0.2%)
family_income_recode >0.9 >0.9
    Less than 250.000 1 (0.9%) 0 (0%) 4 (1.0%)
    More than 250.000 112 (99%) 89 (100%) 406 (99%)
personal_income_recode 0.8 >0.9
    Less than 250.000 1 (0.9%) 2 (2.2%) 6 (1.5%)
    More than 250.000 112 (99%) 87 (98%) 404 (99%)
only_provider 77 (68%) 63 (71%) 254 (62%) 0.2 0.4
laboral 0.8 >0.9
    Private practice 95 (84%) 72 (81%) 349 (85%)
    Public 2 (1.8%) 4 (4.5%) 9 (2.2%)
    Both mostly public 4 (3.5%) 2 (2.2%) 12 (2.9%)
    Both mostly private 12 (11%) 11 (12%) 39 (9.5%)
work_type 0.052 0.14
    Public-facing customer service (receptionists and secretaries) 15 (13%) 12 (13%) 51 (12%)
    Direct patient care (physician, nurse, physiotherapist, therapist, etc.) 71 (63%) 63 (71%) 234 (57%)
    Indirect patient care (biochemist, imaging studies report, etc.) 16 (14%) 4 (4.5%) 51 (12%)
     Administrative tasks related to healthcare without public-facing duties (commercial administrative sector) 11 (9.7%) 10 (11%) 74 (18%)
work_md 57 (50%) 22 (25%) 110 (27%) <0.001 <0.001
1 Median (IQR); n (%)
2 Kruskal-Wallis rank sum test; Fisher’s exact test; Pearson’s Chi-squared test
3 False discovery rate correction for multiple testing
base %>% select( work_type, work_md, burnout_diagnosis) %>%
  tbl_summary(by=work_type) %>% 
  add_overall()%>%
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 4** Comparison by burnout diagnosis (N = {N})")
add_q: Adjusting p-values with
`stats::p.adjust(x$table_body$p.value, method = "fdr")`
Table 4 Comparison by burnout diagnosis (N = 615)
Characteristic Overall, N = 6151 Public-facing customer service (receptionists and secretaries), N = 781 Direct patient care (physician, nurse, physiotherapist, therapist, etc.), N = 3691 Indirect patient care (biochemist, imaging studies report, etc.), N = 711 ** Administrative tasks related to healthcare without public-facing duties (commercial administrative sector)**, N = 971 p-value2 q-value3
work_md 189 (31%) 0 (0%) 162 (44%) 24 (34%) 3 (3.1%) <0.001 <0.001
burnout_diagnosis 0.052 0.052
    at Risk 410 (67%) 51 (65%) 234 (64%) 51 (72%) 74 (78%)
    Burnout 113 (18%) 15 (19%) 71 (19%) 16 (23%) 11 (12%)
    Normal 89 (15%) 12 (15%) 63 (17%) 4 (5.6%) 10 (11%)
    Unknown 3 0 1 0 2
1 n (%)
2 Pearson’s Chi-squared test
3 False discovery rate correction for multiple testing
tabla_md<-base %>% 
  filter(work_md=="Yes") %>%
  select(age, gender, family_income_recode, personal_income_recode,only_provider,
         laboral, work_type, burnout_diagnosis) %>%
  tbl_summary(by=burnout_diagnosis, missing="no") %>% 
  add_p() %>%
  add_q()
  
tabla_nomd<-base %>% 
  filter(work_md=="No") %>%
  select(age, gender, family_income_recode, personal_income_recode,only_provider,
         laboral, work_type, burnout_diagnosis) %>%
  tbl_summary(by=burnout_diagnosis, missing="no") %>% 
  add_p() %>%
  add_q()  
# Fusionar las dos tablas en paralelo
merged_table <- tbl_merge(list(tabla_md, tabla_nomd), tab_spanner = c("**MD**", "**noMD**"))

# Ver la tabla fusionada
merged_table
Characteristic MD noMD
Burnout, N = 571 Normal, N = 221 at Risk, N = 1101 p-value2 q-value3 Burnout, N = 561 Normal, N = 671 at Risk, N = 3001 p-value4 q-value3
age 39 (32, 47) 56 (49, 62) 37 (34, 46) 0.007 0.044 36 (32, 42) 46 (34, 57) 42 (34, 51) 0.034 0.2
gender 0.2 0.4 0.6 0.7
    Male 19 (33%) 12 (55%) 44 (40%) 14 (25%) 22 (33%) 77 (26%)
    Female 37 (65%) 10 (45%) 66 (60%) 42 (75%) 45 (67%) 222 (74%)
    Other 1 (1.8%) 0 (0%) 0 (0%) 0 (0%) 0 (0%) 1 (0.3%)
family_income_recode 0.6 0.7
    More than 250.000 57 (100%) 22 (100%) 110 (100%) 55 (98%) 67 (100%) 296 (99%)
    Less than 250.000 1 (1.8%) 0 (0%) 4 (1.3%)
personal_income_recode >0.9 >0.9 0.7 0.7
    Less than 250.000 0 (0%) 0 (0%) 1 (0.9%) 1 (1.8%) 2 (3.0%) 5 (1.7%)
    More than 250.000 57 (100%) 22 (100%) 109 (99%) 55 (98%) 65 (97%) 295 (98%)
only_provider 45 (79%) 19 (86%) 84 (76%) 0.6 >0.9 32 (57%) 44 (66%) 170 (57%) 0.4 0.7
laboral 0.9 >0.9 0.6 0.7
    Private practice 46 (81%) 18 (82%) 88 (81%) 49 (88%) 54 (81%) 261 (87%)
    Public 1 (1.8%) 0 (0%) 0 (0%) 1 (1.8%) 4 (6.0%) 9 (3.0%)
    Both mostly public 2 (3.5%) 1 (4.5%) 5 (4.6%) 2 (3.6%) 1 (1.5%) 7 (2.3%)
    Both mostly private 8 (14%) 3 (14%) 16 (15%) 4 (7.1%) 8 (12%) 23 (7.7%)
work_type 0.2 0.4 0.2 0.5
    Public-facing customer service (receptionists and secretaries) 0 (0%) 0 (0%) 0 (0%) 15 (27%) 12 (18%) 51 (17%)
    Direct patient care (physician, nurse, physiotherapist, therapist, etc.) 48 (84%) 22 (100%) 92 (84%) 23 (41%) 41 (61%) 142 (47%)
    Indirect patient care (biochemist, imaging studies report, etc.) 9 (16%) 0 (0%) 15 (14%) 7 (13%) 4 (6.0%) 36 (12%)
     Administrative tasks related to healthcare without public-facing duties (commercial administrative sector) 0 (0%) 0 (0%) 3 (2.7%) 11 (20%) 10 (15%) 71 (24%)
1 Median (IQR); n (%)
2 Kruskal-Wallis rank sum test; Fisher’s exact test
3 False discovery rate correction for multiple testing
4 Kruskal-Wallis rank sum test; Fisher’s exact test; Pearson’s Chi-squared test
base %>% 
  filter(work_md=="Yes") %>%
  select(age, 
         gender, years_of_graduation,
         work_type,
         family_income, 
         personal_income,only_provider, 
         laboral,   
         laboral_dichot, work_hours,
         work_number,
         work_teaching,
         work_emergency,
         work_uti) %>%
  tbl_summary(by=laboral_dichot) %>% 
  add_overall()%>%
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 5** Demographics of MD (N = {N})")
Table 5 Demographics of MD (N = 188)
Characteristic Overall, N = 1881 Private, N = 1791 Public, N = 91 p-value2 q-value3
age 39 (34, 50) 40 (33, 51) 37 (37, 42) >0.9 >0.9
    Unknown 103 97 6
gender 0.2 0.7
    Male 75 (40%) 69 (39%) 6 (67%)
    Female 112 (60%) 109 (61%) 3 (33%)
    Other 1 (0.5%) 1 (0.6%) 0 (0%)
years_of_graduation 13 (7, 23) 13 (7, 23) 12 (6, 31) >0.9 >0.9
work_type 0.7 >0.9
    Public-facing customer service (receptionists and secretaries) 0 (0%) 0 (0%) 0 (0%)
    Direct patient care (physician, nurse, physiotherapist, therapist, etc.) 162 (86%) 153 (85%) 9 (100%)
    Indirect patient care (biochemist, imaging studies report, etc.) 23 (12%) 23 (13%) 0 (0%)
     Administrative tasks related to healthcare without public-facing duties (commercial administrative sector) 3 (1.6%) 3 (1.7%) 0 (0%)
family_income >0.9 >0.9
    Less than $100.000 0 (0%) 0 (0%) 0 (0%)
    $100.001 to $ 250.000 6 (3.2%) 6 (3.4%) 0 (0%)
    $250.001 to 400.000 45 (24%) 43 (24%) 2 (22%)
    More than $400.000 137 (73%) 130 (73%) 7 (78%)
personal_income >0.9 >0.9
    Less than $100.000 1 (0.5%) 1 (0.6%) 0 (0%)
    $100.001 to $ 250.000 14 (7.4%) 14 (7.8%) 0 (0%)
    $250.001 to 400.000 67 (36%) 64 (36%) 3 (33%)
    More than $400.000 106 (56%) 100 (56%) 6 (67%)
only_provider 147 (78%) 139 (78%) 8 (89%) 0.7 >0.9
laboral <0.001 <0.001
    Private practice 152 (81%) 152 (85%) 0 (0%)
    Public 1 (0.5%) 0 (0%) 1 (11%)
    Both mostly public 8 (4.3%) 0 (0%) 8 (89%)
    Both mostly private 27 (14%) 27 (15%) 0 (0%)
work_hours 48 (40, 60) 47 (40, 59) 50 (40, 60) >0.9 >0.9
work_number 0.2 0.7
    0 2 (1.1%) 2 (1.1%) 0 (0%)
    1 51 (27%) 51 (28%) 0 (0%)
    2 52 (28%) 50 (28%) 2 (22%)
    3 60 (32%) 55 (31%) 5 (56%)
    4 15 (8.0%) 13 (7.3%) 2 (22%)
    5 6 (3.2%) 6 (3.4%) 0 (0%)
    6 2 (1.1%) 2 (1.1%) 0 (0%)
work_teaching 71 (38%) 65 (36%) 6 (67%) 0.084 0.5
work_emergency 59 (31%) 57 (32%) 2 (22%) 0.7 >0.9
work_uti 22 (12%) 21 (12%) 1 (11%) >0.9 >0.9
1 Median (IQR); n (%)
2 Wilcoxon rank sum test; Fisher’s exact test
3 False discovery rate correction for multiple testing
base %>% 
  filter(work_md=="Yes") %>%
  select(age, 
         gender, years_of_graduation,
         work_type,
         family_income, 
         personal_income,only_provider, 
         laboral,   
         laboral_dichot, work_hours,
         work_number,
         work_teaching,
         work_emergency,
         work_uti, burnout_diagnosis) %>%
  tbl_summary(by=burnout_diagnosis) %>% 
  add_overall()%>%
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 3** Demographics of MD (N = {N})")
Table 3 Demographics of MD (N = 189)
Characteristic Overall, N = 1891 Burnout, N = 571 Normal, N = 221 at Risk, N = 1101 p-value2 q-value3
age 39 (34, 50) 39 (32, 47) 56 (49, 62) 37 (34, 46) 0.007 0.048
    Unknown 104 31 13 60
gender 0.2 0.4
    Male 75 (40%) 19 (33%) 12 (55%) 44 (40%)
    Female 113 (60%) 37 (65%) 10 (45%) 66 (60%)
    Other 1 (0.5%) 1 (1.8%) 0 (0%) 0 (0%)
years_of_graduation 13 (7, 24) 8 (5, 15) 32 (22, 38) 13 (8, 22) <0.001 <0.001
work_type 0.2 0.4
    Public-facing customer service (receptionists and secretaries) 0 (0%) 0 (0%) 0 (0%) 0 (0%)
    Direct patient care (physician, nurse, physiotherapist, therapist, etc.) 162 (86%) 48 (84%) 22 (100%) 92 (84%)
    Indirect patient care (biochemist, imaging studies report, etc.) 24 (13%) 9 (16%) 0 (0%) 15 (14%)
     Administrative tasks related to healthcare without public-facing duties (commercial administrative sector) 3 (1.6%) 0 (0%) 0 (0%) 3 (2.7%)
family_income 0.036 0.2
    Less than $100.000 0 (0%) 0 (0%) 0 (0%) 0 (0%)
    $100.001 to $ 250.000 6 (3.2%) 4 (7.0%) 0 (0%) 2 (1.8%)
    $250.001 to 400.000 46 (24%) 15 (26%) 1 (4.5%) 30 (27%)
    More than $400.000 137 (72%) 38 (67%) 21 (95%) 78 (71%)
personal_income 0.075 0.2
    Less than $100.000 1 (0.5%) 0 (0%) 0 (0%) 1 (0.9%)
    $100.001 to $ 250.000 14 (7.4%) 7 (12%) 1 (4.5%) 6 (5.5%)
    $250.001 to 400.000 68 (36%) 20 (35%) 3 (14%) 45 (41%)
    More than $400.000 106 (56%) 30 (53%) 18 (82%) 58 (53%)
only_provider 148 (78%) 45 (79%) 19 (86%) 84 (76%) 0.6 0.8
laboral 0.9 >0.9
    Private practice 152 (81%) 46 (81%) 18 (82%) 88 (81%)
    Public 1 (0.5%) 1 (1.8%) 0 (0%) 0 (0%)
    Both mostly public 8 (4.3%) 2 (3.5%) 1 (4.5%) 5 (4.6%)
    Both mostly private 27 (14%) 8 (14%) 3 (14%) 16 (15%)
    Unknown 1 0 0 1
laboral_dichot >0.9 >0.9
    Private 179 (95%) 54 (95%) 21 (95%) 104 (95%)
    Public 9 (4.8%) 3 (5.3%) 1 (4.5%) 5 (4.6%)
    Unknown 1 0 0 1
work_hours 48 (40, 60) 50 (42, 60) 45 (40, 54) 46 (40, 55) 0.2 0.4
work_number
    0 2 (1.1%) 1 (1.8%) 0 (0%) 1 (0.9%)
    1 51 (27%) 16 (28%) 3 (14%) 32 (29%)
    2 53 (28%) 11 (19%) 10 (45%) 32 (29%)
    3 60 (32%) 17 (30%) 8 (36%) 35 (32%)
    4 15 (7.9%) 7 (12%) 1 (4.5%) 7 (6.4%)
    5 6 (3.2%) 3 (5.3%) 0 (0%) 3 (2.7%)
    6 2 (1.1%) 2 (3.5%) 0 (0%) 0 (0%)
work_teaching 71 (38%) 20 (35%) 10 (45%) 41 (37%) 0.7 0.8
work_emergency 60 (32%) 21 (37%) 8 (36%) 31 (28%) 0.5 0.8
work_uti 22 (12%) 7 (12%) 1 (4.5%) 14 (13%) 0.6 0.8
1 Median (IQR); n (%)
2 Kruskal-Wallis rank sum test; Fisher’s exact test; Pearson’s Chi-squared test
3 False discovery rate correction for multiple testing
base$bo_dich<-ifelse(base$burnout_diagnosis!="Normal",1,0)
base$bo_dich2<-ifelse(base$burnout_diagnosis=="Burnout",1,0)


library(rsample)
Warning: package 'rsample' was built under R version 4.3.1
set.seed(5620)  # para reproducibilidad

# Crear el objeto de partición
particion <- initial_split(base, prop = 0.7, strata = "work_md")

# Obtener los datos de entrenamiento y prueba
datos_entrenamiento <- training(particion)
datos_prueba <- testing(particion)


modelo <- glm(bo_dich ~ age+gender+work_md, data = base, family = "binomial")

tbl_regression(modelo, exponentiate = T)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Characteristic OR1 95% CI1 p-value
age 0.94 0.91, 0.97 <0.001
gender
    Male
    Female 0.79 0.29, 1.95 0.6
    Other 170,272 0.00, NA >0.9
work_md
    No
    Yes 0.97 0.41, 2.46 >0.9
1 OR = Odds Ratio, CI = Confidence Interval

Prediction Burno-out or risk

modelo1 <- glm(bo_dich2 ~ work_md, data = base, family = "binomial")

tbl_regression(modelo1, exponentiate = T)
Characteristic OR1 95% CI1 p-value
work_md
    No
    Yes 2.83 1.86, 4.31 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

Prediction Burno-out

modelo2 <- glm(bo_dich2 ~ age+gender+work_md+
                 dass_anxiety_index+
                dass_depression_index+
                dass_stress_index, data = base, family = "binomial")

tbl_regression(modelo2, exponentiate = T)
Characteristic OR1 95% CI1 p-value
age 1.00 0.91, 1.10 >0.9
gender
    Male
    Female 0.17 0.02, 1.19 0.089
work_md
    No
    Yes 7.94 1.17, 72.5 0.040
dass_anxiety_index 0.04 0.00, 21.7 0.3
dass_depression_index 1.39 0.00, 1,619 >0.9
dass_stress_index 29,332 7.10, 1,076,468,249 0.027
1 OR = Odds Ratio, CI = Confidence Interval
modelo2 <- glm(bo_dich2 ~ age+gender+work_md+
                 dass_anxiety_index+
                 dass_depression_index+
                 dass_stress_index, data = base, family = "binomial")

tbl_regression(modelo2, exponentiate = T)
Characteristic OR1 95% CI1 p-value
age 1.00 0.91, 1.10 >0.9
gender
    Male
    Female 0.17 0.02, 1.19 0.089
work_md
    No
    Yes 7.94 1.17, 72.5 0.040
dass_anxiety_index 0.04 0.00, 21.7 0.3
dass_depression_index 1.39 0.00, 1,619 >0.9
dass_stress_index 29,332 7.10, 1,076,468,249 0.027
1 OR = Odds Ratio, CI = Confidence Interval
base2<-base %>% filter(work_md=="Yes")

modelo2 <- glm(bo_dich2 ~ age+gender+
                 dass_anxiety_index+
                 dass_depression_index+
                 dass_stress_index, data = base2, family = "binomial")
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
tbl_regression(modelo2, exponentiate = T)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Characteristic OR1 95% CI1 p-value
age 0.60 0.16, 0.98 0.3
gender
    Male
    Female 0.00 0.00, 0.09 0.3
dass_anxiety_index 0.00 0.00, 830 0.4
dass_depression_index 0.00 0.00, 1.59 0.3
dass_stress_index 78,290,458,204,951,223,896,246,084,446 369,782,542, 221,720,652,094,366,777,100,444,802,220,842,468,800,826,260,022,824,006,466,024,268,408,460,486,442,444,646,080,462,448,044,484,868 0.3
1 OR = Odds Ratio, CI = Confidence Interval

Neuro-Psychiatric scores

base %>% select(dass_stress, dass_stress_dx,dass_anxiety,dass_anxiety_dx,  dass_depression, dass_depression_dx,burnout_diagnosis)%>%
  tbl_summary(by=burnout_diagnosis)%>% 
  add_overall()%>%
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 4** Depresion/Anxiety/Strees in MD vs non-MD (N = {N})")
Table 4 Depresion/Anxiety/Strees in MD vs non-MD (N = 612)
Characteristic Overall, N = 6121 Burnout, N = 1131 Normal, N = 891 at Risk, N = 4101 p-value2 q-value3
dass_stress 12 (6, 20) 20 (12, 26) 8 (2, 14) 14 (8, 20) <0.001 <0.001
    Unknown 247 84 13 150
dass_stress_dx
    Normal 116 (35%) 6 (21%) 33 (54%) 77 (32%)
    Mild 119 (36%) 4 (14%) 21 (34%) 94 (39%)
    Moderate 71 (22%) 12 (41%) 5 (8.2%) 54 (23%)
    Severe 16 (4.9%) 4 (14%) 2 (3.3%) 10 (4.2%)
    Extremely severe 6 (1.8%) 3 (10%) 0 (0%) 3 (1.3%)
    Unknown 284 84 28 172
dass_anxiety 4 (0, 8) 6 (2, 14) 2 (0, 4) 4 (0, 8) <0.001 <0.001
    Unknown 144 52 9 83
dass_anxiety_dx
    Normal 178 (55%) 22 (43%) 26 (62%) 130 (57%)
    Mild 32 (10.0%) 7 (14%) 5 (12%) 20 (8.8%)
    Moderate 52 (16%) 9 (18%) 8 (19%) 35 (15%)
    Severe 23 (7.2%) 5 (9.8%) 1 (2.4%) 17 (7.5%)
    Extremely severe 36 (11%) 8 (16%) 2 (4.8%) 26 (11%)
    Unknown 291 62 47 182
dass_depression 6 (0, 10) 13 (8, 20) 1 (0, 4) 6 (2, 12) <0.001 <0.001
    Unknown 174 71 7 96
dass_depression_dx
    Normal 187 (57%) 11 (28%) 32 (78%) 144 (59%)
    Mild 50 (15%) 8 (20%) 5 (12%) 37 (15%)
    Moderate 64 (20%) 12 (30%) 2 (4.9%) 50 (20%)
    Severe 17 (5.2%) 3 (7.5%) 1 (2.4%) 13 (5.3%)
    Extremely severe 8 (2.5%) 6 (15%) 1 (2.4%) 1 (0.4%)
    Unknown 286 73 48 165
1 Median (IQR); n (%)
2 Kruskal-Wallis rank sum test
3 False discovery rate correction for multiple testing
base$md<-as.integer(base$work_md=="Yes")
base%>%
  ggplot(aes(x=dass_anxiety, y=dass_depression, color=work_md))+
  geom_jitter(width = .5, height = .5, alpha=.5)+scale_fill_manual(values=c("#1B9E77", "#D95F02"))+
  geom_hline(yintercept=9, linetype="dashed")+
  geom_hline(yintercept=12, linetype="dashed")+
  geom_hline(yintercept=20, linetype="dashed")+
  geom_hline(yintercept=27, linetype="dashed")+
  geom_vline(xintercept=6, linetype="dashed")+
  geom_vline(xintercept=9, linetype="dashed")+
  geom_vline(xintercept=14, linetype="dashed")+
  geom_vline(xintercept=19, linetype="dashed")+
  theme_minimal()+
  ggtitle("DASS MD vs nonMD")

Maslach

base %>% select(maslach_emotional_exhaustion, maslach_depersonalization,maslach_personal_accomplishment, work_md)%>%
  tbl_summary(by=work_md)%>% 
  add_overall()%>%
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 5** Raw Maslach dimensions in MD vs non-MD (N = {N})")
Table 5 Raw Maslach dimensions in MD vs non-MD (N = 615)
Characteristic Overall, N = 6151 No, N = 4261 Yes, N = 1891 p-value2 q-value3
maslach_emotional_exhaustion 25 (16, 36) 22 (15, 32) 33 (22, 40) <0.001 <0.001
    Unknown 2 2 0
maslach_depersonalization 7.0 (5.0, 11.0) 7.0 (5.0, 10.0) 9.0 (6.0, 12.0) <0.001 <0.001
    Unknown 1 1 0
maslach_personal_accomplishment 29 (24, 34) 30 (24, 34) 29 (24, 33) 0.4 0.4
1 Median (IQR)
2 Wilcoxon rank sum test
3 False discovery rate correction for multiple testing
base %>% select(maslach_emotional_exhaustion_index, maslach_depersonalization_index,maslach_personal_accomplishment_index, work_md)%>%
  tbl_summary(by=work_md)%>% 
  add_overall()%>%
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 6** adjusted Maslach dimensions in MD vs non-MD (N = {N})")
Table 6 adjusted Maslach dimensions in MD vs non-MD (N = 615)
Characteristic Overall, N = 6151 No, N = 4261 Yes, N = 1891 p-value2 q-value3
maslach_emotional_exhaustion_index 0.46 (0.30, 0.67) 0.41 (0.28, 0.59) 0.61 (0.41, 0.74) <0.001 <0.001
    Unknown 2 2 0
maslach_depersonalization_index 0.23 (0.17, 0.37) 0.23 (0.17, 0.33) 0.30 (0.20, 0.40) <0.001 <0.001
    Unknown 1 1 0
maslach_personal_accomplishment_index 0.69 (0.57, 0.81) 0.71 (0.57, 0.81) 0.69 (0.57, 0.79) 0.4 0.4
1 Median (IQR)
2 Wilcoxon rank sum test
3 False discovery rate correction for multiple testing
summary(as.factor(base$work_license!=1))
FALSE  TRUE 
  459   156 
156/(439+156)
[1] 0.2621849
base<-base %>% rename("Hablar con familia y amigos"=estres_reliefs___1, 
                Dormir=estres_reliefs___2,
                "Pasar tiempo a solas"=estres_reliefs___3,
                "Escuchar musica"=estres_reliefs___4,
                "Comer comida chatarra"=estres_reliefs___5,
                "Tomar alcohol"=estres_reliefs___6,
                Fumar=estres_reliefs___7,
                "Uso de psicofármacos"=estres_reliefs___8,  
                "Marihuana y drogas"=estres_reliefs___9,
                "Automedicacion"=estres_reliefs___10,
                "Alimentacion saludable"=estres_reliefs___11,
                "Ejercicio regularmente ( al menos dos veces por semana)"=estres_reliefs___12, 
                "Meditación, yoga, mindfulness u otras técnicas, en forma regular"=                estres_reliefs___13,
                    "Apoyo psicológico y/o psiquiátrico en forma regular"=estres_reliefs___14, Ninguno=estres_reliefs___15)

names(base)
  [1] "record_id"                                                       
  [2] "redcap_survey_identifier"                                        
  [3] "consentimiento_timestamp"                                        
  [4] "consent_y"                                                       
  [5] "consentimiento_complete"                                         
  [6] "demogrfico_timestamp"                                            
  [7] "date_evaluation"                                                 
  [8] "dni_number"                                                      
  [9] "dob"                                                             
 [10] "nacionalidad"                                                    
 [11] "zip_code"                                                        
 [12] "localizacion_lat"                                                
 [13] "localizacion_long_2"                                             
 [14] "gender"                                                          
 [15] "family_income"                                                   
 [16] "personal_income"                                                 
 [17] "home_members"                                                    
 [18] "home_minor"                                                      
 [19] "home_elder"                                                      
 [20] "home_handicap"                                                   
 [21] "care_burden_hours"                                               
 [22] "demogrfico_complete"                                             
 [23] "caractersticas_trabajo_timestamp"                                
 [24] "laboral"                                                         
 [25] "work_type"                                                       
 [26] "laboral_field___1"                                               
 [27] "laboral_field___2"                                               
 [28] "laboral_field___3"                                               
 [29] "work_md"                                                         
 [30] "work_md_speciality"                                              
 [31] "work_md_yeargraduation"                                          
 [32] "studies"                                                         
 [33] "work_hours"                                                      
 [34] "work_number"                                                     
 [35] "work_teaching"                                                   
 [36] "work_teaching_hours"                                             
 [37] "work_leadership"                                                 
 [38] "work_emergency"                                                  
 [39] "work_uti"                                                        
 [40] "work_license"                                                    
 [41] "work_licenses___11"                                              
 [42] "work_licenses___12"                                              
 [43] "work_licenses___13"                                              
 [44] "work_licenses___14"                                              
 [45] "work_licenses___15"                                              
 [46] "work_licenses___16"                                              
 [47] "work_licenses___17"                                              
 [48] "work_licenses___18"                                              
 [49] "work_licenses___19"                                              
 [50] "work_licenses___20"                                              
 [51] "work_licenses___21"                                              
 [52] "work_licenses___22"                                              
 [53] "work_licenses___23"                                              
 [54] "work_licenses___24"                                              
 [55] "work_licenses___25"                                              
 [56] "work_licenses___26"                                              
 [57] "caractersticas_trabajo_complete"                                 
 [58] "actividades_saludables_timestamp"                                
 [59] "Hablar con familia y amigos"                                     
 [60] "Dormir"                                                          
 [61] "Pasar tiempo a solas"                                            
 [62] "Escuchar musica"                                                 
 [63] "Comer comida chatarra"                                           
 [64] "Tomar alcohol"                                                   
 [65] "Fumar"                                                           
 [66] "Uso de psicofármacos"                                            
 [67] "Marihuana y drogas"                                              
 [68] "Automedicacion"                                                  
 [69] "Alimentacion saludable"                                          
 [70] "Ejercicio regularmente ( al menos dos veces por semana)"         
 [71] "Meditación, yoga, mindfulness u otras técnicas, en forma regular"
 [72] "Apoyo psicológico y/o psiquiátrico en forma regular"             
 [73] "Ninguno"                                                         
 [74] "estres_cause___1"                                                
 [75] "estres_cause___2"                                                
 [76] "estres_cause___3"                                                
 [77] "estres_cause___4"                                                
 [78] "estres_cause___5"                                                
 [79] "estres_cause___6"                                                
 [80] "estres_cause___7"                                                
 [81] "estres_cause___8"                                                
 [82] "estres_cause___9"                                                
 [83] "estres_cause___10"                                               
 [84] "estres_cause___11"                                               
 [85] "estres_cause___12"                                               
 [86] "estres_cause___13"                                               
 [87] "estres_cause___14"                                               
 [88] "estres_family___0"                                               
 [89] "estres_family___1"                                               
 [90] "estres_family___2"                                               
 [91] "estres_work___0"                                                 
 [92] "estres_work___1"                                                 
 [93] "estres_work___2"                                                 
 [94] "actividades_saludables_complete"                                 
 [95] "maslach_timestamp"                                               
 [96] "maslach_1"                                                       
 [97] "maslach_2"                                                       
 [98] "maslach_3"                                                       
 [99] "maslach_4"                                                       
[100] "maslach_5"                                                       
[101] "maslach_6"                                                       
[102] "maslach_7"                                                       
[103] "maslach_8"                                                       
[104] "maslach_9"                                                       
[105] "maslach_10"                                                      
[106] "maslach_11"                                                      
[107] "maslach_12"                                                      
[108] "maslach_13"                                                      
[109] "maslach_14"                                                      
[110] "maslach_15"                                                      
[111] "maslach_16"                                                      
[112] "maslach_17"                                                      
[113] "maslach_18"                                                      
[114] "maslach_20"                                                      
[115] "maslach_19"                                                      
[116] "maslach_22"                                                      
[117] "maslach_21"                                                      
[118] "maslach_complete"                                                
[119] "dass21_timestamp"                                                
[120] "dass_1"                                                          
[121] "dass_2"                                                          
[122] "dass_3"                                                          
[123] "dass_4"                                                          
[124] "dass_5"                                                          
[125] "dass_6"                                                          
[126] "dass_7"                                                          
[127] "dass_8"                                                          
[128] "dass_9"                                                          
[129] "dass_10"                                                         
[130] "dass_11"                                                         
[131] "dass_12"                                                         
[132] "dass_13"                                                         
[133] "dass_14"                                                         
[134] "dass_15"                                                         
[135] "dass_16"                                                         
[136] "dass_17"                                                         
[137] "dass_18"                                                         
[138] "dass_19"                                                         
[139] "dass_20"                                                         
[140] "dass_21"                                                         
[141] "dass21_complete"                                                 
[142] "neoffi_timestamp"                                                
[143] "neo_ffi1"                                                        
[144] "neo_ffi2"                                                        
[145] "neo_ffi3"                                                        
[146] "neo_ffi4"                                                        
[147] "neo_ffi5"                                                        
[148] "neo_ffi6"                                                        
[149] "neo_ffi7"                                                        
[150] "neo_ffi8"                                                        
[151] "neo_ffi9"                                                        
[152] "neo_ffi10"                                                       
[153] "neo_ffi11"                                                       
[154] "neo_ffi12"                                                       
[155] "neo_ffi13"                                                       
[156] "neo_ffi14"                                                       
[157] "neo_ffi15"                                                       
[158] "neo_ffi16"                                                       
[159] "neo_ffi17"                                                       
[160] "neo_ffi18"                                                       
[161] "neo_ffi19"                                                       
[162] "neo_ffi20"                                                       
[163] "neo_ffi21"                                                       
[164] "neo_ffi22"                                                       
[165] "neo_ffi23"                                                       
[166] "neo_ffi24"                                                       
[167] "neo_ffi25"                                                       
[168] "neo_ffi26"                                                       
[169] "neo_ffi27"                                                       
[170] "neo_ffi28"                                                       
[171] "neo_ffi29"                                                       
[172] "neo_ffi30"                                                       
[173] "neo_ffi31"                                                       
[174] "neo_ffi32"                                                       
[175] "neo_ffi33"                                                       
[176] "neo_ffi34"                                                       
[177] "neo_ffi35"                                                       
[178] "neo_ffi36"                                                       
[179] "neo_ffi37"                                                       
[180] "neo_ffi38"                                                       
[181] "neo_ffi39"                                                       
[182] "neo_ffi40"                                                       
[183] "neo_ffi41"                                                       
[184] "neo_ffi42"                                                       
[185] "neo_ffi43"                                                       
[186] "neo_ffi44"                                                       
[187] "neo_ffi45"                                                       
[188] "neo_ffi46"                                                       
[189] "neo_ffi47"                                                       
[190] "neo_ffi48"                                                       
[191] "neo_ffi49"                                                       
[192] "neo_ffi50"                                                       
[193] "neo_ffi51"                                                       
[194] "neo_ffi52"                                                       
[195] "neo_ffi53"                                                       
[196] "neo_ffi54"                                                       
[197] "neo_ffi55"                                                       
[198] "neo_ffi56"                                                       
[199] "neo_ffi57"                                                       
[200] "neo_ffi58"                                                       
[201] "neo_ffi59"                                                       
[202] "neo_ffi60"                                                       
[203] "finalizacion"                                                    
[204] "neoffi_complete"                                                 
[205] "origin"                                                          
[206] "maslach_emotional_exhaustion"                                    
[207] "maslach_emotional_exhaustion_altered"                            
[208] "maslach_emotional_exhaustion_index"                              
[209] "maslach_emotional_exhaustion_dx"                                 
[210] "maslach_depersonalization"                                       
[211] "maslach_depersonalization_altered"                               
[212] "maslach_depersonalization_index"                                 
[213] "maslach_depersonalization_dx"                                    
[214] "maslach_personal_accomplishment"                                 
[215] "maslach_personal_accomplishment_index"                           
[216] "maslach_personal_accomplishment_dx"                              
[217] "maslach_personal_accomplishment_altered"                         
[218] "bo_dx"                                                           
[219] "burnout_diagnosis"                                               
[220] "age"                                                             
[221] "family_income_recode"                                            
[222] "personal_income_recode"                                          
[223] "only_provider"                                                   
[224] "laboral_dichot"                                                  
[225] "dass_stress"                                                     
[226] "dass_stress_index"                                               
[227] "dass_stress_dx"                                                  
[228] "dass_anxiety"                                                    
[229] "dass_anxiety_index"                                              
[230] "dass_anxiety_dx"                                                 
[231] "dass_depression"                                                 
[232] "dass_depression_index"                                           
[233] "dass_depression_dx"                                              
[234] "years_of_graduation"                                             
[235] "nurse"                                                           
[236] "bo_dich"                                                         
[237] "bo_dich2"                                                        
[238] "md"                                                              
base %>% select(59:73, burnout_diagnosis)%>%
  tbl_summary(by=burnout_diagnosis) %>%
  add_overall()%>%
  add_p()
3 observations missing `burnout_diagnosis` have been removed. To include these observations, use `forcats::fct_na_value_to_level()` on `burnout_diagnosis` column before passing to `tbl_summary()`.
Characteristic Overall, N = 6121 Burnout, N = 1131 Normal, N = 891 at Risk, N = 4101 p-value2
Hablar con familia y amigos 460 (75%) 86 (76%) 67 (75%) 307 (75%) >0.9
Dormir 380 (62%) 71 (63%) 54 (61%) 255 (62%) >0.9
Pasar tiempo a solas 267 (44%) 61 (54%) 32 (36%) 174 (42%) 0.026
Escuchar musica 319 (52%) 56 (50%) 42 (47%) 221 (54%) 0.4
Comer comida chatarra 105 (17%) 29 (26%) 6 (6.7%) 70 (17%) 0.002
Tomar alcohol 96 (16%) 24 (21%) 6 (6.7%) 66 (16%) 0.018
Fumar 38 (6.2%) 6 (5.3%) 2 (2.2%) 30 (7.3%) 0.2
Uso de psicofármacos 44 (7.2%) 14 (12%) 2 (2.2%) 28 (6.8%) 0.019
Marihuana y drogas 22 (3.6%) 10 (8.8%) 0 (0%) 12 (2.9%) 0.002
Automedicacion 60 (9.8%) 15 (13%) 7 (7.9%) 38 (9.3%) 0.4
Alimentacion saludable 178 (29%) 28 (25%) 33 (37%) 117 (29%) 0.15
Ejercicio regularmente ( al menos dos veces por semana) 324 (53%) 54 (48%) 60 (67%) 210 (51%) 0.010
Meditación, yoga, mindfulness u otras técnicas, en forma regular 128 (21%) 23 (20%) 22 (25%) 83 (20%) 0.6
Apoyo psicológico y/o psiquiátrico en forma regular 182 (30%) 49 (43%) 17 (19%) 116 (28%) <0.001
Ninguno 15 (2.5%) 0 (0%) 1 (1.1%) 14 (3.4%) 0.067
1 n (%)
2 Pearson’s Chi-squared test; Fisher’s exact test
base<-base %>% rename(" Mucha carga burocrática"=   estres_cause___1    ,
"   Falta de respeto de los compañeros"=    estres_cause___2    ,
"   Falta de respeto de los pacientes   "=  estres_cause___3    ,
"   Demanda emocional de los pacientes  "=  estres_cause___4    ,
"   Exigencia institucional "=  estres_cause___5    ,
"   Realización de muchas tareas en simultáneo  "=  estres_cause___6    ,
"   Muchas horas de trabajo en atención al paciente ( excluyendo tareas administrativas )   "=  estres_cause___7    ,
"   Horas no remuneradas de trabajo ( ej terminar su labor fuera de su horario convenido)   "=  estres_cause___8    ,
"   Salario escaso  "=  estres_cause___9    ,
"   Poco liderazgo , consideración o conducción "=  estres_cause___10   ,
"   Situaciones de mal trato laboral    "=  estres_cause___11   ,
"   Transformacion digital de su trabajo    "=  estres_cause___12   ,
"   Pandemia por covid-19   "=  estres_cause___13   ,
"   Ninguno de los anteriores   "=  estres_cause___14
)


base %>% select("   Mucha carga burocrática":"  Ninguno de los anteriores   ", burnout_diagnosis) %>%
  tbl_summary(by=burnout_diagnosis) %>%
  add_overall()%>%
  add_p()
3 observations missing `burnout_diagnosis` have been removed. To include these observations, use `forcats::fct_na_value_to_level()` on `burnout_diagnosis` column before passing to `tbl_summary()`.
Characteristic Overall, N = 6121 Burnout, N = 1131 Normal, N = 891 at Risk, N = 4101 p-value2
Mucha carga burocrática 280 (46%) 69 (61%) 30 (34%) 181 (44%) <0.001
Falta de respeto de los compañeros 106 (17%) 33 (29%) 9 (10%) 64 (16%) <0.001
Falta de respeto de los pacientes 157 (26%) 53 (47%) 17 (19%) 87 (21%) <0.001
Demanda emocional de los pacientes 261 (43%) 66 (58%) 33 (37%) 162 (40%) <0.001
Exigencia institucional 259 (42%) 72 (64%) 18 (20%) 169 (41%) <0.001
Realización de muchas tareas en simultáneo 393 (64%) 91 (81%) 39 (44%) 263 (64%) <0.001
Muchas horas de trabajo en atención al paciente ( excluyendo tareas administrativas ) 188 (31%) 55 (49%) 15 (17%) 118 (29%) <0.001
Horas no remuneradas de trabajo ( ej terminar su labor fuera de su horario convenido) 220 (36%) 65 (58%) 25 (28%) 130 (32%) <0.001
Salario escaso 396 (65%) 87 (77%) 42 (47%) 267 (65%) <0.001
Poco liderazgo , consideración o conducción 138 (23%) 39 (35%) 6 (6.7%) 93 (23%) <0.001
Situaciones de mal trato laboral 102 (17%) 35 (31%) 6 (6.7%) 61 (15%) <0.001
Transformacion digital de su trabajo 32 (5.2%) 8 (7.1%) 1 (1.1%) 23 (5.6%) 0.11
Pandemia por covid-19 62 (10%) 14 (12%) 11 (12%) 37 (9.0%) 0.4
Ninguno de los anteriores 31 (5.1%) 1 (0.9%) 13 (15%) 17 (4.1%) <0.001
1 n (%)
2 Pearson’s Chi-squared test; Fisher’s exact test
base %>% select(estres_family___0:estres_work___2, burnout_diagnosis)%>%
  tbl_summary(by=burnout_diagnosis) %>%
  add_overall()%>%
  add_p()
3 observations missing `burnout_diagnosis` have been removed. To include these observations, use `forcats::fct_na_value_to_level()` on `burnout_diagnosis` column before passing to `tbl_summary()`.
Characteristic Overall, N = 6121 Burnout, N = 1131 Normal, N = 891 at Risk, N = 4101 p-value2
estres_family___0 128 (21%) 7 (6.2%) 37 (42%) 84 (20%) <0.001
estres_family___1 387 (63%) 69 (61%) 49 (55%) 269 (66%) 0.2
estres_family___2 104 (17%) 38 (34%) 3 (3.4%) 63 (15%) <0.001
estres_work___0 157 (26%) 3 (2.7%) 47 (53%) 107 (26%) <0.001
estres_work___1 353 (58%) 68 (60%) 40 (45%) 245 (60%) 0.031
estres_work___2 108 (18%) 43 (38%) 2 (2.2%) 63 (15%) <0.001
1 n (%)
2 Pearson’s Chi-squared test

Correlation Neuropsychiatric vs Maslach

library(corrplot)
corrplot 0.92 loaded
a<-base %>% select(maslach_personal_accomplishment_index,
                maslach_depersonalization_index,
                maslach_emotional_exhaustion_index,
                dass_anxiety_index,
                dass_depression_index,
                dass_stress_index)

a<-scale(a)
a<-na.omit(a)
M<-cor(a)

cor.mtest <- function(mat, ...) {
    mat <- as.matrix(mat)
    n <- ncol(mat)
    p.mat<- matrix(NA, n, n)
    diag(p.mat) <- 0
    for (i in 1:(n - 1)) {
        for (j in (i + 1):n) {
            tmp <- cor.test(mat[, i], mat[, j], ...)
            p.mat[i, j] <- p.mat[j, i] <- tmp$p.value
        }
    }
  colnames(p.mat) <- rownames(p.mat) <- colnames(mat)
  p.mat
}
# matrix of the p-value of the correlation
p.mat <- cor.mtest(a)

corrplot(M, method="color",  
         type="upper", order="hclust", 
         addCoef.col = "black", # Add coefficient of correlation
         tl.col="black", #Text label color and rotation
         # Combine with significance
         p.mat = p.mat, sig.level = 0.01, 
         # hide correlation coefficient on the principal diagonal
         diag=FALSE)

Prediction model Burnout

summary(base$burnout_diagnosis)
   Length     Class      Mode 
      615 character character 
base$bo_dich<-ifelse(base$burnout_diagnosis=="Normal",0,1)


library(rsample)


set.seed(5620)  # para reproducibilidad

# Crear el objeto de partición
particion <- initial_split(base, prop = 0.7, strata = "work_md")

# Obtener los datos de entrenamiento y prueba
datos_entrenamiento <- training(particion)
datos_prueba <- testing(particion)

Enfermeros

names(base)
  [1] "record_id"                                                                                
  [2] "redcap_survey_identifier"                                                                 
  [3] "consentimiento_timestamp"                                                                 
  [4] "consent_y"                                                                                
  [5] "consentimiento_complete"                                                                  
  [6] "demogrfico_timestamp"                                                                     
  [7] "date_evaluation"                                                                          
  [8] "dni_number"                                                                               
  [9] "dob"                                                                                      
 [10] "nacionalidad"                                                                             
 [11] "zip_code"                                                                                 
 [12] "localizacion_lat"                                                                         
 [13] "localizacion_long_2"                                                                      
 [14] "gender"                                                                                   
 [15] "family_income"                                                                            
 [16] "personal_income"                                                                          
 [17] "home_members"                                                                             
 [18] "home_minor"                                                                               
 [19] "home_elder"                                                                               
 [20] "home_handicap"                                                                            
 [21] "care_burden_hours"                                                                        
 [22] "demogrfico_complete"                                                                      
 [23] "caractersticas_trabajo_timestamp"                                                         
 [24] "laboral"                                                                                  
 [25] "work_type"                                                                                
 [26] "laboral_field___1"                                                                        
 [27] "laboral_field___2"                                                                        
 [28] "laboral_field___3"                                                                        
 [29] "work_md"                                                                                  
 [30] "work_md_speciality"                                                                       
 [31] "work_md_yeargraduation"                                                                   
 [32] "studies"                                                                                  
 [33] "work_hours"                                                                               
 [34] "work_number"                                                                              
 [35] "work_teaching"                                                                            
 [36] "work_teaching_hours"                                                                      
 [37] "work_leadership"                                                                          
 [38] "work_emergency"                                                                           
 [39] "work_uti"                                                                                 
 [40] "work_license"                                                                             
 [41] "work_licenses___11"                                                                       
 [42] "work_licenses___12"                                                                       
 [43] "work_licenses___13"                                                                       
 [44] "work_licenses___14"                                                                       
 [45] "work_licenses___15"                                                                       
 [46] "work_licenses___16"                                                                       
 [47] "work_licenses___17"                                                                       
 [48] "work_licenses___18"                                                                       
 [49] "work_licenses___19"                                                                       
 [50] "work_licenses___20"                                                                       
 [51] "work_licenses___21"                                                                       
 [52] "work_licenses___22"                                                                       
 [53] "work_licenses___23"                                                                       
 [54] "work_licenses___24"                                                                       
 [55] "work_licenses___25"                                                                       
 [56] "work_licenses___26"                                                                       
 [57] "caractersticas_trabajo_complete"                                                          
 [58] "actividades_saludables_timestamp"                                                         
 [59] "Hablar con familia y amigos"                                                              
 [60] "Dormir"                                                                                   
 [61] "Pasar tiempo a solas"                                                                     
 [62] "Escuchar musica"                                                                          
 [63] "Comer comida chatarra"                                                                    
 [64] "Tomar alcohol"                                                                            
 [65] "Fumar"                                                                                    
 [66] "Uso de psicofármacos"                                                                     
 [67] "Marihuana y drogas"                                                                       
 [68] "Automedicacion"                                                                           
 [69] "Alimentacion saludable"                                                                   
 [70] "Ejercicio regularmente ( al menos dos veces por semana)"                                  
 [71] "Meditación, yoga, mindfulness u otras técnicas, en forma regular"                         
 [72] "Apoyo psicológico y/o psiquiátrico en forma regular"                                      
 [73] "Ninguno"                                                                                  
 [74] "\tMucha carga burocrática"                                                                
 [75] "\tFalta de respeto de los compañeros"                                                     
 [76] "\tFalta de respeto de los pacientes\t"                                                    
 [77] "\tDemanda emocional de los pacientes\t"                                                   
 [78] "\tExigencia institucional\t"                                                              
 [79] "\tRealización de muchas tareas en simultáneo\t"                                           
 [80] "\tMuchas horas de trabajo en atención al paciente ( excluyendo tareas administrativas )\t"
 [81] "\tHoras no remuneradas de trabajo ( ej terminar su labor fuera de su horario convenido)\t"
 [82] "\tSalario escaso\t"                                                                       
 [83] "\tPoco liderazgo , consideración o conducción\t"                                          
 [84] "\tSituaciones de mal trato laboral\t"                                                     
 [85] "\tTransformacion digital de su trabajo\t"                                                 
 [86] "\tPandemia por covid-19\t"                                                                
 [87] "\tNinguno de los anteriores\t"                                                            
 [88] "estres_family___0"                                                                        
 [89] "estres_family___1"                                                                        
 [90] "estres_family___2"                                                                        
 [91] "estres_work___0"                                                                          
 [92] "estres_work___1"                                                                          
 [93] "estres_work___2"                                                                          
 [94] "actividades_saludables_complete"                                                          
 [95] "maslach_timestamp"                                                                        
 [96] "maslach_1"                                                                                
 [97] "maslach_2"                                                                                
 [98] "maslach_3"                                                                                
 [99] "maslach_4"                                                                                
[100] "maslach_5"                                                                                
[101] "maslach_6"                                                                                
[102] "maslach_7"                                                                                
[103] "maslach_8"                                                                                
[104] "maslach_9"                                                                                
[105] "maslach_10"                                                                               
[106] "maslach_11"                                                                               
[107] "maslach_12"                                                                               
[108] "maslach_13"                                                                               
[109] "maslach_14"                                                                               
[110] "maslach_15"                                                                               
[111] "maslach_16"                                                                               
[112] "maslach_17"                                                                               
[113] "maslach_18"                                                                               
[114] "maslach_20"                                                                               
[115] "maslach_19"                                                                               
[116] "maslach_22"                                                                               
[117] "maslach_21"                                                                               
[118] "maslach_complete"                                                                         
[119] "dass21_timestamp"                                                                         
[120] "dass_1"                                                                                   
[121] "dass_2"                                                                                   
[122] "dass_3"                                                                                   
[123] "dass_4"                                                                                   
[124] "dass_5"                                                                                   
[125] "dass_6"                                                                                   
[126] "dass_7"                                                                                   
[127] "dass_8"                                                                                   
[128] "dass_9"                                                                                   
[129] "dass_10"                                                                                  
[130] "dass_11"                                                                                  
[131] "dass_12"                                                                                  
[132] "dass_13"                                                                                  
[133] "dass_14"                                                                                  
[134] "dass_15"                                                                                  
[135] "dass_16"                                                                                  
[136] "dass_17"                                                                                  
[137] "dass_18"                                                                                  
[138] "dass_19"                                                                                  
[139] "dass_20"                                                                                  
[140] "dass_21"                                                                                  
[141] "dass21_complete"                                                                          
[142] "neoffi_timestamp"                                                                         
[143] "neo_ffi1"                                                                                 
[144] "neo_ffi2"                                                                                 
[145] "neo_ffi3"                                                                                 
[146] "neo_ffi4"                                                                                 
[147] "neo_ffi5"                                                                                 
[148] "neo_ffi6"                                                                                 
[149] "neo_ffi7"                                                                                 
[150] "neo_ffi8"                                                                                 
[151] "neo_ffi9"                                                                                 
[152] "neo_ffi10"                                                                                
[153] "neo_ffi11"                                                                                
[154] "neo_ffi12"                                                                                
[155] "neo_ffi13"                                                                                
[156] "neo_ffi14"                                                                                
[157] "neo_ffi15"                                                                                
[158] "neo_ffi16"                                                                                
[159] "neo_ffi17"                                                                                
[160] "neo_ffi18"                                                                                
[161] "neo_ffi19"                                                                                
[162] "neo_ffi20"                                                                                
[163] "neo_ffi21"                                                                                
[164] "neo_ffi22"                                                                                
[165] "neo_ffi23"                                                                                
[166] "neo_ffi24"                                                                                
[167] "neo_ffi25"                                                                                
[168] "neo_ffi26"                                                                                
[169] "neo_ffi27"                                                                                
[170] "neo_ffi28"                                                                                
[171] "neo_ffi29"                                                                                
[172] "neo_ffi30"                                                                                
[173] "neo_ffi31"                                                                                
[174] "neo_ffi32"                                                                                
[175] "neo_ffi33"                                                                                
[176] "neo_ffi34"                                                                                
[177] "neo_ffi35"                                                                                
[178] "neo_ffi36"                                                                                
[179] "neo_ffi37"                                                                                
[180] "neo_ffi38"                                                                                
[181] "neo_ffi39"                                                                                
[182] "neo_ffi40"                                                                                
[183] "neo_ffi41"                                                                                
[184] "neo_ffi42"                                                                                
[185] "neo_ffi43"                                                                                
[186] "neo_ffi44"                                                                                
[187] "neo_ffi45"                                                                                
[188] "neo_ffi46"                                                                                
[189] "neo_ffi47"                                                                                
[190] "neo_ffi48"                                                                                
[191] "neo_ffi49"                                                                                
[192] "neo_ffi50"                                                                                
[193] "neo_ffi51"                                                                                
[194] "neo_ffi52"                                                                                
[195] "neo_ffi53"                                                                                
[196] "neo_ffi54"                                                                                
[197] "neo_ffi55"                                                                                
[198] "neo_ffi56"                                                                                
[199] "neo_ffi57"                                                                                
[200] "neo_ffi58"                                                                                
[201] "neo_ffi59"                                                                                
[202] "neo_ffi60"                                                                                
[203] "finalizacion"                                                                             
[204] "neoffi_complete"                                                                          
[205] "origin"                                                                                   
[206] "maslach_emotional_exhaustion"                                                             
[207] "maslach_emotional_exhaustion_altered"                                                     
[208] "maslach_emotional_exhaustion_index"                                                       
[209] "maslach_emotional_exhaustion_dx"                                                          
[210] "maslach_depersonalization"                                                                
[211] "maslach_depersonalization_altered"                                                        
[212] "maslach_depersonalization_index"                                                          
[213] "maslach_depersonalization_dx"                                                             
[214] "maslach_personal_accomplishment"                                                          
[215] "maslach_personal_accomplishment_index"                                                    
[216] "maslach_personal_accomplishment_dx"                                                       
[217] "maslach_personal_accomplishment_altered"                                                  
[218] "bo_dx"                                                                                    
[219] "burnout_diagnosis"                                                                        
[220] "age"                                                                                      
[221] "family_income_recode"                                                                     
[222] "personal_income_recode"                                                                   
[223] "only_provider"                                                                            
[224] "laboral_dichot"                                                                           
[225] "dass_stress"                                                                              
[226] "dass_stress_index"                                                                        
[227] "dass_stress_dx"                                                                           
[228] "dass_anxiety"                                                                             
[229] "dass_anxiety_index"                                                                       
[230] "dass_anxiety_dx"                                                                          
[231] "dass_depression"                                                                          
[232] "dass_depression_index"                                                                    
[233] "dass_depression_dx"                                                                       
[234] "years_of_graduation"                                                                      
[235] "nurse"                                                                                    
[236] "bo_dich"                                                                                  
[237] "bo_dich2"                                                                                 
[238] "md"                                                                                       
base %>% filter(nurse==1) %>%
  select(age, gender, family_income_recode, personal_income_recode,
         work_number, work_teaching, work_teaching_hours, only_provider, laboral,work_uti, burnout_diagnosis) %>%
  tbl_summary(by=burnout_diagnosis, missing="no") %>% 
  add_overall()%>%
  add_p() %>%
  add_q() %>%
  modify_caption("**Table 4** Comparison by burnout diagnosis (N = {N})")
1 observations missing `burnout_diagnosis` have been removed. To include these observations, use `forcats::fct_na_value_to_level()` on `burnout_diagnosis` column before passing to `tbl_summary()`.
add_q: Adjusting p-values with
`stats::p.adjust(x$table_body$p.value, method = "fdr")`
Table 4 Comparison by burnout diagnosis (N = 206)
Characteristic Overall, N = 2061 Burnout, N = 231 Normal, N = 411 at Risk, N = 1421 p-value2 q-value3
age 46 (36, 53) 39 (34, 46) 55 (44, 63) 46 (36, 53) 0.094 0.3
gender 0.3 0.6
    Male 45 (22%) 4 (17%) 14 (34%) 27 (19%)
    Female 160 (78%) 19 (83%) 27 (66%) 114 (80%)
    Other 1 (0.5%) 0 (0%) 0 (0%) 1 (0.7%)
family_income_recode 0.4 0.6
    Less than 250.000 3 (1.5%) 1 (4.3%) 0 (0%) 2 (1.4%)
    More than 250.000 203 (99%) 22 (96%) 41 (100%) 140 (99%)
personal_income_recode >0.9 >0.9
    Less than 250.000 2 (1.0%) 0 (0%) 0 (0%) 2 (1.4%)
    More than 250.000 204 (99%) 23 (100%) 41 (100%) 140 (99%)
work_number 2.00 (1.00, 2.00) 1.00 (1.00, 2.00) 2.00 (1.00, 3.00) 2.00 (1.00, 2.00) 0.3 0.6
work_teaching 36 (17%) 5 (22%) 7 (17%) 24 (17%) 0.8 0.9
work_teaching_hours 12 (8, 21) 20 (16, 20) 20 (9, 38) 10 (8, 20) 0.5 0.7
only_provider 127 (62%) 17 (74%) 32 (78%) 78 (55%) 0.012 0.12
laboral 0.5 0.7
    Private practice 174 (84%) 21 (91%) 33 (80%) 120 (85%)
    Public 5 (2.4%) 0 (0%) 2 (4.9%) 3 (2.1%)
    Both mostly public 4 (1.9%) 1 (4.3%) 0 (0%) 3 (2.1%)
    Both mostly private 23 (11%) 1 (4.3%) 6 (15%) 16 (11%)
work_uti 34 (17%) 7 (30%) 8 (20%) 19 (13%) 0.094 0.3
1 Median (IQR); n (%)
2 Kruskal-Wallis rank sum test; Fisher’s exact test; Pearson’s Chi-squared test
3 False discovery rate correction for multiple testing
base$work_number_cat<-ifelse(base$work_number>=5, "5 o mas", ifelse(base$work_number<=2, "hasta dos", "3 o 4"))

base %>%
  filter(nurse == 1) %>%
  group_by(work_number_cat) %>%
  summarise(count = n()) %>%
  mutate(percent = (count / sum(count)) * 100)
# A tibble: 3 × 3
  work_number_cat count percent
  <chr>           <int>   <dbl>
1 3 o 4              29   14.0 
2 5 o mas            17    8.21
3 hasta dos         161   77.8