Nana Akua Part II

Author

Samuel Blay Nguah

Load Packages and import data

Data Cleaning and wrangling

Show the code
df_volume <- 
    df_volume %>% 
    rename(
        studyid = num,
        educ = class) %>% 
    mutate(
        educ = case_when(educ == "No" ~ "None", TRUE ~ educ) %>% 
            factor(levels = c("None", "Kindergaten", "Primary", "JHS")),
        hypo_tachycardia = case_when(
            (pulse_rate > 140 & age <= 5) ~ "Yes",
            (pulse_rate > 120 & age <= 12) ~ "Yes", 
            (pulse_rate > 100 & age > 12) ~ "Yes",
            TRUE ~ "No") %>% 
            factor(), 
        hypo_crt = case_when(crt > 2 ~ "Yes", TRUE ~ "No") %>% 
            factor(),
        hypo_sg = case_when(s_g > 1.025 ~ "Yes", TRUE ~ "No") %>% 
            factor(levels = c("No","Yes")), 
        hypo_fena = case_when(fe_na < 1 ~ "Yes", TRUE ~ "No") %>% 
            factor(), 
        hypo_bun_cr = case_when(bun_cr > 20 ~ "Yes", TRUE ~ "No") %>% 
            factor(levels = c("No","Yes")), 
        hypo_ivcci = case_when(ivcci < 50 ~ "Yes", TRUE ~ "No") %>% 
            factor(),
        hypo_bp = case_when(bp == ">95th" ~ "Yes", TRUE ~ "No") %>% 
            factor())

df_volume <- 
    df_volume %>%  
    labelled::set_variable_labels(
    studyid = "Study ID",
    age = "Age (years)",
    sex = "Sex",
    educ = "Education",
    primary_caregiver = "Primary caregiver", 
    religion = "Religion",
    residence = "Residence",
    ethnicity = "Ethnicity",
    case = "Case",
    medication = "Medication",
    pulse_rate = "Pulse Rate",
    crt = "Cap. Refill Time",
    bp = "Blood Pressure",
    weight = "Weight(kgs)",
    height = "Height (cms)",
    proteinuria = "Proteinuria",
    blood_in_urne = "Blood in Urine",
    s_g = "Urine Specific Gravity",
    urea = "Serum urea",
    creatinine = "Serum Creatinine",
    ivcci = "Inferior Vena Cava Collapsibility Index",
    bun_cr = "BUN/Cr Ratio",
    albumin = "Albumin",
    fe_na = "Frac. Excr. of Na",
    hypo_tachycardia = "Tachycardia", 
    hypo_crt = "Prolonged Capillary Time",
    hypo_sg = "High Urine Sp. Gravity", 
    hypo_fena = "Low FeNa",
    hypo_bun_cr = "High BUN/Creat Ratio", 
    hypo_ivcci = "Low IVCCI",
    hypo_bp = "High BP")

Data Summaries

Show the code
gtsummary::theme_gtsummary_eda()
gtsummary::theme_gtsummary_compact()
df_volume %>% 
    gtsummary::tbl_summary() %>% 
    gtsummary::bold_labels()
Characteristic N = 301
Study ID
    Median (Q1, Q3) 16 (8, 23)
    Mean (SD) 16 (9)
    Min, Max 1, 30
Age (years)
    Median (Q1, Q3) 7.0 (5.0, 10.0)
    Mean (SD) 7.4 (3.2)
    Min, Max 2.0, 13.0
Sex
    Female 9 (30.0%)
    Male 21 (70.0%)
Education
    None 2 (6.67%)
    Kindergaten 9 (30.0%)
    Primary 15 (50.0%)
    JHS 4 (13.3%)
Primary caregiver
    Father 8 (26.7%)
    Mother 11 (36.7%)
    Parents 10 (33.3%)
    Uncle 1 (3.33%)
Religion
    Christian 23 (76.7%)
    Muslim 7 (23.3%)
Residence
    Rural 10 (33.3%)
    Urban 20 (66.7%)
Ethnicity
    Akan 17 (56.7%)
    Dagomba 1 (3.33%)
    Ewe 2 (6.67%)
    Frafra 3 (10.0%)
    Ga 1 (3.33%)
    Hausa 5 (16.7%)
    Sissala 1 (3.33%)
Case
    New 23 (76.7%)
    Relapse 7 (23.3%)
Medication
    Amlodipine 1 (3.33%)
    No 28 (93.3%)
    prednisolone 1 (3.33%)
Pulse Rate
    Median (Q1, Q3) 122 (102, 133)
    Mean (SD) 117 (21)
    Min, Max 72, 152
Cap. Refill Time
    2 27 (90.0%)
    3 3 (10.0%)
Blood Pressure
    <95th 13 (43.3%)
    >95th 17 (56.7%)
Weight(kgs)
    Median (Q1, Q3) 29 (25, 35)
    Mean (SD) 30 (9)
    Min, Max 15, 53
Height (cms)
    Median (Q1, Q3) 124 (102, 134)
    Mean (SD) 122 (18)
    Min, Max 87, 159
Proteinuria
    3+ 29 (96.7%)
    4+ 1 (3.33%)
Blood in Urine
    1+ 4 (13.3%)
    2+ 2 (6.67%)
    neg 15 (50.0%)
    trace 9 (30.0%)
Urine Specific Gravity
    1.005 5 (16.7%)
    1.01 8 (26.7%)
    1.015 9 (30.0%)
    1.02 4 (13.3%)
    1.025 4 (13.3%)
Serum urea
    Median (Q1, Q3) 4.20 (3.20, 6.60)
    Mean (SD) 5.73 (4.58)
    Min, Max 1.74, 26.00
Serum Creatinine
    Median (Q1, Q3) 51 (35, 58)
    Mean (SD) 57 (33)
    Min, Max 26, 141
BUN/Cr Ratio
    Median (Q1, Q3) 48 (35, 63)
    Mean (SD) 56 (24)
    Min, Max 30, 116
Frac. Excr. of Na
    Median (Q1, Q3) 0.60 (0.30, 1.30)
    Mean (SD) 0.97 (1.06)
    Min, Max 0.05, 5.00
Albumin
    Median (Q1, Q3) 16.2 (13.9, 18.0)
    Mean (SD) 17.1 (5.2)
    Min, Max 8.8, 29.4
Inferior Vena Cava Collapsibility Index
    Median (Q1, Q3) 60 (55, 74)
    Mean (SD) 60 (19)
    Min, Max 8, 97
Tachycardia 15 (50.0%)
Prolonged Capillary Time 3 (10.0%)
High Urine Sp. Gravity 0 (0%)
Low FeNa 21 (70.0%)
High BUN/Creat Ratio 30 (100.0%)
Low IVCCI 4 (13.3%)
High BP 17 (56.7%)
1 n (%)

Descriptive Statistics

Show the code
gtsummary::reset_gtsummary_theme()
gtsummary::theme_gtsummary_compact()
Setting theme "Compact"
Show the code
df_volume %>% 
    select(-starts_with("hypo")) %>% 
    gtsummary::tbl_summary(
        by = sex,
        digits = list(gtsummary::all_categorical() ~ c(0,1)),
        type = list(s_g ~ "continuous")) %>% 
    gtsummary::bold_labels() %>% 
    gtsummary::add_overall(last = T)
Characteristic Female
N = 91
Male
N = 211
Overall
N = 301
Study ID 17 (12, 23) 15 (8, 22) 16 (8, 23)
Age (years) 6.0 (6.0, 9.0) 7.0 (5.0, 10.0) 7.0 (5.0, 10.0)
Education


    None 2 (22.2%) 0 (0.0%) 2 (6.7%)
    Kindergaten 3 (33.3%) 6 (28.6%) 9 (30.0%)
    Primary 3 (33.3%) 12 (57.1%) 15 (50.0%)
    JHS 1 (11.1%) 3 (14.3%) 4 (13.3%)
Primary caregiver


    Father 2 (22.2%) 6 (28.6%) 8 (26.7%)
    Mother 4 (44.4%) 7 (33.3%) 11 (36.7%)
    Parents 3 (33.3%) 7 (33.3%) 10 (33.3%)
    Uncle 0 (0.0%) 1 (4.8%) 1 (3.3%)
Religion


    Christian 5 (55.6%) 18 (85.7%) 23 (76.7%)
    Muslim 4 (44.4%) 3 (14.3%) 7 (23.3%)
Residence


    Rural 4 (44.4%) 6 (28.6%) 10 (33.3%)
    Urban 5 (55.6%) 15 (71.4%) 20 (66.7%)
Ethnicity


    Akan 3 (33.3%) 14 (66.7%) 17 (56.7%)
    Dagomba 0 (0.0%) 1 (4.8%) 1 (3.3%)
    Ewe 0 (0.0%) 2 (9.5%) 2 (6.7%)
    Frafra 1 (11.1%) 2 (9.5%) 3 (10.0%)
    Ga 1 (11.1%) 0 (0.0%) 1 (3.3%)
    Hausa 3 (33.3%) 2 (9.5%) 5 (16.7%)
    Sissala 1 (11.1%) 0 (0.0%) 1 (3.3%)
Case


    New 7 (77.8%) 16 (76.2%) 23 (76.7%)
    Relapse 2 (22.2%) 5 (23.8%) 7 (23.3%)
Medication


    Amlodipine 0 (0.0%) 1 (4.8%) 1 (3.3%)
    No 9 (100.0%) 19 (90.5%) 28 (93.3%)
    prednisolone 0 (0.0%) 1 (4.8%) 1 (3.3%)
Pulse Rate 120 (106, 132) 123 (98, 133) 122 (102, 133)
Cap. Refill Time


    2 7 (77.8%) 20 (95.2%) 27 (90.0%)
    3 2 (22.2%) 1 (4.8%) 3 (10.0%)
Blood Pressure


    <95th 4 (44.4%) 9 (42.9%) 13 (43.3%)
    >95th 5 (55.6%) 12 (57.1%) 17 (56.7%)
Weight(kgs) 30 (24, 35) 28 (25, 35) 29 (25, 35)
Height (cms) 115 (113, 127) 124 (102, 134) 124 (102, 134)
Proteinuria


    3+ 9 (100.0%) 20 (95.2%) 29 (96.7%)
    4+ 0 (0.0%) 1 (4.8%) 1 (3.3%)
Blood in Urine


    1+ 1 (11.1%) 3 (14.3%) 4 (13.3%)
    2+ 1 (11.1%) 1 (4.8%) 2 (6.7%)
    neg 7 (77.8%) 8 (38.1%) 15 (50.0%)
    trace 0 (0.0%) 9 (42.9%) 9 (30.0%)
Urine Specific Gravity 1.015 (1.010, 1.015) 1.015 (1.010, 1.020) 1.015 (1.010, 1.020)
Serum urea 3.20 (2.70, 9.30) 4.20 (3.80, 6.40) 4.20 (3.20, 6.60)
Serum Creatinine 50 (35, 58) 51 (35, 57) 51 (35, 58)
BUN/Cr Ratio 46 (41, 63) 51 (35, 62) 48 (35, 63)
Frac. Excr. of Na 0.70 (0.40, 0.90) 0.50 (0.30, 1.40) 0.60 (0.30, 1.30)
Albumin 16.1 (13.9, 19.5) 16.3 (13.9, 17.8) 16.2 (13.9, 18.0)
Inferior Vena Cava Collapsibility Index 59 (52, 66) 60 (55, 74) 60 (55, 74)
1 Median (Q1, Q3); n (%)

Objective 1: Proportions of Hypovolemia

Summaries of the criteria

Show the code
df_volume %>% 
    select(starts_with("hypo"), sex) %>% 
    gtsummary::tbl_summary(
        by = sex,
        digits = list(gtsummary::all_categorical() ~ c(0,1))) %>% 
    gtsummary::bold_labels() %>% 
    gtsummary::add_overall(last = T)
Characteristic Female
N = 91
Male
N = 211
Overall
N = 301
Tachycardia 4 (44.4%) 11 (52.4%) 15 (50.0%)
Prolonged Capillary Time 2 (22.2%) 1 (4.8%) 3 (10.0%)
High Urine Sp. Gravity 0 (0.0%) 0 (0.0%) 0 (0.0%)
Low FeNa 7 (77.8%) 14 (66.7%) 21 (70.0%)
High BUN/Creat Ratio 9 (100.0%) 21 (100.0%) 30 (100.0%)
Low IVCCI 1 (11.1%) 3 (14.3%) 4 (13.3%)
High BP 5 (55.6%) 12 (57.1%) 17 (56.7%)
1 n (%)

Graphical depiction with CI

Show the code
df_graph <- 
    df_volume %>% 
    select(starts_with("hypo")) %>%
    pivot_longer(
        cols = hypo_tachycardia:hypo_bp, 
        values_drop_na = T) %>% 
    group_by(name, value) %>% 
    count() %>% 
    pivot_wider(id_cols = name, names_from = value, values_from = n) %>% 
    mutate(
        N = 30,
        n = case_when(is.na(Yes) ~ 0, TRUE ~ Yes)) %>% 
    select(-c(Yes, No)) %>% 
    mutate(xx = epiDisplay::ci.binomial(n, N)) %>% 
    unnest(xx) %>% 
    mutate(
        name = factor(
            name,
            levels = c(
                "hypo_bun_cr", "hypo_fena",  "hypo_bp", 
                "hypo_tachycardia", "hypo_ivcci", "hypo_crt", "hypo_sg"),
            labels = c(
                "BUN/Cr Ratio", "Fractional Excr. Na", 
                "Blood Pressure", "Tachycardia", 
                "IVC Collapsibility Index","Capillary Refill Time",
                "Specific Gravity"))) 

label_x <- 
    df_graph %>%
    arrange(probability) %>% 
    mutate(
        mm = paste0(
            sprintf("%.1f", probability*100), 
            " (",
            sprintf("%.1f", exact.lower95ci*100),
            " to ", 
            sprintf("%.1f", exact.upper95ci*100), 
            ")"))
    
df_graph %>% 
    ggplot(
        aes(
            x = name, y = probability, color = alg, 
            ymin = exact.lower95ci, ymax = exact.upper95ci)) + 
    geom_col(
        fill = "steelblue", 
        color = "steelblue", alpha = 0.4) +
    geom_errorbar(color = "steelblue",  width = 0.15)+
    labs(
        y = "Percentage Hypovolemia(%)", 
        x = NULL)+
    annotate(
        geom = "text", 
        x = 1:7, 
        y = rep(1.05,7), 
        label = rev(label_x$mm), 
        size = 3.5, 
        fontface = "plain", 
        hjust = 0, 
        vjust = 0.5)+
    theme_bw()+
    scale_y_continuous(
        br = seq(0, 1, 0.2), 
        labels = seq(0, 100, 20),
        limits = c(0,1.5), 
        expand = c(0,.01))+
    theme(
       axis.text.x = element_text(
           angle = 90, hjust = 1, vjust = 0.05, 
           face = "italic"))+
    coord_flip()

Objective 2: Relationship between methods

Plot of Criteria

Show the code
df_volume %>% 
    select(s_g, urea, creatinine, bun_cr, fe_na, albumin, ivcci) %>% 
    pivot_longer(cols = c(s_g, urea, creatinine, bun_cr, fe_na, albumin)) %>% 
    ggplot(aes(x = ivcci, y = value)) +
    geom_point()+
    geom_smooth(formula = y~x, method = 'lm')+
    facet_wrap(facets = "name", scales = "free_y")+
    theme_bw()

ICC

Show the code
df_std <- 
    df_volume %>% 
    select(s_g, urea, creatinine, bun_cr, fe_na, albumin, ivcci) %>%
    mutate(across(everything(), scale)) 


library(psych)

s_g <- df_std %>% select(s_g, ivcci) %>% as.matrix() 
fe_na <- df_std %>% select(fe_na, ivcci) %>% as.matrix() 
urea <- df_std %>% select(urea, ivcci) %>% as.matrix() 
creatinine <- df_std %>% select(creatinine, ivcci) %>% as.matrix() 
bun_cr <- df_std %>% select(bun_cr, ivcci) %>% as.matrix() 
albumin <- df_std %>% select(albumin, ivcci) %>% as.matrix() 

s_g <- ICC(s_g, lmer = F)$results[3,c(2,7,8,6)]
fe_na <- ICC(fe_na, lmer = F)$results[3,c(2,7,8,6)]
urea <- ICC(urea, lmer = F)$results[3,c(2,7,8,6)]
creatinine <- ICC(creatinine, lmer = F)$results[3,c(2,7,8,6)]
bun_cr <- ICC(bun_cr, lmer = F)$results[3,c(2,7,8,6)]
albumin <- ICC(albumin, lmer = F)$results[3,c(2,7,8,6)]

rbind(
    "Specific Gravity" = s_g, 
    "Ftactional Excretion of Na" = fe_na, 
    "Urea" = urea, 
    "Creatinine" = creatinine, 
    "BUN/Cr Ratio" = bun_cr, 
    "Albumin" = albumin) %>%
    round(3) %>% as.data.frame() %>% rownames_to_column() %>% 
    gt::gt()
ICC lower bound upper bound p
Specific Gravity -0.217 -0.531 0.149 0.880
Ftactional Excretion of Na -0.071 -0.415 0.292 0.648
Urea -0.221 -0.534 0.146 0.883
Creatinine -0.348 -0.626 0.008 0.972
BUN/Cr Ratio 0.013 -0.344 0.366 0.472
Albumin -0.589 -0.781 -0.296 1.000