Load packages

pacman::p_load(knitr,
kableExtra,
tidyverse,
janitor,
summarytools,
DataExplorer,
readxl,
arsenal,
epitools)
ds <- read_excel("C:/Users/lucas/Downloads/LUCAS.xlsx")
ds <- clean_names(ds)
ds <- ds %>% mutate_all(as.factor)
ds %>% count(sexo)
## # A tibble: 2 x 2
##   sexo      n
##   <fct> <int>
## 1 0        18
## 2 1        33

Sexo

ds %>% select(sexo, eb_meem:cc_wcst) %>% 
  compareGroups::compareGroups(sexo ~ ., 
                               byrow = T,
                               riskratio = T,
                               data = .) %>% 
  compareGroups::createTable(., 
                             show.ratio = TRUE,
                             show.p.overall = F)
## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect
## 
## --------Summary descriptives table by 'sexo'---------
## 
## ____________________________________________________________ 
##                   0          1             RR        p.ratio 
##                  N=18       N=33                             
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## eb_meem:                                                     
##     0         9 (45.0%)  11 (55.0%)       Ref.        Ref.   
##     1         9 (29.0%)  22 (71.0%) 1.29 [0.82;2.04]  0.265  
## ep_rivermead:                                                
##     0         11 (40.7%) 16 (59.3%)       Ref.        Ref.   
##     1         7 (29.2%)  17 (70.8%) 1.20 [0.80;1.79]  0.409  
## wais_ep_vocb:                                                
##     0         14 (33.3%) 28 (66.7%)       Ref.        Ref.   
##     1         4 (44.4%)  5 (55.6%)  0.83 [0.45;1.55]  0.548  
## wais_ep_dig:                                                 
##     0         16 (34.8%) 30 (65.2%)       Ref.        Ref.   
##     1         2 (40.0%)  3 (60.0%)  0.92 [0.44;1.94]  0.815  
## wais_ep_cub:                                                 
##     0         13 (31.7%) 28 (68.3%)       Ref.        Ref.   
##     1         5 (50.0%)  5 (50.0%)  0.73 [0.38;1.41]  0.309  
## cc_wcst:                                                     
##     0         15 (37.5%) 25 (62.5%)       Ref.        Ref.   
##     1         3 (27.3%)  8 (72.7%)  1.16 [0.75;1.80]  0.564  
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Idade

ds %>% select(idade, eb_meem:cc_wcst) %>% 
  compareGroups::compareGroups(idade ~ ., 
                               byrow = T,
                               riskratio = T,
                               data = .) %>% 
  compareGroups::createTable(., 
                             show.ratio = TRUE,
                             show.p.overall = F)
## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect
## 
## --------Summary descriptives table by 'idade'---------
## 
## ____________________________________________________________ 
##                   0          1             RR        p.ratio 
##                  N=26       N=25                             
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## eb_meem:                                                     
##     0         16 (80.0%) 4 (20.0%)        Ref.        Ref.   
##     1         10 (32.3%) 21 (67.7%) 3.39 [1.36;8.41]  0.001  
## ep_rivermead:                                                
##     0         18 (66.7%) 9 (33.3%)        Ref.        Ref.   
##     1         8 (33.3%)  16 (66.7%) 2.00 [1.09;3.66]  0.021  
## wais_ep_vocb:                                                
##     0         22 (52.4%) 20 (47.6%)       Ref.        Ref.   
##     1         4 (44.4%)  5 (55.6%)  1.17 [0.60;2.27]  0.686  
## wais_ep_dig:                                                 
##     0         22 (47.8%) 24 (52.2%)       Ref.        Ref.   
##     1         4 (80.0%)  1 (20.0%)  0.38 [0.06;2.26]  0.215  
## wais_ep_cub:                                                 
##     0         21 (51.2%) 20 (48.8%)       Ref.        Ref.   
##     1         5 (50.0%)  5 (50.0%)  1.03 [0.51;2.05]  0.947  
## cc_wcst:                                                     
##     0         17 (42.5%) 23 (57.5%)       Ref.        Ref.   
##     1         9 (81.8%)  2 (18.2%)  0.32 [0.09;1.14]  0.026  
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Tempo de doença

ds %>% select(td, eb_meem:cc_wcst) %>% 
  compareGroups::compareGroups(td ~ ., 
                               byrow = T,
                               riskratio = T,
                               data = .) %>% 
  compareGroups::createTable(., 
                             show.ratio = TRUE,
                             show.p.overall = F)
## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect
## 
## --------Summary descriptives table by 'td'---------
## 
## ___________________________________________________________ 
##                   0          1            RR        p.ratio 
##                  N=45       N=6                             
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## eb_meem:                                                    
##     0         20 (100%)  0 (0.00%)       Ref.        Ref.   
##     1         25 (80.6%) 6 (19.4%)     . [.;.]       0.041  
## ep_rivermead:                                               
##     0         26 (96.3%) 1 (3.70%)       Ref.        Ref.   
##     1         19 (79.2%) 5 (20.8%) 5.63 [0.71;44.8]  0.079  
## wais_ep_vocb:                                               
##     0         37 (88.1%) 5 (11.9%)       Ref.        Ref.   
##     1         8 (88.9%)  1 (11.1%) 0.93 [0.12;7.06]  0.992  
## wais_ep_dig:                                                
##     0         40 (87.0%) 6 (13.0%)       Ref.        Ref.   
##     1          5 (100%)  0 (0.00%)  0.00 [0.00;.]    0.520  
## wais_ep_cub:                                                
##     0         36 (87.8%) 5 (12.2%)       Ref.        Ref.   
##     1         9 (90.0%)  1 (10.0%) 0.82 [0.11;6.26]  0.915  
## cc_wcst:                                                    
##     0         34 (85.0%) 6 (15.0%)       Ref.        Ref.   
##     1         11 (100%)  0 (0.00%)  0.00 [0.00;.]    0.213  
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Idade de Início da doença

ds %>% select(iid, eb_meem:cc_wcst) %>% 
  compareGroups::compareGroups(iid ~ ., 
                               byrow = T,
                               riskratio = T,
                               data = .) %>% 
  compareGroups::createTable(., 
                             show.ratio = TRUE,
                             show.p.overall = F)
## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect
## 
## --------Summary descriptives table by 'iid'---------
## 
## ____________________________________________________________ 
##                   0          1             RR        p.ratio 
##                  N=14       N=37                             
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## eb_meem:                                                     
##     0         6 (30.0%)  14 (70.0%)       Ref.        Ref.   
##     1         8 (25.8%)  23 (74.2%) 1.06 [0.74;1.51]  0.750  
## ep_rivermead:                                                
##     0         7 (25.9%)  20 (74.1%)       Ref.        Ref.   
##     1         7 (29.2%)  17 (70.8%) 0.96 [0.68;1.34]  0.804  
## wais_ep_vocb:                                                
##     0         12 (28.6%) 30 (71.4%)       Ref.        Ref.   
##     1         2 (22.2%)  7 (77.8%)  1.09 [0.73;1.62]  0.745  
## wais_ep_dig:                                                 
##     0         11 (23.9%) 35 (76.1%)       Ref.        Ref.   
##     1         3 (60.0%)  2 (40.0%)  0.53 [0.18;1.56]  0.136  
## wais_ep_cub:                                                 
##     0         11 (26.8%) 30 (73.2%)       Ref.        Ref.   
##     1         3 (30.0%)  7 (70.0%)  0.96 [0.61;1.49]  0.830  
## cc_wcst:                                                     
##     0         10 (25.0%) 30 (75.0%)       Ref.        Ref.   
##     1         4 (36.4%)  7 (63.6%)  0.85 [0.52;1.37]  0.477  
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Escolaridade

ds %>% select(esc, eb_meem:cc_wcst) %>% 
  compareGroups::compareGroups(esc ~ ., 
                               byrow = T,
                               riskratio = T,
                               data = .) %>% 
  compareGroups::createTable(., 
                             show.ratio = TRUE,
                             show.p.overall = F)
## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect
## 
## --------Summary descriptives table by 'esc'---------
## 
## ____________________________________________________________ 
##                   0          1             RR        p.ratio 
##                  N=24       N=27                             
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## eb_meem:                                                     
##     0         8 (40.0%)  12 (60.0%)       Ref.        Ref.   
##     1         16 (51.6%) 15 (48.4%) 0.81 [0.48;1.34]  0.437  
## ep_rivermead:                                                
##     0         8 (29.6%)  19 (70.4%)       Ref.        Ref.   
##     1         16 (66.7%) 8 (33.3%)  0.47 [0.26;0.88]  0.010  
## wais_ep_vocb:                                                
##     0         17 (40.5%) 25 (59.5%)       Ref.        Ref.   
##     1         7 (77.8%)  2 (22.2%)  0.37 [0.11;1.30]  0.054  
## wais_ep_dig:                                                 
##     0         20 (43.5%) 26 (56.5%)       Ref.        Ref.   
##     1         4 (80.0%)  1 (20.0%)  0.35 [0.06;2.08]  0.158  
## wais_ep_cub:                                                 
##     0         16 (39.0%) 25 (61.0%)       Ref.        Ref.   
##     1         8 (80.0%)  2 (20.0%)  0.33 [0.09;1.16]  0.026  
## cc_wcst:                                                     
##     0         20 (50.0%) 20 (50.0%)       Ref.        Ref.   
##     1         4 (36.4%)  7 (63.6%)  1.27 [0.74;2.19]  0.450  
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯