SPARCo 2 Analysis: Depression

Importing data

Data Preparation

Code
df_sparco_2_clean <-  
    df_sparco_2 %>% 
    select(
        -c(telephone2, consent_sign, participant_name, consent_person, 
          first_name, middle_name, last_name, residential, digital_address,
          social_family_relations, lhimsno, sparco_i_id, telephone1,
          attend_doc)) %>% 
    janitor::remove_empty(which = c("rows", "cols")) %>% 
    rename(
        minimental_state_comp = minimental_state_examination_adolescents_adults_complete,
        demo_comp = demographic_characteristics_complete,
        past_int_hx_comp = past_interim_history_complete,
        opd_visit_outc_comp = outpatient_visit_outcomes_complete,
        goofd_draw_test_comp = goodenough_drawaperson_test_complete,
        stroke_risk_comp = stroke_risk_assessment_adolescents_adults_complete,
        vascular_risk_comp = vascular_risk_factors_assessment_adolescents_adult_complete,
        hamd_comp = hamilton_depression_rating_scale_hamd_adolescents_complete,
        qol_eq5d_comp = quality_of_life_eq5d_adolescents_adults_complete,
        moca_comp = montreal_cognitive_assessment_moca_adolescents_adu_complete,
        ipd_outc_comp = inpatient_visit_outcomes_complete) %>% 
    mutate(
        across(
            c(temp:head_circ, mcv_fl, mch_pg, mchc, neut, 
              plt_103ul, moca_tot_score), 
            ~ifelse(.x < 0, NA, .x)),
        across(c(weight, height), ~as.numeric(.x)),
        across(sex, ~labelled::to_factor(.x)), 
        across(c(weight, height), ~ifelse(.x < 0, NA, .x)), 
        hamd_greater_than_7 = case_when(
            hamd_total >= 8 ~ "Yes", hamd_total < 8 ~ "No") %>% 
            factor(),
        hamd_cat = case_when(
            hamd_total <= 7 ~ "Normal",
            hamd_total <= 17 ~ "Mild",
            hamd_total <= 24 ~ "Moderate",
            hamd_total >= 25 ~ "Severe") %>% 
            factor(levels = c("Normal", "Mild", "Moderate", "Severe")),
        pulse = ifelse(pulse == 878, 87, pulse),
        sat = ifelse(sat >100, 100, sat),
        religion = fct_relevel(religion, "Christian", "Muslim"),
        scd_test_result_ss_sbthal = fct_recode(
            scd_test_result_ss_sbthal, 
            "S-beta thal" = "S-beta thal zero (nought)",
            "S-beta thal" = "S-beta thal plus/minus"),
        scd_test_result_ss_sbthal = fct_na_level_to_value(
            scd_test_result_ss_sbthal,
            extra_levels = "Pending confirmation"),
        res_status = fct_relevel(res_status, "Urban", "Semi-urban"),
        edu_status = fct_relevel(
            edu_status, 
            "Tertiary", "SHS/Vocational", "JHS", "Basic"),
        category_of_patient = fct_relevel(
            category_of_patient,
            "Adult (18+ years)", "Adolescent (10-17 years)", 
            "Child (< 10 years)"),
        cal_age_recruit_yrs_2 = cal_age_recruit_yrs/10)

df_for_depression <- 
    df_sparco_2_clean %>% 
    filter(redcap_event_name == "Enrolment") %>% 
    select(
        hamd_greater_than_7, hamd_cat,
        category_of_patient, cal_age_recruit_yrs,
        cal_age_recruit_mths,cal_age_recruit_yrs_2, sex,
        scd_test_result_ss_sbthal, edu_status, religion, 
        res_status, diag_pathway, using_hydroxyurea, 
        penicillin_v_prophylaxis, folic_acid, 
        temp, pulse, resp_rate, sat, sbp, dbp, wbc_103ul, hb_g_dl,
        rbc_106ul, mcv_fl, mch_pg, mchc, neut, plt_103ul, hamd_total,
        moca_tot_score, eq_5d_health_status) %>% 
    drop_na(hamd_greater_than_7) %>% 
    droplevels()

labelled::var_label(df_for_depression) <- 
    list(
        eq_5d_health_status = "EQ-5D Health Status",
        hamd_cat = "Categorised HAMD",
        hamd_total = "Total HAMD",
        cal_age_recruit_yrs = "Age (years)",
        cal_age_recruit_yrs_2 = "Age(per 10 years)",
        cal_age_recruit_mths = "Age (months)",
        category_of_patient = "Age category",
        sex = "Sex",
        scd_test_result_ss_sbthal = "Genotype", 
        hamd_greater_than_7 = "Depression Status",
        edu_status = "Educational status", 
        religion = "Religion", 
        res_status = "Residential Status", 
        diag_pathway = "Diagnosis Pathway", 
        using_hydroxyurea = "HU Usage", 
        penicillin_v_prophylaxis = "Penicillin Use", 
        folic_acid = "Folic Acid Usage",
        temp = "Temperature", 
        pulse = "Pulse", 
        resp_rate = "Respiratory Rate", 
        sat = "Oxygen Saturation", 
        sbp = "Systolic Blood Pressure (mmHg)", 
        dbp = "Diastolic Blood Pressure (mmHg)", 
        wbc_103ul = "White Bolld Cell Count (10^-3ul)", 
        hb_g_dl = "Hemoglobin (g/dl)" , 
        rbc_106ul = "Red Blood Cells Count (10^-6ul)", 
        mcv_fl = "MCV (fl)", 
        mch_pg = "MCH (pg)", 
        mchc = "MCHC", 
        neut = "Neutrophil count", 
        plt_103ul = "Platelet Count (10^-3ul)",
        moca_tot_score = "Total MOCA Score")

Data Summary

Code
gtsummary::theme_gtsummary_eda()
Setting theme "Exploratory Data Analysis"
Code
gtsummary::theme_gtsummary_compact()
Setting theme "Compact"
Code
df_for_depression %>% 
    gtsummary::tbl_summary(
        digits = gtsummary::all_categorical()~ c(0,1),
        statistic = gtsummary::all_categorical() ~ "{n} ({p})",
        missing_text = "Missing"
        ) %>% 
    gtsummary::bold_labels()  
Characteristic N = 6321
Depression Status 159 (25.2)
Categorised HAMD
    Normal 473 (74.8)
    Mild 131 (20.7)
    Moderate 24 (3.8)
    Severe 4 (0.6)
Age category
    Adult (18+ years) 436 (69.0)
    Adolescent (10-17 years) 184 (29.1)
    Child (< 10 years) 12 (1.9)
Age (years)
    Median (Q1, Q3) 19 (16, 24)
    Mean (SD) 22 (9)
    Min, Max 7, 69
Age (months)
    Median (Q1, Q3) 235 (203, 290)
    Mean (SD) 264 (108)
    Min, Max 94, 834
Age(per 10 years)
    Median (Q1, Q3) 1.90 (1.60, 2.40)
    Mean (SD) 2.16 (0.90)
    Min, Max 0.70, 6.90
Sex
    Male 255 (40.3)
    Female 377 (59.7)
Genotype
    SCD-SS 427 (68.0)
    SCD-SC 196 (31.2)
    S-beta thal 5 (0.8)
    Missing 4
Educational status
    Tertiary 154 (24.4)
    SHS/Vocational 293 (46.4)
    JHS 139 (22.0)
    Basic 41 (6.5)
    None 5 (0.8)
Religion
    Christian 567 (89.7)
    Muslim 64 (10.1)
    None 1 (0.2)
Residential Status
    Urban 431 (68.8)
    Semi-urban 185 (29.6)
    Rural 10 (1.6)
    Missing 6
Diagnosis Pathway
    Non-NSP 344 (54.9)
    NSP 283 (45.1)
    Missing 5
HU Usage 222 (35.5)
    Missing 6
Penicillin Use 433 (68.5)
Folic Acid Usage 613 (97.1)
    Missing 1
Temperature
    Median (Q1, Q3) 36.70 (36.50, 37.00)
    Mean (SD) 36.69 (0.38)
    Min, Max 35.00, 38.00
    Missing 32
Pulse
    Median (Q1, Q3) 82 (74, 92)
    Mean (SD) 84 (14)
    Min, Max 36, 149
    Missing 52
Respiratory Rate
    Median (Q1, Q3) 69 (24, 79)
    Mean (SD) 56 (29)
    Min, Max 15, 134
    Missing 99
Oxygen Saturation
    Median (Q1, Q3) 97.00 (94.00, 98.00)
    Mean (SD) 95.73 (4.29)
    Min, Max 50.00, 100.00
    Missing 87
Systolic Blood Pressure (mmHg)
    Median (Q1, Q3) 110 (103, 119)
    Mean (SD) 112 (13)
    Min, Max 80, 184
    Missing 86
Diastolic Blood Pressure (mmHg)
    Median (Q1, Q3) 65 (60, 72)
    Mean (SD) 66 (11)
    Min, Max 19, 118
    Missing 86
White Bolld Cell Count (10^-3ul)
    Median (Q1, Q3) 9.0 (7.0, 11.3)
    Mean (SD) 9.3 (3.3)
    Min, Max 3.0, 18.0
    Missing 467
Hemoglobin (g/dl)
    Median (Q1, Q3) 8.50 (7.40, 10.00)
    Mean (SD) 8.88 (2.31)
    Min, Max 3.00, 26.00
    Missing 467
Red Blood Cells Count (10^-6ul)
    Median (Q1, Q3) 2.99 (2.38, 3.33)
    Mean (SD) 3.02 (0.97)
    Min, Max 1.00, 9.00
    Missing 467
MCV (fl)
    Median (Q1, Q3) 83 (75, 93)
    Mean (SD) 84 (13)
    Min, Max 28, 115
    Missing 468
MCH (pg)
    Median (Q1, Q3) 29.9 (27.0, 33.6)
    Mean (SD) 30.1 (4.8)
    Min, Max 17.0, 43.4
    Missing 468
MCHC
    Median (Q1, Q3) 36.00 (35.00, 37.00)
    Mean (SD) 35.54 (2.70)
    Min, Max 20.00, 40.00
    Missing 468
Neutrophil count
    Median (Q1, Q3) 4.11 (3.00, 6.00)
    Mean (SD) 5.13 (4.50)
    Min, Max 1.00, 42.00
    Missing 474
Platelet Count (10^-3ul)
    Median (Q1, Q3) 310 (213, 414)
    Mean (SD) 330 (150)
    Min, Max 80, 952
    Missing 468
Total HAMD
    Median (Q1, Q3) 4 (1, 8)
    Mean (SD) 5 (6)
    Min, Max 0, 30
Total MOCA Score
    Median (Q1, Q3) 27 (24, 29)
    Mean (SD) 26 (5)
    Min, Max 0, 30
    Missing 22
EQ-5D Health Status
    Median (Q1, Q3) 80 (70, 95)
    Mean (SD) 81 (17)
    Min, Max 25, 100
    Missing 1
1 n (%)

Table 1

Code
gtsummary::reset_gtsummary_theme()
gtsummary::theme_gtsummary_compact()
Setting theme "Compact"
Code
table_1 <- 
    df_for_depression %>% 
    select(cal_age_recruit_yrs, category_of_patient, sex, 
           scd_test_result_ss_sbthal, hamd_cat,
           edu_status, religion, res_status, diag_pathway, 
           using_hydroxyurea, penicillin_v_prophylaxis, 
           folic_acid, moca_tot_score, eq_5d_health_status) %>% 
    gtsummary::tbl_summary(
        by = hamd_cat,
        digits = list(
            gtsummary::all_categorical() ~ c(0,1),
            gtsummary::all_continuous() ~ 1),
        statistic = list(
        gtsummary::all_categorical() ~ "{n} ({p})")) %>% 
    gtsummary::bold_labels() %>%
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**HAMD Catogory**") %>% 
    gtsummary::add_overall(last = T) %>%
    gtsummary::add_p(
        pvalue_fun = gtsummary::label_style_pvalue(digits = 3),
        test.args = gtsummary::all_tests("fisher.test") ~ list(simulate.p.value = TRUE)) %>% 
    gtsummary::bold_p()

table_1
Characteristic
HAMD Catogory
Overall
N = 6321
p-value2
Normal
N = 4731
Mild
N = 1311
Moderate
N = 241
Severe
N = 41
Age (years) 18.0 (16.0, 23.0) 21.0 (18.0, 25.0) 22.0 (20.0, 29.5) 31.5 (18.0, 50.5) 19.0 (16.0, 24.0) <0.001
Age category




0.017
    Adult (18+ years) 310 (65.5) 102 (77.9) 21 (87.5) 3 (75.0) 436 (69.0)
    Adolescent (10-17 years) 155 (32.8) 25 (19.1) 3 (12.5) 1 (25.0) 184 (29.1)
    Child (< 10 years) 8 (1.7) 4 (3.1) 0 (0.0) 0 (0.0) 12 (1.9)
Sex




0.004
    Male 209 (44.2) 39 (29.8) 6 (25.0) 1 (25.0) 255 (40.3)
    Female 264 (55.8) 92 (70.2) 18 (75.0) 3 (75.0) 377 (59.7)
Genotype




0.080
    SCD-SS 310 (66.1) 93 (71.0) 22 (91.7) 2 (50.0) 427 (68.0)
    SCD-SC 154 (32.8) 38 (29.0) 2 (8.3) 2 (50.0) 196 (31.2)
    S-beta thal 5 (1.1) 0 (0.0) 0 (0.0) 0 (0.0) 5 (0.8)
    Unknown 4 0 0 0 4
Educational status




<0.001
    Tertiary 102 (21.6) 40 (30.5) 12 (50.0) 0 (0.0) 154 (24.4)
    SHS/Vocational 231 (48.8) 54 (41.2) 4 (16.7) 4 (100.0) 293 (46.4)
    JHS 112 (23.7) 23 (17.6) 4 (16.7) 0 (0.0) 139 (22.0)
    Basic 24 (5.1) 14 (10.7) 3 (12.5) 0 (0.0) 41 (6.5)
    None 4 (0.8) 0 (0.0) 1 (4.2) 0 (0.0) 5 (0.8)
Religion




0.047
    Christian 431 (91.1) 114 (87.0) 19 (79.2) 3 (75.0) 567 (89.7)
    Muslim 42 (8.9) 16 (12.2) 5 (20.8) 1 (25.0) 64 (10.1)
    None 0 (0.0) 1 (0.8) 0 (0.0) 0 (0.0) 1 (0.2)
Residential Status




0.903
    Urban 323 (69.0) 88 (67.2) 18 (75.0) 2 (66.7) 431 (68.8)
    Semi-urban 136 (29.1) 42 (32.1) 6 (25.0) 1 (33.3) 185 (29.6)
    Rural 9 (1.9) 1 (0.8) 0 (0.0) 0 (0.0) 10 (1.6)
    Unknown 5 0 0 1 6
Diagnosis Pathway




0.884
    Non-NSP 261 (55.8) 68 (51.9) 13 (54.2) 2 (50.0) 344 (54.9)
    NSP 207 (44.2) 63 (48.1) 11 (45.8) 2 (50.0) 283 (45.1)
    Unknown 5 0 0 0 5
HU Usage 173 (37.0) 39 (30.0) 9 (37.5) 1 (25.0) 222 (35.5) 0.517
    Unknown 5 1 0 0 6
Penicillin Use 336 (71.0) 82 (62.6) 14 (58.3) 1 (25.0) 433 (68.5) 0.045
Folic Acid Usage 456 (96.6) 129 (98.5) 24 (100.0) 4 (100.0) 613 (97.1) 0.599
    Unknown 1 0 0 0 1
Total MOCA Score 27.0 (24.0, 29.0) 26.0 (23.0, 28.0) 26.5 (23.5, 29.0) 22.0 (14.0, 25.0) 27.0 (24.0, 29.0) 0.010
    Unknown 21 1 0 0 22
EQ-5D Health Status 89.0 (80.0, 97.5) 80.0 (60.0, 90.0) 75.0 (50.0, 90.0) 55.0 (40.0, 65.0) 80.0 (70.0, 95.0) <0.001
    Unknown 1 0 0 0 1
1 Median (Q1, Q3); n (%)
2 Kruskal-Wallis rank sum test; Fisher’s Exact Test for Count Data with simulated p-value (based on 2000 replicates)
Code
file.remove("sparco_depression_paper_table_1.docx")
Warning in file.remove("sparco_depression_paper_table_1.docx"): cannot remove
file 'sparco_depression_paper_table_1.docx', reason 'No such file or directory'
[1] FALSE
Code
table_1 %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave(filename = "sparco_depression_paper_table_1.docx")

Table 2

Code
gtsummary::reset_gtsummary_theme()
gtsummary::theme_gtsummary_compact()
Setting theme "Compact"
Code
table_2 <- 
    df_for_depression %>% 
    select(cal_age_recruit_yrs, category_of_patient, sex, 
           scd_test_result_ss_sbthal, hamd_greater_than_7,
           edu_status, religion, res_status, diag_pathway, 
           using_hydroxyurea, penicillin_v_prophylaxis, 
           folic_acid,  moca_tot_score, eq_5d_health_status) %>% 
    gtsummary::tbl_summary(
        by = hamd_greater_than_7,
        digits = list(
            gtsummary::all_categorical() ~ c(0,1),
            gtsummary::all_continuous() ~ 1),
        statistic = list(
        gtsummary::all_categorical() ~ "{n} ({p})")) %>% 
    gtsummary::bold_labels() %>% 
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**Depression**") %>% 
    gtsummary::add_overall(last = T) %>%
    gtsummary::add_p(
        pvalue_fun = gtsummary::label_style_pvalue(digits = 3)) %>% 
    gtsummary::bold_p()

table_2
Characteristic
Depression
Overall
N = 6321
p-value2
No
N = 4731
Yes
N = 1591
Age (years) 18.0 (16.0, 23.0) 21.0 (18.0, 26.0) 19.0 (16.0, 24.0) <0.001
Age category


0.001
    Adult (18+ years) 310 (65.5) 126 (79.2) 436 (69.0)
    Adolescent (10-17 years) 155 (32.8) 29 (18.2) 184 (29.1)
    Child (< 10 years) 8 (1.7) 4 (2.5) 12 (1.9)
Sex


<0.001
    Male 209 (44.2) 46 (28.9) 255 (40.3)
    Female 264 (55.8) 113 (71.1) 377 (59.7)
Genotype


0.134
    SCD-SS 310 (66.1) 117 (73.6) 427 (68.0)
    SCD-SC 154 (32.8) 42 (26.4) 196 (31.2)
    S-beta thal 5 (1.1) 0 (0.0) 5 (0.8)
    Unknown 4 0 4
Educational status


0.002
    Tertiary 102 (21.6) 52 (32.7) 154 (24.4)
    SHS/Vocational 231 (48.8) 62 (39.0) 293 (46.4)
    JHS 112 (23.7) 27 (17.0) 139 (22.0)
    Basic 24 (5.1) 17 (10.7) 41 (6.5)
    None 4 (0.8) 1 (0.6) 5 (0.8)
Religion


0.040
    Christian 431 (91.1) 136 (85.5) 567 (89.7)
    Muslim 42 (8.9) 22 (13.8) 64 (10.1)
    None 0 (0.0) 1 (0.6) 1 (0.2)
Residential Status


0.615
    Urban 323 (69.0) 108 (68.4) 431 (68.8)
    Semi-urban 136 (29.1) 49 (31.0) 185 (29.6)
    Rural 9 (1.9) 1 (0.6) 10 (1.6)
    Unknown 5 1 6
Diagnosis Pathway


0.435
    Non-NSP 261 (55.8) 83 (52.2) 344 (54.9)
    NSP 207 (44.2) 76 (47.8) 283 (45.1)
    Unknown 5 0 5
HU Usage 173 (37.0) 49 (31.0) 222 (35.5) 0.176
    Unknown 5 1 6
Penicillin Use 336 (71.0) 97 (61.0) 433 (68.5) 0.018
Folic Acid Usage 456 (96.6) 157 (98.7) 613 (97.1) 0.268
    Unknown 1 0 1
Total MOCA Score 27.0 (24.0, 29.0) 26.0 (23.0, 29.0) 27.0 (24.0, 29.0) 0.003
    Unknown 21 1 22
EQ-5D Health Status 89.0 (80.0, 97.5) 80.0 (60.0, 90.0) 80.0 (70.0, 95.0) <0.001
    Unknown 1 0 1
1 Median (Q1, Q3); n (%)
2 Wilcoxon rank sum test; Fisher’s exact test; Pearson’s Chi-squared test
Code
file.remove("sparco_depression_paper_table_2.docx")
Warning in file.remove("sparco_depression_paper_table_2.docx"): cannot remove
file 'sparco_depression_paper_table_2.docx', reason 'No such file or directory'
[1] FALSE
Code
table_2 %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave(filename = "sparco_depression_paper_table_2.docx")

Table 3

Code
table_3 <-
    df_for_depression %>% 
    select(
        hamd_greater_than_7, temp, pulse, resp_rate, sat, sbp, 
        dbp, wbc_103ul, hb_g_dl, rbc_106ul, mcv_fl, mch_pg, 
        mchc, neut, plt_103ul) %>% 
    gtsummary::tbl_summary(
        by = hamd_greater_than_7,
        digits = list(
            gtsummary::all_categorical() ~ c(0,1),
            gtsummary::all_continuous() ~ 1),
        statistic = list(
        gtsummary::all_continuous() ~ "{mean} ({sd})"),
        missing_text = "Missing") %>% 
    gtsummary::bold_labels() %>% 
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**Depression**") %>% 
    gtsummary::add_overall(last = T) %>%
    gtsummary::add_p(
        pvalue_fun = gtsummary::label_style_pvalue(digits = 3)) %>% 
    gtsummary::bold_p()

table_3
Characteristic
Depression
Overall
N = 6321
p-value2
No
N = 4731
Yes
N = 1591
Temperature 36.7 (0.4) 36.7 (0.4) 36.7 (0.4) 0.996
    Missing 24 8 32
Pulse 83.4 (14.4) 84.9 (14.6) 83.8 (14.5) 0.372
    Missing 45 7 52
Respiratory Rate 55.4 (29.2) 56.6 (29.1) 55.7 (29.1) 0.886
    Missing 88 11 99
Oxygen Saturation 95.9 (4.2) 95.3 (4.6) 95.7 (4.3) 0.099
    Missing 75 12 87
Systolic Blood Pressure (mmHg) 112.7 (12.0) 109.5 (13.7) 111.8 (12.5) 0.003
    Missing 77 9 86
Diastolic Blood Pressure (mmHg) 65.9 (10.7) 67.0 (11.0) 66.2 (10.7) 0.516
    Missing 77 9 86
White Bolld Cell Count (10^-3ul) 9.3 (3.3) 9.2 (3.2) 9.3 (3.3) 0.821
    Missing 336 131 467
Hemoglobin (g/dl) 8.8 (1.9) 9.4 (3.8) 8.9 (2.3) 0.931
    Missing 336 131 467
Red Blood Cells Count (10^-6ul) 3.0 (0.9) 3.2 (1.4) 3.0 (1.0) 0.757
    Missing 336 131 467
MCV (fl) 84.1 (12.2) 81.6 (14.3) 83.7 (12.6) 0.743
    Missing 337 131 468
MCH (pg) 30.1 (5.0) 29.7 (4.2) 30.1 (4.8) 0.771
    Missing 337 131 468
MCHC 35.8 (1.9) 34.3 (4.8) 35.5 (2.7) 0.229
    Missing 337 131 468
Neutrophil count 5.2 (4.8) 4.7 (2.5) 5.1 (4.5) 0.692
    Missing 340 134 474
Platelet Count (10^-3ul) 328.5 (150.7) 339.8 (151.2) 330.4 (150.4) 0.694
    Missing 337 131 468
1 Mean (SD)
2 Wilcoxon rank sum test
Code
file.remove("sparco_depression_paper_table_3.docx")
Warning in file.remove("sparco_depression_paper_table_3.docx"): cannot remove
file 'sparco_depression_paper_table_3.docx', reason 'No such file or directory'
[1] FALSE
Code
table_3 %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave(filename = "sparco_depression_paper_table_3.docx")

Table 4 - Logistic Regression

Code
tbl_one <- 
    df_for_depression %>% 
    select(
        cal_age_recruit_yrs_2, sex, 
        scd_test_result_ss_sbthal, hamd_greater_than_7,
        edu_status, religion, res_status, diag_pathway, 
        using_hydroxyurea, penicillin_v_prophylaxis, 
        folic_acid, temp, pulse, resp_rate, sat, sbp, 
        dbp, wbc_103ul, hb_g_dl, rbc_106ul, mcv_fl, mch_pg, 
        mchc, neut, plt_103ul, moca_tot_score, eq_5d_health_status) %>% 
gtsummary::tbl_uvregression(
    method = glm,
    y = hamd_greater_than_7,
    method.args = list(family = binomial),
    exponentiate = TRUE,
    pvalue_fun = gtsummary::label_style_pvalue(digits = 3),
    show_single_row = c(using_hydroxyurea, penicillin_v_prophylaxis, 
        folic_acid)) %>% 
    gtsummary::bold_p() %>%
    gtsummary::bold_labels()


tbl_two <- 
    df_for_depression %>% 
    select(
        hamd_greater_than_7, sex, edu_status, 
        penicillin_v_prophylaxis, sbp, eq_5d_health_status) %>% 
    glm(hamd_greater_than_7 ~ ., data = ., family = binomial) %>% 
    gtsummary::tbl_regression(
        exponentiate = T, 
        pvalue_fun = gtsummary::label_style_pvalue(digits = 3),
        show_single_row = c(penicillin_v_prophylaxis)) %>% 
    gtsummary::bold_p()

table_4 <- 
    gtsummary::tbl_merge(
    tbls = list(tbl_one, tbl_two), 
    tab_spanner = c("Univariate", "Multivariate"))

table_4
Characteristic
Univariate
Multivariate
N OR1 95% CI1 p-value OR1 95% CI1 p-value
Age(per 10 years) 632 1.20 0.99, 1.44 0.060


Sex 632





    Male


    Female
1.94 1.33, 2.89 <0.001 2.01 1.32, 3.11 0.001
Genotype 628





    SCD-SS




    SCD-SC
0.72 0.48, 1.07 0.113


    S-beta thal
0.00
0.982


Educational status 632





    Tertiary


    SHS/Vocational
0.53 0.34, 0.82 0.004 0.66 0.41, 1.07 0.089
    JHS
0.47 0.27, 0.80 0.006 0.54 0.29, 0.99 0.049
    Basic
1.39 0.68, 2.80 0.361 2.11 0.93, 4.81 0.073
    None
0.49 0.02, 3.42 0.529 0.73 0.03, 6.47 0.798
Religion 632





    Christian




    Muslim
1.66 0.94, 2.85 0.071


    None
2,469,484 0.00,
0.978


Residential Status 626





    Urban




    Semi-urban
1.08 0.72, 1.59 0.709


    Rural
0.33 0.02, 1.80 0.299


Diagnosis Pathway 627





    Non-NSP




    NSP
1.15 0.80, 1.66 0.435


HU Usage 626 1.30 0.89, 1.93 0.177


Penicillin Use 632 1.57 1.07, 2.28 0.019 1.23 0.80, 1.87 0.344
Folic Acid Usage 631 0.36 0.06, 1.29 0.180


Temperature 600 1.15 0.71, 1.89 0.573


Pulse 580 1.01 0.99, 1.02 0.271


Respiratory Rate 533 1.00 1.0, 1.01 0.663


Oxygen Saturation 545 0.97 0.93, 1.01 0.137


Systolic Blood Pressure (mmHg) 546 0.98 0.96, 0.99 0.008 0.98 0.96, 1.0 0.012
Diastolic Blood Pressure (mmHg) 546 1.01 0.99, 1.03 0.294


White Bolld Cell Count (10^-3ul) 165 0.99 0.87, 1.12 0.852


Hemoglobin (g/dl) 165 1.10 0.93, 1.30 0.231


Red Blood Cells Count (10^-6ul) 165 1.23 0.82, 1.80 0.293


MCV (fl) 164 0.98 0.95, 1.02 0.339


MCH (pg) 164 0.98 0.90, 1.07 0.624


MCHC 164 0.85 0.73, 0.97 0.015


Neutrophil count 158 0.97 0.82, 1.06 0.593


Platelet Count (10^-3ul) 164 1.00 1.00, 1.00 0.717


Total MOCA Score 610 0.97 0.94, 1.01 0.113


EQ-5D Health Status 631 0.97 0.96, 0.98 <0.001 0.97 0.96, 0.98 <0.001
1 OR = Odds Ratio, CI = Confidence Interval
Code
file.remove("sparco_depression_paper_table_4.docx")
[1] FALSE
Code
table_4 %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave(filename = "sparco_depression_paper_table_4.docx")

Table 5: Linear Regression

Code
tbl_one <- 
    df_for_depression %>% 
    select(
        cal_age_recruit_yrs_2, sex, 
        scd_test_result_ss_sbthal, hamd_total,
        edu_status, religion, res_status, diag_pathway, 
        using_hydroxyurea, penicillin_v_prophylaxis, 
        folic_acid, temp, pulse, resp_rate, sat, sbp, 
        dbp, wbc_103ul, hb_g_dl, rbc_106ul, mcv_fl, mch_pg, 
        mchc, neut, plt_103ul, moca_tot_score, eq_5d_health_status) %>% 
gtsummary::tbl_uvregression(
    method = lm,
    y = hamd_total,
    exponentiate = FALSE,
    pvalue_fun = gtsummary::label_style_pvalue(digits = 3), 
    show_single_row = c(using_hydroxyurea, penicillin_v_prophylaxis, 
        folic_acid)) %>% 
    gtsummary::bold_p() %>% 
    gtsummary::bold_labels()

tbl_two <- 
    df_for_depression %>% 
    select(
        hamd_total, sex, edu_status, scd_test_result_ss_sbthal, 
        sbp, cal_age_recruit_yrs_2, eq_5d_health_status) %>% 
    lm(hamd_total ~ ., data = .) %>% 
    gtsummary::tbl_regression(
        exponentiate = F, 
        pvalue_fun = gtsummary::label_style_pvalue(digits = 3)) %>% 
    gtsummary::bold_p() 

table_5 <- 
    gtsummary::tbl_merge(
    tbls = list(tbl_one, tbl_two), 
    tab_spanner = c("Univariate", "Multivariate"))

table_5
Characteristic
Univariate
Multivariate
N Beta 95% CI1 p-value Beta 95% CI1 p-value
Age(per 10 years) 632 0.74 0.27, 1.2 0.002 0.59 0.03, 1.1 0.038
Sex 632





    Male


    Female
1.1 0.25, 2.0 0.012 1.0 0.08, 1.9 0.033
Genotype 628





    SCD-SS


    SCD-SC
-1.2 -2.2, -0.30 0.010 -1.7 -2.7, -0.70 <0.001
    S-beta thal
-2.5 -7.4, 2.3 0.307 -1.5 -6.7, 3.7 0.580
Educational status 632





    Tertiary


    SHS/Vocational
-1.5 -2.6, -0.48 0.005 -0.74 -1.9, 0.38 0.193
    JHS
-2.0 -3.3, -0.75 0.002 -1.6 -3.0, -0.27 0.019
    Basic
0.83 -1.1, 2.7 0.390 2.1 0.09, 4.1 0.041
    None
-0.82 -5.7, 4.1 0.742 0.21 -5.0, 5.5 0.937
Religion 632





    Christian




    Muslim
1.1 -0.28, 2.6 0.116


    None
9.0 -1.8, 20 0.103


Residential Status 626





    Urban




    Semi-urban
0.24 -0.71, 1.2 0.622


    Rural
-2.4 -5.8, 1.1 0.177


Diagnosis Pathway 627





    Non-NSP




    NSP
0.36 -0.52, 1.2 0.425


HU Usage 626 0.62 -0.28, 1.5 0.178


Penicillin Use 632 0.73 -0.20, 1.7 0.125


Folic Acid Usage 631 -2.2 -4.8, 0.43 0.101


Temperature 600 0.79 -0.38, 2.0 0.184


Pulse 580 0.01 -0.02, 0.04 0.639


Respiratory Rate 533 0.01 -0.01, 0.02 0.536


Oxygen Saturation 545 -0.05 -0.16, 0.06 0.414


Systolic Blood Pressure (mmHg) 546 -0.05 -0.09, -0.01 0.013 -0.06 -0.10, -0.02 0.004
Diastolic Blood Pressure (mmHg) 546 0.03 -0.01, 0.08 0.121


White Bolld Cell Count (10^-3ul) 165 -0.08 -0.31, 0.15 0.486


Hemoglobin (g/dl) 165 0.18 -0.14, 0.51 0.261


Red Blood Cells Count (10^-6ul) 165 0.57 -0.20, 1.3 0.144


MCV (fl) 164 -0.03 -0.09, 0.03 0.344


MCH (pg) 164 -0.07 -0.22, 0.09 0.386


MCHC 164 -0.67 -0.93, -0.42 <0.001


Neutrophil count 158 -0.02 -0.18, 0.14 0.817


Platelet Count (10^-3ul) 164 0.00 0.00, 0.01 0.576


Total MOCA Score 610 -0.07 -0.16, 0.02 0.113


EQ-5D Health Status 631 -0.09 -0.12, -0.07 <0.001 -0.09 -0.12, -0.07 <0.001
1 CI = Confidence Interval
Code
file.remove("sparco_depression_paper_table_5.docx")
Warning in file.remove("sparco_depression_paper_table_5.docx"): cannot remove
file 'sparco_depression_paper_table_5.docx', reason 'No such file or directory'
[1] FALSE
Code
table_5 %>%
    gtsummary::as_gt() %>%
    gt::gtsave(filename = "sparco_depression_paper_table_5.docx")