RELATIONSHIP BETWEEN DIABETIC PERIPHERAL NEUROPATHY AND COGNITIVE FUNCTIONS

2024-01-26

Loading the libraries

library(gtsummary)
library(tidyverse)
library(corrr)
library(ggpubr)
library(flextable)
library(gt)
library(scales)
library(xtable)
library(pillar)
library(kableExtra)
library(paletteer)
library(ggthemes)
library(ggsci)
library(hrbrthemes)
library(easystats)
library(reshape2)

Baseline characteristics

Exploratory statistics 1

## Baseline characteristics
df_clinical %>% 
    select(Age, Sex, Weight, Height, BMI, `Duration of illness`) %>% 
    tbl_summary(                        
        type = list(all_continuous() ~ "continuous2"), 
        
        statistic = list(                 
            all_continuous() ~ c("{min} - {max}",
                                 "{mean} (±{sd})",
                                 "{median} ({p25}, {p75})"), 
            all_categorical() ~ "{n} ({p}%)"
        ),
        digits = list(all_categorical() ~ c(0, 1))
    ) %>% 
    modify_footnote(update = everything() ~ NA) 
Characteristic N = 50
Age
    Range 46.0 - 59.0
    Mean (±SD) 51.6 (±3.5)
    Median (IQR) 52.0 (48.0, 53.8)
Sex
    female 26 (52.0%)
    male 24 (48.0%)
Weight
    Range 61 - 107
    Mean (±SD) 88 (±10)
    Median (IQR) 89 (83, 94)
Height
    Range 154 - 180
    Mean (±SD) 167 (±8)
    Median (IQR) 169 (162, 174)
BMI
    Range 23.90 - 34.70
    Mean (±SD) 31.07 (±2.34)
    Median (IQR) 31.60 (29.73, 32.68)
Duration of illness
    Range 10.00 - 24.00
    Mean (±SD) 15.54 (±3.05)
    Median (IQR) 15.00 (13.00, 18.00)

Exploratory statistics 2

stats <- c("Mean (SD)" = "{mean} ({sd})", 
           "(IQR)" = "({p25}, {p75})", 
           "Range" = "{min}, {max}")


imap(
  stats,
  ~ df_clinical %>%
    select(Age, Weight, Height, BMI, `Duration of illness`) %>% 
    tbl_summary(missing = "no", statistic = ~.x)  %>%
    modify_header(all_stat_cols() ~ stringr::str_glue("**{.y}**"))
) %>%
  tbl_merge(tab_spanner = FALSE) %>%
  modify_footnote(~NA) 
Characteristic Mean (SD) (IQR) Range
Age 51.6 (3.5) (48.0, 53.8) 46.0, 59.0
Weight 88 (10) (83, 94) 61, 107
Height 167 (8) (162, 174) 154, 180
BMI 31.07 (2.34) (29.73, 32.68) 23.90, 34.70
Duration of illness 15.54 (3.05) (13.00, 18.00) 10.00, 24.00

Duration of illness

Correlation between Duration of illness and MoCa score

cor.test(df_clinical$`Duration of illness`, df_clinical$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_clinical$`Duration of
## illness` and df_clinical$moca is negative, statistically significant, and very
## large (r = -0.77, 95% CI [-0.86, -0.63], t(48) = -8.42, p < .001)

Scatter plot between Baseline characteristics and MoCa score

sn <- 
    as.data.frame(df_clinical) %>%
    select(Age, BMI, `Duration of illness`, moca) %>% 
    melt(id.vars  = "moca") %>% 
    ggscatter(x= "value",
              y = "moca",
              color = "variable",
              palette = "jama",
              add = "reg.line",
              conf.int = TRUE,
              ylab = "MoCa score",
              xlab = " ",
              ggtheme = theme_light(),
              legend = "top",
              title = "Relationship between Age, BMI, Duration of illness and MoCa score"
    )  %>%
    facet(facet.by = "variable",
          scales = "free",
          panel.labs.background =
              list(color = "steelblue", fill = "steelblue", size = 0.5
              )) +
    stat_cor()
g1 <- ggpar(sn, legend.title = " ")
g1

Correlation between baseline charactarestics and MoCa score

cor.test(df_clinical$Age, df_clinical$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_clinical$Age and
## df_clinical$moca is negative, statistically not significant, and small (r =
## -0.15, 95% CI [-0.41, 0.14], t(48) = -1.04, p = 0.302)
cor.test(df_clinical$BMI, df_clinical$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_clinical$BMI and
## df_clinical$moca is positive, statistically not significant, and small (r =
## 0.20, 95% CI [-0.09, 0.45], t(48) = 1.39, p = 0.169)
cor.test(df_clinical$`Duration of illness`, df_clinical$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_clinical$`Duration of
## illness` and df_clinical$moca is negative, statistically significant, and very
## large (r = -0.77, 95% CI [-0.86, -0.63], t(48) = -8.42, p < .001)

Stratified table by Motor or sensory and nerve

df %>% 
    select(Amplitude, latency, CV, type, nerve) %>%
    tbl_strata(
        strata = type,
        .tbl_fun =
            ~ .x %>%
            tbl_summary(
                by = nerve,
                type = list(all_continuous() ~ "continuous2"), 
                label = list(                
                    CV ~ "Conduction Velocity",
                    latency ~ "Latency"
                ),
                statistic = list(                 
                    all_continuous() ~ c("{min} - {max}",
                                         "{mean} (±{sd})",
                                         "{median} ({p25}, {p75})"
                                         ), 
                    all_categorical() ~ "{n} ({p}%)"
                ),
                digits = list(all_categorical() ~ c(0, 1)),
                missing_text = "No Response"
            ) %>% 
            modify_footnote(update = everything() ~ NA) %>% 
            modify_header(all_stat_cols() ~ "**{level}**")
    ) 
Characteristic Motor sensory
Rt common peroneal Rt ulnar Rt sural Rt ulnar
Amplitude
    Range 1.10 - 1.90 3.50 - 10.00 1.50 - 5.60 6.10 - 9.70
    Mean (±SD) 1.63 (±0.21) 6.06 (±1.40) 3.96 (±1.02) 8.40 (±0.72)
    Median (IQR) 1.70 (1.50, 1.80) 5.60 (5.30, 6.80) 4.00 (3.40, 4.70) 8.45 (7.93, 8.95)
    No Response 8 0
Latency
    Range 5.50 - 7.30 3.10 - 4.40 4.30 - 5.30 3.60 - 4.70
    Mean (±SD) 6.41 (±0.40) 3.65 (±0.29) 4.59 (±0.25) 3.92 (±0.27)
    Median (IQR) 6.40 (6.23, 6.60) 3.70 (3.40, 3.80) 4.50 (4.40, 4.70) 3.85 (3.70, 4.10)
    No Response 8 0
Conduction Velocity
    Range 33.0 - 49.0 38.0 - 54.0 31.0 - 40.0 36.0 - 52.0
    Mean (±SD) 38.6 (±4.1) 46.4 (±4.1) 36.9 (±2.0) 46.2 (±3.2)
    Median (IQR) 37.5 (36.0, 40.0) 46.0 (44.0, 49.8) 37.0 (36.0, 38.0) 46.0 (44.0, 48.0)
    No Response 8 0

Characteristics of sensory nerves measurments

## characteristics of sensory
df_sensory %>% 
    select(Amplitude, latency, CV, nerve) %>% 
    tbl_summary(
        by = nerve,
        label = list(
            latency ~ "Peak latency",
            CV ~ "Conduction velocity"
            ),
        type = list(all_continuous() ~ "continuous2"),
        statistic = list(                 
            all_continuous() ~ c("{min} - {max}",
                                 "{mean} (±{sd})",
                                 "{median} ({p25}, {p75})"
                                 ) 
            ),
        missing_text = "No response"
    ) 
Characteristic Rt sural, N = 50 Rt ulnar, N = 50
Amplitude

    Range 1.50 - 5.60 6.10 - 9.70
    Mean (±SD) 3.96 (±1.02) 8.40 (±0.72)
    Median (IQR) 4.00 (3.40, 4.70) 8.45 (7.93, 8.95)
    No response 8 0
Peak latency

    Range 4.30 - 5.30 3.60 - 4.70
    Mean (±SD) 4.59 (±0.25) 3.92 (±0.27)
    Median (IQR) 4.50 (4.40, 4.70) 3.85 (3.70, 4.10)
    No response 8 0
Conduction velocity

    Range 31.0 - 40.0 36.0 - 52.0
    Mean (±SD) 36.9 (±2.0) 46.2 (±3.2)
    Median (IQR) 37.0 (36.0, 38.0) 46.0 (44.0, 48.0)
    No response 8 0

Sensory(1): Ulnar nerve

Ulnar sensory nerve correlation tests

cor.test(df_sensory_ulnar$Amplitude, df_sensory_ulnar$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_sensory_ulnar$Amplitude and
## df_sensory_ulnar$moca is positive, statistically not significant, and medium (r
## = 0.25, 95% CI [-0.03, 0.50], t(48) = 1.80, p = 0.078)
cor.test(df_sensory_ulnar$CV, df_sensory_ulnar$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_sensory_ulnar$CV and
## df_sensory_ulnar$moca is positive, statistically not significant, and medium (r
## = 0.20, 95% CI [-0.08, 0.46], t(48) = 1.45, p = 0.154)
cor.test(df_sensory_ulnar$latency, df_sensory_ulnar$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_sensory_ulnar$latency and
## df_sensory_ulnar$moca is negative, statistically significant, and medium (r =
## -0.29, 95% CI [-0.53, -0.01], t(48) = -2.11, p = 0.041)

Correlation coefficients between MoCa score and different variables

df_sensory_ulnar %>% 
    select(moca,Amplitude, CV, latency) %>% 
    correlate(method = "pearson") %>% 
    focus(moca) %>% 
    mutate(p.value = round(cor_to_p(moca, n = 50)$p, 4))
## # A tibble: 3 × 3
##   term        moca p.value
##   <chr>      <dbl>   <dbl>
## 1 Amplitude  0.252  0.0776
## 2 CV         0.204  0.154 
## 3 latency   -0.291  0.0405

Correlation graphs for sensory ulnar nerve

su <- 
    as.data.frame(df_sensory_ulnar) %>%
    select( Amplitude, CV, latency, moca) %>% 
    melt(id.vars  = "moca") %>% 
    ggscatter(x= "value",
              y = "moca",
              color = "variable",
              palette = "jama",
              add = "reg.line",
              conf.int = TRUE,
              ylab = "MoCa score",
              xlab = " ",
              ggtheme = theme_light(),
              legend = "top",
              title = "Rt. Ulnar Nerve (Sensory)"
    )  %>%
    facet(facet.by = "variable",
          scales = "free",
          panel.labs.background =
              list(color = "steelblue", fill = "steelblue", size = 0.5
              )) +
    stat_cor()
g2 <- ggpar(su, legend.title = " ")
g2

Sensory(2): Sural nerve

Sural sensory nerve correlation tests

cor.test(df_sensory_sural$Amplitude, df_sensory_sural$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_sensory_sural$Amplitude and
## df_sensory_sural$moca is positive, statistically significant, and very large (r
## = 0.87, 95% CI [0.77, 0.93], t(40) = 11.29, p < .001)
cor.test(df_sensory_sural$CV, df_sensory_sural$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_sensory_sural$CV and
## df_sensory_sural$moca is positive, statistically significant, and very large (r
## = 0.46, 95% CI [0.18, 0.67], t(40) = 3.23, p = 0.002)
cor.test(df_sensory_sural$latency, df_sensory_sural$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_sensory_sural$latency and
## df_sensory_sural$moca is negative, statistically significant, and very large (r
## = -0.44, 95% CI [-0.66, -0.16], t(40) = -3.12, p = 0.003)

Correlation coefficients between MoCa score and different variables

df_sensory_sural %>% 
    select(moca,Amplitude, CV, latency) %>% 
    correlate(method = "pearson") %>% 
    focus(moca) %>% 
    mutate(p.value = round(cor_to_p(moca, n = 50)$p, 4))
## # A tibble: 3 × 3
##   term        moca p.value
##   <chr>      <dbl>   <dbl>
## 1 Amplitude  0.872  0     
## 2 CV         0.455  0.0009
## 3 latency   -0.443  0.0013

Correlation graphs for sensory sural nerve

sn <- 
    as.data.frame(df_sensory_sural) %>%
    select( Amplitude, CV, latency, moca) %>% 
    melt(id.vars  = "moca") %>% 
    ggscatter(x= "value",
              y = "moca",
              color = "variable",
              palette = "jama",
              add = "reg.line",
              conf.int = TRUE,
              ylab = "MoCa score",
              xlab = " ",
              ggtheme = theme_light(),
              legend = "top",
              title = "Rt. Sural Nerve (Sensory)"
    )  %>%
    facet(facet.by = "variable",
          scales = "free",
          panel.labs.background =
              list(color = "steelblue", fill = "steelblue", size = 0.5
              )) +
    stat_cor()
g3 <- ggpar(sn, legend.title = " ")
g3

Characteristics of motor nerves

df_motor %>% 
    select(Amplitude, latency, CV, nerve) %>% 
    tbl_summary(
        by = nerve,
        label = list(
            latency ~ "Distance latency",
            CV ~ "Conduction velocity"
        ),
        type = list(all_continuous() ~ "continuous2"),
        statistic = list(                 
            all_continuous() ~ c("{min} - {max}",
                                 "{mean} (±{sd})",
                                 "{median} ({p25}, {p75})"
            ) 
        )
    )
Characteristic Rt common peroneal, N = 50 Rt ulnar, N = 50
Amplitude
    Range 1.10 - 1.90 3.50 - 10.00
    Mean (±SD) 1.63 (±0.21) 6.06 (±1.40)
    Median (IQR) 1.70 (1.50, 1.80) 5.60 (5.30, 6.80)
Distance latency
    Range 5.50 - 7.30 3.10 - 4.40
    Mean (±SD) 6.41 (±0.40) 3.65 (±0.29)
    Median (IQR) 6.40 (6.23, 6.60) 3.70 (3.40, 3.80)
Conduction velocity
    Range 33.0 - 49.0 38.0 - 54.0
    Mean (±SD) 38.6 (±4.1) 46.4 (±4.1)
    Median (IQR) 37.5 (36.0, 40.0) 46.0 (44.0, 49.8)

Motor(1): Common peroneal nerve

Common peroneal nerve correlation tests

cor.test(df_motor_peroneal$Amplitude, df_motor_peroneal$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_motor_peroneal$Amplitude
## and df_motor_peroneal$moca is negative, statistically not significant, and
## medium (r = -0.26, 95% CI [-0.50, 0.02], t(48) = -1.85, p = 0.070)
cor.test(df_motor_peroneal$CV, df_motor_peroneal$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_motor_peroneal$CV and
## df_motor_peroneal$moca is positive, statistically significant, and very large
## (r = 0.44, 95% CI [0.19, 0.64], t(48) = 3.43, p = 0.001)
cor.test(df_motor_peroneal$latency, df_motor_peroneal$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_motor_peroneal$latency and
## df_motor_peroneal$moca is negative, statistically significant, and very large
## (r = -0.67, 95% CI [-0.80, -0.48], t(48) = -6.22, p < .001)

Correlation coefficients between MoCa score and different variables

df_motor_peroneal %>% 
    select(moca,Amplitude, CV, latency) %>% 
    correlate(method = "pearson") %>% 
    focus(moca) %>% 
    mutate(p.value = round(cor_to_p(moca, n = 50)$p, 4)) 
## # A tibble: 3 × 3
##   term        moca p.value
##   <chr>      <dbl>   <dbl>
## 1 Amplitude -0.258  0.0704
## 2 CV         0.444  0.0012
## 3 latency   -0.668  0

Correlation graphs for motor common peroneal nerve

mp <- 
    as.data.frame(df_motor_peroneal) %>%
    select( Amplitude, CV, latency, moca) %>% 
    melt(id.vars  = "moca") %>% 
    ggscatter(x= "value",
              y = "moca",
              color = "variable",
              palette = "jama",
              add = "reg.line",
              conf.int = TRUE,
              ylab = "MoCa score",
              xlab = " ",
              ggtheme = theme_light(),
              legend = "top",
              title = "Rt. Common Peroneal Nerve (Motor)"
    )  %>%
    facet(facet.by = "variable",
          scales = "free",
          panel.labs.background =
              list(color = "steelblue", fill = "steelblue", size = 0.5
              )) +
    stat_cor()
g4 <- ggpar(mp, legend.title = " ")
g4

Motor(2): Ulnar nerve

Ulnar nerve (motor) correlation tests

cor.test(df_motor_ulnar$Amplitude, df_motor_ulnar$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_motor_ulnar$Amplitude and
## df_motor_ulnar$moca is positive, statistically significant, and very large (r =
## 0.77, 95% CI [0.63, 0.86], t(48) = 8.38, p < .001)
cor.test(df_motor_ulnar$CV, df_motor_ulnar$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_motor_ulnar$CV and
## df_motor_ulnar$moca is positive, statistically significant, and very large (r =
## 0.54, 95% CI [0.30, 0.71], t(48) = 4.39, p < .001)
cor.test(df_motor_ulnar$latency, df_motor_ulnar$moca) %>% report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between df_motor_ulnar$latency and
## df_motor_ulnar$moca is negative, statistically significant, and very large (r =
## -0.70, 95% CI [-0.82, -0.52], t(48) = -6.77, p < .001)

Correlation coefficients between MoCa score and different variables

df_motor_ulnar %>% 
    select(moca,Amplitude, CV, latency) %>% 
    correlate(method = "pearson") %>% 
    focus(moca) %>% 
    mutate(p.value = round(cor_to_p(moca, n = 50)$p, 4))
## # A tibble: 3 × 3
##   term        moca p.value
##   <chr>      <dbl>   <dbl>
## 1 Amplitude  0.771  0     
## 2 CV         0.536  0.0001
## 3 latency   -0.699  0

Correlation graphs for motor ulnar nerve

mu <- 
    as.data.frame(df_motor_ulnar) %>%
    select( Amplitude, CV, latency, moca) %>% 
    melt(id.vars  = "moca") %>% 
    ggscatter(x= "value",
              y = "moca",
              color = "variable",
              palette = "jama",
              add = "reg.line",
              conf.int = TRUE,
              ylab = "MoCa score",
              xlab = " ",
              ggtheme = theme_light(),
              legend = "top",
              title = "Rt. Ulnar Nerve (Motor)"
    )  %>%
    facet(facet.by = "variable",
          scales = "free",
          panel.labs.background =
              list(color = "steelblue", fill = "steelblue", size = 0.5
              )) +
    stat_cor()
g5 <-ggpar(mu, legend.title = " ")
g5

Correlation coefficients between MoCa score and different variables

df_clinical %>% 
    select(moca,Age, Weight, Height, BMI, `Duration of illness`) %>% 
    correlate(method = "pearson") %>% 
    focus(moca) %>% 
    mutate(p.value = round(cor_to_p(moca, n = 50)$p, 4)) 
## # A tibble: 5 × 3
##   term                  moca p.value
##   <chr>                <dbl>   <dbl>
## 1 Age                 -0.149   0.302
## 2 Weight               0.206   0.150
## 3 Height               0.176   0.220
## 4 BMI                  0.197   0.169
## 5 Duration of illness -0.772   0