Anemia Manuscript

Author

Dr Samuel Blay Nguah

Importing and cleaning data

Code
df_anemia_ready <- 
    df_anemia %>% 
    janitor::clean_names() %>% 
    rename(
        history = does_the_child_have_a_history_of_the_following_check_all_that_applies,
        history_other = other_medical_history_specify, 
        eat_iron_veges = 
            does_the_child_eat_adequate_iron_rich_foods_regularly_e_g_meat_beans_leafy_vegetables, 
        exbf_4mths_older_chn = was_exclusive_breastfeeding_done_for_at_least_4_months_in_older_children, 
        bld_loss_3mths = recent_blood_loss_past_3_months_before_admission, 
        transfusion_3mths = recent_blood_transfusion_past_3_months_before_admission, 
        deworm_6mths = deworming_within_the_past_6_months_non_applicable_for_children_under_1_year, 
        iron_supp_3mths = iron_supplementation_within_the_past_3_months, 
        adm_clinical_features =clinical_features_at_admission_select_all_that_apply, 
        blood_film_comment = blood_film_comment_check_all_that_applies, 
        anemia_type = type_of_anemia_diagnosed_if_applicable, 
        txn_required = was_blood_transfusion_required,
        picu_required = was_patient_admitted_to_picu, 
        dura_hosp_stay = duration_of_hospital_stay_days, 
        missed_vac_opportunity = in_children_with_missed_immunizations_did_the_child_miss_opportunities_for_immunization_during_previous_admissions_or_opd_consultations, 
        missed_vac_reason = if_missed_vaccination_give_reason_for_incomplete_vaccination_status, 
        missed_vac_opportunity2 = for_children_who_have_missed_some_vaccinations_did_the_child_also_miss_opportunities_for_immunization_during_previous_admissions, 
        hb = hb_g_dl) %>% 
    mutate(
        age_days = interval(
            date_of_birth, date_of_admission) %/% days(1),
        age_months = interval(
            date_of_birth, date_of_admission) %/% months(1),
        age_years = interval(
            date_of_birth, date_of_admission) %/% years(1),
        across(
            c(gender, maternal_education, paternal_education, residence, 
              iron_supp_3mths, exbf_4mths_older_chn, transfusion_3mths, 
              picu_required, txn_required, rdt),
            ~factor(.)), 
        family_income = factor(
            family_income, 
            levels = c("Low", "Middle", "High")), 
        eat_iron_veges = factor(
            eat_iron_veges, 
            levels = c("No", "Yes")), 
        bld_loss_3mths_2 = case_when(
            bld_loss_3mths == "None" ~ "No", 
            TRUE ~ "Yes") %>% factor(), 
        mal_prev_use = case_when(
            malaria_prevention_measures == "None" ~ "No", 
            TRUE ~ "Yes") %>% factor(),
        malaria_prevention_measures = toupper(
            malaria_prevention_measures),
        mal_prev_itn = case_when(
            str_detect(malaria_prevention_measures, "ITN") ~ "Yes", 
            TRUE ~ "No" ) %>% factor(),
        mal_prev_spray_coil = case_when(
            str_detect(malaria_prevention_measures, "COIL") ~ "Yes", 
            TRUE ~ "No" ) %>% factor(),
        mal_prev_clothes = case_when(
            str_detect(malaria_prevention_measures, "CLOTH") ~ "Yes", 
            TRUE ~ "No" ) %>% factor(), 
        mal_prev_repellent = case_when(
            str_detect(malaria_prevention_measures, "REPELLANT") ~ "Yes", 
            TRUE ~ "No") %>% factor(),
        mps_positive = case_when(
            malaria_parasites == "Positive" ~ "Yes", 
            malaria_parasites == "Negative" ~ "No") %>% 
            factor(), 
        rdt_positive = case_when(
            rdt == "Positive" ~ "Yes", 
            rdt == "Negative" ~ "No") %>% 
            factor(),
        deworm_6mths_2 = factor(
            deworm_6mths, levels = c("No", "Yes")),
        immun_status = case_when(
            immunization_status == "Fully vaccinated for age" ~ "Full",
            immunization_status == "Partially vaccinated for age" ~ 
                "Partial",
            immunization_status == "Not vaccinated" ~ "None") %>% 
            factor(levels = c("Full", "Partial", "None")),
        rbc_transfused = case_when(
            txn_required == "Yes" ~ "Yes", TRUE ~ "No") %>% factor(),
        died = case_when(
            outcome_at_discharge == "Died" ~ "Yes", 
            TRUE ~ "No") %>% factor(),
        anemia_cat = case_when(
            (age_years >= 15 & gender == "Male" & hb < 8) ~ "Severe",
            (age_years >= 15 & gender == "Male" & hb < 11) ~ "Moderate", 
            (age_years >= 15 & gender == "Male" & hb < 13) ~ "Mild", 
            (age_years >= 15 & gender == "Male") ~ "None", 
            (age_years >= 15 & gender == "Female" & hb < 8) ~ "Severe",
            (age_years >= 15 & gender == "Female" & hb < 11) ~ "Moderate", 
            (age_years >= 15 & gender == "Female" & hb < 12) ~ "Mild", 
            (age_years >= 15 & gender == "Female") ~ "None", 
            (age_years >= 12 & hb < 8) ~ "Severe",
            (age_years >= 12 & hb < 11) ~ "Moderate", 
            (age_years >= 12 & hb < 12) ~ "Mild", 
            (age_years >= 12) ~ "None", 
            (age_years >= 5 & hb < 8) ~ "Severe",
            (age_years >= 5 & hb < 11) ~ "Moderate", 
            (age_years >= 5 & hb < 11.5) ~ "Mild", 
            (age_years >= 5) ~ "None", 
            (age_months >= 24 & hb < 7) ~ "Severe",
            (age_months >= 24 & hb < 10) ~ "Moderate", 
            (age_months >= 24 & hb < 11) ~ "Mild", 
            (age_months >= 24) ~ "None", 
            (age_months >= 6 & hb < 7) ~ "Severe",
            (age_months >= 6 & hb < 9.5) ~ "Moderate", 
            (age_months >= 6 & hb < 10.5) ~ "Mild", 
            (age_months >= 6) ~ "None", 
            (age_months >= 1 & hb < 7) ~ "Severe",
            (age_months >= 1 & hb < 9) ~ "Moderate", 
            (age_months >= 1 & hb < 9.5) ~ "Mild", 
            (age_months >= 1) ~ "None") %>% 
            factor(levels = c("None", "Mild", "Moderate", "Severe")), 
        anemia = case_when(
            anemia_cat == "None" ~ "No", 
            anemia_cat %in% c("Mild", "Moderate", "Severe") ~ "Yes") %>% 
            factor(),
        mcv_cat = case_when(
            age_years > 12 & mcv > 96 ~ "Macrocytic", 
            age_years > 12 & mcv >= 80  ~ "Normocytic",
            age_years > 12 & mcv < 80  ~ "Microcytic",
            age_years > 6 & mcv > 90 ~ "Macrocytic", 
            age_years > 6 & mcv >= 78  ~ "Normocytic",
            age_years > 6 & mcv < 78  ~ "Microcytic",
            age_years >= 2 & mcv > 86 ~ "Macrocytic", 
            age_years >= 2 & mcv >= 75  ~ "Normocytic",
            age_years >= 2 & mcv < 75  ~ "Microcytic",
            age_months >= 6 & mcv > 85 ~ "Macrocytic", 
            age_months >= 6 & mcv >= 73  ~ "Normocytic",
            age_months >= 6 & mcv < 73  ~ "Microcytic") %>% 
            factor(levels = c("Microcytic", "Normocytic", "Macrocytic")),
        rdw_cat = case_when(
            (gender == "Male" & age_years > 12 & rdw_cv > 13.5) ~ "High", 
            (gender == "Male" & age_years > 12 & rdw_cv >= 10.9) ~ "Normal",
            (gender == "Male" & age_years > 12 & rdw_cv < 10.9)  ~ "Low",
            (gender == "Female" & age_years > 12 & rdw_cv > 14.6) ~ "High", 
            (gender == "Female" & age_years > 12 & rdw_cv >= 11.9)  ~ 
                "Normal",
            (gender == "Female" & age_years > 12 & rdw_cv < 11.9)  ~ "Low",
            age_years > 6 & rdw_cv > 13.8 ~ "High", 
            age_years > 6 & rdw_cv >= 11.9  ~ "Normal",
            age_years > 6 & rdw_cv < 11.9  ~ "Low",
            age_years >= 2 & rdw_cv > 14.6 ~ "High", 
            age_years >= 2 & rdw_cv >= 12.0  ~ "Normal",
            age_years >= 2 & rdw_cv < 12.0  ~ "Low",
            age_months >= 6 & rdw_cv > 15.6 ~ "High", 
            age_months >= 6 & rdw_cv >= 12.3  ~ "Normal",
            age_months >= 6 & rdw_cv < 12.3  ~ "Low") %>% 
            factor(levels = c("Low", "Normal", "High")) %>% 
            fct_recode("Normal" = "Low"),
        bld_film_done = case_when(
            is.na(blood_film_comment) ~ "No", 
            TRUE ~ "Yes") %>% factor(),
        bf_ida = case_when(
            str_detect(
                blood_film_comment, "Iron deficiency anemia") ~ "Yes",
            TRUE ~ "No") %>% factor(), 
        bf_scd = case_when(
            str_detect(
                blood_film_comment, "Sickle") ~ "Yes", 
            str_detect(blood_film_comment, "SCD") ~ "Yes",
            TRUE ~ "No") %>% factor(),
        bf_infection = case_when(
            str_detect(
                blood_film_comment, "Infection") ~ "Yes",
            TRUE ~ "No") %>% factor(),
        bf_liver = case_when(
            str_detect(
                blood_film_comment, "Liver") ~ "Yes",
            TRUE ~ "No") %>% factor(),
        bf_renal = case_when(
            str_detect(
                blood_film_comment, "Renal") ~ "Yes",
            TRUE ~ "No") %>% factor(), 
        bf_malignancy = case_when(
            str_detect(
                blood_film_comment, "ALL") ~ "Yes",
            str_detect(
                blood_film_comment, "MALIGNANCY") ~ "Yes",
            TRUE ~ "No") %>% factor(),
        bf_hemolytic = case_when(
            str_detect(
                blood_film_comment, "Hemolytic") ~ "Yes",
            TRUE ~ "No") %>% factor(),
        bf_malaria = case_when(
            str_detect(
                blood_film_comment, "Malaria") ~ "Yes",
            TRUE ~ "No") %>% factor(),
        bf_inflamation = case_when(
            str_detect(
                blood_film_comment, "INFLA") ~ "Yes",
            TRUE ~ "No") %>% factor(), 
        ida = case_when(
            bf_ida == "Yes" ~ "Yes",
            (hb < 10 & rdw_cv > 15 & mcv_cat == "Microcytic") ~ "Yes",
            TRUE ~ "No"),
        malaria = case_when(
            rdt_positive == "Yes" ~ "Yes", 
            mps_positive == "Yes" ~ "Yes",
            bf_malaria == "Yes" ~ "Yes",
            TRUE ~ "No"), 
        history = toupper(history),
        blood_film_comment = toupper(blood_film_comment),
        discharge_diagnosis_list = toupper(discharge_diagnosis_list),
        discharge_diagnosis_upper = toupper(discharge_diagnosis_upper),
        scd = case_when(
            str_detect(history, "SICKLE CELL DISEASE") ~ "Yes", 
            str_detect(history, "SCD") ~ "Yes", 
            str_detect(history_other, "SICKLE CELL DISEASE") ~ "Yes", 
            str_detect(history_other, "SCD") ~ "Yes", 
            str_detect(blood_film_comment, "SICKLE CELL DISEASE") ~ "Yes", 
            str_detect(blood_film_comment, "SCD") ~ "Yes", 
            str_detect(discharge_diagnosis_list, 
                       "SICKLE CELL DISEASE") ~ "Yes", 
            str_detect(discharge_diagnosis_list, "SCD") ~ "Yes", 
            str_detect(discharge_diagnosis_upper, 
                       "SICKLE CELL DISEASE") ~ "Yes", 
            str_detect(discharge_diagnosis_upper, "SCD") ~ "Yes",
            str_detect(anemia_type, "Sickle cell anemia") ~ "Yes",
            TRUE ~ "No"),
        g6pd = case_when(
            str_detect(discharge_diagnosis_list, "G6PD") ~ "Yes", 
            str_detect(discharge_diagnosis_upper, "G6PD") ~ "Yes", 
            str_detect(other_laboratory_findings, "G6PD") ~ "Yes", 
            str_detect(additional_comments, "G6PD") ~ "Yes", 
            TRUE ~ "No"), 
        anemia_of_malig = case_when(
        str_detect(blood_film_comment, "MALIGN") ~ "Yes", 
            TRUE ~ "No"),
        anemia_of_chr_dx = case_when(
            str_detect(blood_film_comment, "CHRONIC") ~ "Yes", 
            TRUE ~ "No"))%>%
    select(!c(column_42, column_43, timestamp))  %>% 
    full_join(df_anemia_diag) %>% 
    mutate(
        across(starts_with("diag_"), ~ifelse(is.na(.x), "No", .x)))
Joining with `by = join_by(study_id)`

Display data

Code
# df_anemia_ready %>% 
#     summarytools::dfSummary(graph.col = F)

Table 1

Code
df_anemia_ready %>% 
    select(
        anemia, rdw_cat, mcv_cat, died, rbc_transfused, immun_status,
        deworm_6mths_2, rdt_positive, mps_positive, mal_prev_use, 
        mal_prev_repellent, mal_prev_clothes,  mal_prev_spray_coil,
        mal_prev_itn, bld_loss_3mths_2, age_months, dura_hosp_stay, 
        picu_required, txn_required, iron_supp_3mths, exbf_4mths_older_chn, 
        eat_iron_veges, family_income,  paternal_education,
        maternal_education, residence,  gender, bld_film_done, bf_ida, 
        bf_scd, bf_infection, bf_liver, bf_renal, bf_malignancy, 
        bf_hemolytic, bf_malaria, bf_inflamation, ida, malaria, scd, 
        g6pd, anemia_of_malig:diag_surgical) %>% 
    gtsummary::tbl_summary(
        by = anemia, 
        digits = list(gtsummary::all_categorical() ~ c(0,1))) %>% 
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**Anemia Present**") %>% 
    gtsummary::add_overall(last = T) %>%
    gtsummary::add_p(
        pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)) %>%
    gtsummary::bold_labels() %>%
    gtsummary::bold_p()
Characteristic
Anemia Present
Overall
N = 3181
p-value2
No
N = 1031
Yes
N = 2151
rdw_cat


<0.001
    Normal 46 (51.1%) 37 (18.2%) 83 (28.3%)
    High 44 (48.9%) 166 (81.8%) 210 (71.7%)
    Unknown 13 12 25
mcv_cat


0.217
    Microcytic 56 (62.2%) 126 (62.1%) 182 (62.1%)
    Normocytic 33 (36.7%) 66 (32.5%) 99 (33.8%)
    Macrocytic 1 (1.1%) 11 (5.4%) 12 (4.1%)
    Unknown 13 12 25
died 8 (7.8%) 22 (10.2%) 30 (9.4%) 0.481
rbc_transfused 2 (1.9%) 74 (34.4%) 76 (23.9%) <0.001
immun_status


0.065
    Full 77 (74.8%) 163 (75.8%) 240 (75.5%)
    Partial 23 (22.3%) 52 (24.2%) 75 (23.6%)
    None 3 (2.9%) 0 (0.0%) 3 (0.9%)
deworm_6mths_2 47 (57.3%) 101 (56.1%) 148 (56.5%) 0.855
    Unknown 21 35 56
rdt_positive 3 (2.9%) 41 (19.1%) 44 (13.8%) <0.001
mps_positive 1 (1.3%) 27 (15.5%) 28 (11.1%) <0.001
    Unknown 25 41 66
mal_prev_use 79 (76.7%) 164 (76.3%) 243 (76.4%) 0.934
mal_prev_repellent 2 (1.9%) 0 (0.0%) 2 (0.6%) 0.104
mal_prev_clothes 1 (1.0%) 1 (0.5%) 2 (0.6%) 0.544
mal_prev_spray_coil 28 (27.2%) 61 (28.4%) 89 (28.0%) 0.825
mal_prev_itn 49 (47.6%) 105 (48.8%) 154 (48.4%) 0.833
bld_loss_3mths_2 6 (5.8%) 31 (14.4%) 37 (11.6%) 0.025
age_months 24 (11, 70) 45 (15, 105) 38 (14, 93) 0.002
dura_hosp_stay 5 (2, 8) 6 (3, 11) 6 (3, 10) 0.024
picu_required 3 (2.9%) 10 (4.7%) 13 (4.1%) 0.559
txn_required


<0.001
    FACTOR 8 CONCENTRATE 0 (0.0%) 1 (0.5%) 1 (0.3%)
    No 101 (98.1%) 138 (64.2%) 239 (75.2%)
    PLATELETS 0 (0.0%) 2 (0.9%) 2 (0.6%)
    Yes 2 (1.9%) 74 (34.4%) 76 (23.9%)
iron_supp_3mths 48 (46.6%) 77 (35.8%) 125 (39.3%) 0.065
exbf_4mths_older_chn 67 (65.0%) 116 (54.0%) 183 (57.5%) 0.061
eat_iron_veges 62 (68.9%) 104 (51.2%) 166 (56.7%) 0.005
    Unknown 13 12 25
family_income


0.007
    Low 59 (57.3%) 158 (73.5%) 217 (68.2%)
    Middle 40 (38.8%) 48 (22.3%) 88 (27.7%)
    High 4 (3.9%) 9 (4.2%) 13 (4.1%)
paternal_education


0.147
    None 9 (8.7%) 35 (16.3%) 44 (13.8%)
    Primary 31 (30.1%) 65 (30.2%) 96 (30.2%)
    Secondary 36 (35.0%) 77 (35.8%) 113 (35.5%)
    Tertiary 27 (26.2%) 38 (17.7%) 65 (20.4%)
maternal_education


0.597
    None 8 (7.8%) 24 (11.2%) 32 (10.1%)
    Primary 41 (39.8%) 89 (41.4%) 130 (40.9%)
    Secondary 33 (32.0%) 69 (32.1%) 102 (32.1%)
    Tertiary 21 (20.4%) 33 (15.3%) 54 (17.0%)
residence


0.209
    Rural 36 (35.0%) 91 (42.3%) 127 (39.9%)
    Urban 67 (65.0%) 124 (57.7%) 191 (60.1%)
gender


0.744
    Female 48 (46.6%) 96 (44.7%) 144 (45.3%)
    Male 55 (53.4%) 119 (55.3%) 174 (54.7%)
bld_film_done 4 (3.9%) 106 (49.3%) 110 (34.6%) <0.001
bf_ida 2 (1.9%) 52 (24.2%) 54 (17.0%) <0.001
bf_scd 0 (0.0%) 26 (12.1%) 26 (8.2%) <0.001
bf_infection 3 (2.9%) 51 (23.7%) 54 (17.0%) <0.001
bf_liver 1 (1.0%) 14 (6.5%) 15 (4.7%) 0.043
bf_renal 1 (1.0%) 12 (5.6%) 13 (4.1%) 0.068
bf_malignancy 0 (0.0%) 7 (3.3%) 7 (2.2%) 0.101
bf_hemolytic 1 (1.0%) 10 (4.7%) 11 (3.5%) 0.112
bf_malaria 0 (0.0%) 2 (0.9%) 2 (0.6%) >0.999
bf_inflamation 1 (1.0%) 8 (3.7%) 9 (2.8%) 0.280
ida 2 (1.9%) 94 (43.7%) 96 (30.2%) <0.001
malaria 3 (2.9%) 43 (20.0%) 46 (14.5%) <0.001
scd 2 (1.9%) 41 (19.1%) 43 (13.5%) <0.001
g6pd 0 (0.0%) 10 (4.7%) 10 (3.1%) 0.034
anemia_of_malig 0 (0.0%) 4 (1.9%) 4 (1.3%) 0.309
anemia_of_chr_dx 0 (0.0%) 2 (0.9%) 2 (0.6%) >0.999
diag_appendicitis 1 (1.0%) 2 (0.9%) 3 (0.9%) >0.999
diag_asthma 2 (1.9%) 0 (0.0%) 2 (0.6%) 0.104
diag_bronchiolitis 3 (2.9%) 2 (0.9%) 5 (1.6%) 0.334
diag_gastroenteritis 16 (15.5%) 10 (4.7%) 26 (8.2%) <0.001
diag_Liver_pathology 0 (0.0%) 7 (3.3%) 7 (2.2%) 0.101
diag_nephropathy 2 (1.9%) 17 (7.9%) 19 (6.0%) 0.036
diag_malaria 1 (1.0%) 22 (10.2%) 23 (7.2%) 0.003
diag_sepsis 5 (4.9%) 35 (16.3%) 40 (12.6%) 0.004
diag_urti 4 (3.9%) 3 (1.4%) 7 (2.2%) 0.219
diag_lrti 5 (4.9%) 26 (12.1%) 31 (9.7%) 0.042
diag_cardiac 17 (16.5%) 4 (1.9%) 21 (6.6%) <0.001
diag_malignancy 5 (4.9%) 14 (6.5%) 19 (6.0%) 0.560
diag_others 11 (10.7%) 14 (6.5%) 25 (7.9%) 0.196
diag_cns 13 (12.6%) 19 (8.8%) 32 (10.1%) 0.294
diag_poison 3 (2.9%) 6 (2.8%) 9 (2.8%) >0.999
diag_dka 1 (1.0%) 2 (0.9%) 3 (0.9%) >0.999
diag_g6pd 0 (0.0%) 2 (0.9%) 2 (0.6%) >0.999
diag_rbc_abnormalities 3 (2.9%) 38 (17.7%) 41 (12.9%) <0.001
diag_hiv 1 (1.0%) 8 (3.7%) 9 (2.8%) 0.280
diag_surgical 11 (10.7%) 8 (3.7%) 19 (6.0%) 0.014
1 n (%); Median (Q1, Q3)
2 Pearson’s Chi-squared test; Fisher’s exact test; Wilcoxon rank sum test

Table 2

Code
df_anemia_ready %>% 
    gtsummary::tbl_cross(
        row = rdw_cat,
        col = mcv_cat,
        missing = "no",
        percent = "row",
        digits = c(0,1)) %>% 
    gtsummary::bold_labels()
mcv_cat
Total
Microcytic Normocytic Macrocytic
rdw_cat



    Normal 43 (51.8%) 38 (45.8%) 2 (2.4%) 83 (100.0%)
    High 139 (66.2%) 61 (29.0%) 10 (4.8%) 210 (100.0%)
Total 182 (62.1%) 99 (33.8%) 12 (4.1%) 293 (100.0%)

Table 3

Code
df_anemia_ready %>% 
    select(
        anemia, rdw_cat, mcv_cat, died, rbc_transfused, immun_status,
        deworm_6mths_2, rdt_positive, mps_positive, mal_prev_use, 
        mal_prev_repellent, mal_prev_clothes,  mal_prev_spray_coil,
        mal_prev_itn, bld_loss_3mths_2, age_months, dura_hosp_stay, 
        picu_required, txn_required, iron_supp_3mths, exbf_4mths_older_chn, 
        eat_iron_veges, family_income,  paternal_education,
        maternal_education, residence,  gender, bld_film_done, bf_ida, 
        bf_scd, bf_infection, bf_liver, bf_renal, bf_malignancy, 
        bf_hemolytic, bf_malaria, bf_inflamation, ida, malaria, scd, 
        g6pd, anemia_of_malig:diag_surgical) %>% 
    gtsummary::tbl_summary(
        by =  rbc_transfused, 
        digits = list(gtsummary::all_categorical() ~ c(0,1))) %>% 
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**Transfusion Done**") %>% 
    gtsummary::add_overall(last = T) %>%
    gtsummary::add_p(
        pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)) %>%
    gtsummary::bold_labels() %>%
    gtsummary::bold_p()
Characteristic
Transfusion Done
Overall
N = 3181
p-value2
No
N = 2421
Yes
N = 761
anemia 141 (58.3%) 74 (97.4%) 215 (67.6%) <0.001
rdw_cat


<0.001
    Normal 75 (33.8%) 8 (11.3%) 83 (28.3%)
    High 147 (66.2%) 63 (88.7%) 210 (71.7%)
    Unknown 20 5 25
mcv_cat


0.118
    Microcytic 141 (63.5%) 41 (57.7%) 182 (62.1%)
    Normocytic 75 (33.8%) 24 (33.8%) 99 (33.8%)
    Macrocytic 6 (2.7%) 6 (8.5%) 12 (4.1%)
    Unknown 20 5 25
died 20 (8.3%) 10 (13.2%) 30 (9.4%) 0.203
immun_status


0.330
    Full 178 (73.6%) 62 (81.6%) 240 (75.5%)
    Partial 61 (25.2%) 14 (18.4%) 75 (23.6%)
    None 3 (1.2%) 0 (0.0%) 3 (0.9%)
deworm_6mths_2 115 (59.0%) 33 (49.3%) 148 (56.5%) 0.166
    Unknown 47 9 56
rdt_positive 24 (9.9%) 20 (26.3%) 44 (13.8%) <0.001
mps_positive 18 (9.9%) 10 (14.3%) 28 (11.1%) 0.320
    Unknown 60 6 66
mal_prev_use 190 (78.5%) 53 (69.7%) 243 (76.4%) 0.116
mal_prev_repellent 2 (0.8%) 0 (0.0%) 2 (0.6%) >0.999
mal_prev_clothes 1 (0.4%) 1 (1.3%) 2 (0.6%) 0.421
mal_prev_spray_coil 68 (28.1%) 21 (27.6%) 89 (28.0%) 0.937
mal_prev_itn 122 (50.4%) 32 (42.1%) 154 (48.4%) 0.206
bld_loss_3mths_2 25 (10.3%) 12 (15.8%) 37 (11.6%) 0.195
age_months 35 (12, 84) 55 (21, 116) 38 (14, 93) 0.038
dura_hosp_stay 5 (2, 8) 8 (4, 16) 6 (3, 10) <0.001
picu_required 8 (3.3%) 5 (6.6%) 13 (4.1%) 0.201
txn_required


<0.001
    FACTOR 8 CONCENTRATE 1 (0.4%) 0 (0.0%) 1 (0.3%)
    No 239 (98.8%) 0 (0.0%) 239 (75.2%)
    PLATELETS 2 (0.8%) 0 (0.0%) 2 (0.6%)
    Yes 0 (0.0%) 76 (100.0%) 76 (23.9%)
iron_supp_3mths 98 (40.5%) 27 (35.5%) 125 (39.3%) 0.439
exbf_4mths_older_chn 144 (59.5%) 39 (51.3%) 183 (57.5%) 0.208
eat_iron_veges 134 (60.6%) 32 (44.4%) 166 (56.7%) 0.016
    Unknown 21 4 25
family_income


0.019
    Low 157 (64.9%) 60 (78.9%) 217 (68.2%)
    Middle 76 (31.4%) 12 (15.8%) 88 (27.7%)
    High 9 (3.7%) 4 (5.3%) 13 (4.1%)
paternal_education


0.254
    None 31 (12.8%) 13 (17.1%) 44 (13.8%)
    Primary 68 (28.1%) 28 (36.8%) 96 (30.2%)
    Secondary 90 (37.2%) 23 (30.3%) 113 (35.5%)
    Tertiary 53 (21.9%) 12 (15.8%) 65 (20.4%)
maternal_education


0.369
    None 23 (9.5%) 9 (11.8%) 32 (10.1%)
    Primary 96 (39.7%) 34 (44.7%) 130 (40.9%)
    Secondary 77 (31.8%) 25 (32.9%) 102 (32.1%)
    Tertiary 46 (19.0%) 8 (10.5%) 54 (17.0%)
residence


0.212
    Rural 92 (38.0%) 35 (46.1%) 127 (39.9%)
    Urban 150 (62.0%) 41 (53.9%) 191 (60.1%)
gender


0.877
    Female 109 (45.0%) 35 (46.1%) 144 (45.3%)
    Male 133 (55.0%) 41 (53.9%) 174 (54.7%)
bld_film_done 62 (25.6%) 48 (63.2%) 110 (34.6%) <0.001
bf_ida 39 (16.1%) 15 (19.7%) 54 (17.0%) 0.463
bf_scd 11 (4.5%) 15 (19.7%) 26 (8.2%) <0.001
bf_infection 28 (11.6%) 26 (34.2%) 54 (17.0%) <0.001
bf_liver 6 (2.5%) 9 (11.8%) 15 (4.7%) 0.002
bf_renal 6 (2.5%) 7 (9.2%) 13 (4.1%) 0.017
bf_malignancy 4 (1.7%) 3 (3.9%) 7 (2.2%) 0.364
bf_hemolytic 6 (2.5%) 5 (6.6%) 11 (3.5%) 0.141
bf_malaria 1 (0.4%) 1 (1.3%) 2 (0.6%) 0.421
bf_inflamation 4 (1.7%) 5 (6.6%) 9 (2.8%) 0.039
ida 57 (23.6%) 39 (51.3%) 96 (30.2%) <0.001
malaria 26 (10.7%) 20 (26.3%) 46 (14.5%) <0.001
scd 23 (9.5%) 20 (26.3%) 43 (13.5%) <0.001
g6pd 5 (2.1%) 5 (6.6%) 10 (3.1%) 0.063
anemia_of_malig 3 (1.2%) 1 (1.3%) 4 (1.3%) >0.999
anemia_of_chr_dx 0 (0.0%) 2 (2.6%) 2 (0.6%) 0.057
diag_appendicitis 3 (1.2%) 0 (0.0%) 3 (0.9%) >0.999
diag_asthma 2 (0.8%) 0 (0.0%) 2 (0.6%) >0.999
diag_bronchiolitis 5 (2.1%) 0 (0.0%) 5 (1.6%) 0.343
diag_gastroenteritis 26 (10.7%) 0 (0.0%) 26 (8.2%) 0.003
diag_Liver_pathology 4 (1.7%) 3 (3.9%) 7 (2.2%) 0.364
diag_nephropathy 13 (5.4%) 6 (7.9%) 19 (6.0%) 0.412
diag_malaria 14 (5.8%) 9 (11.8%) 23 (7.2%) 0.075
diag_sepsis 24 (9.9%) 16 (21.1%) 40 (12.6%) 0.011
diag_urti 6 (2.5%) 1 (1.3%) 7 (2.2%) >0.999
diag_lrti 17 (7.0%) 14 (18.4%) 31 (9.7%) 0.003
diag_cardiac 19 (7.9%) 2 (2.6%) 21 (6.6%) 0.110
diag_malignancy 11 (4.5%) 8 (10.5%) 19 (6.0%) 0.091
diag_others 24 (9.9%) 1 (1.3%) 25 (7.9%) 0.015
diag_cns 29 (12.0%) 3 (3.9%) 32 (10.1%) 0.042
diag_poison 9 (3.7%) 0 (0.0%) 9 (2.8%) 0.121
diag_dka 3 (1.2%) 0 (0.0%) 3 (0.9%) >0.999
diag_g6pd 1 (0.4%) 1 (1.3%) 2 (0.6%) 0.421
diag_rbc_abnormalities 21 (8.7%) 20 (26.3%) 41 (12.9%) <0.001
diag_hiv 7 (2.9%) 2 (2.6%) 9 (2.8%) >0.999
diag_surgical 18 (7.4%) 1 (1.3%) 19 (6.0%) 0.053
1 n (%); Median (Q1, Q3)
2 Pearson’s Chi-squared test; Fisher’s exact test; Wilcoxon rank sum test

Table 4

Code
df_anemia_ready %>% 
    select(
        anemia, rdw_cat, mcv_cat, died, rbc_transfused, immun_status,
        deworm_6mths_2, rdt_positive, mps_positive, mal_prev_use, 
        mal_prev_repellent, mal_prev_clothes,  mal_prev_spray_coil,
        mal_prev_itn, bld_loss_3mths_2, age_months, dura_hosp_stay, 
        picu_required, txn_required, iron_supp_3mths, exbf_4mths_older_chn, 
        eat_iron_veges, family_income,  paternal_education,
        maternal_education, residence,  gender, bld_film_done, bf_ida, 
        bf_scd, bf_infection, bf_liver, bf_renal, bf_malignancy, 
        bf_hemolytic, bf_malaria, bf_inflamation, ida, malaria, scd, 
        g6pd, anemia_of_malig:diag_surgical) %>% 
    gtsummary::tbl_summary(
        by =  died, 
        digits = list(gtsummary::all_categorical() ~ c(0,1))) %>% 
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**Died**") %>% 
    gtsummary::add_overall(last = T) %>%
    gtsummary::add_p(
        pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)) %>%
    gtsummary::bold_labels() %>%
    gtsummary::bold_p()
Characteristic
Died
Overall
N = 3181
p-value2
No
N = 2881
Yes
N = 301
anemia 193 (67.0%) 22 (73.3%) 215 (67.6%) 0.481
rdw_cat


0.334
    Normal 78 (29.1%) 5 (20.0%) 83 (28.3%)
    High 190 (70.9%) 20 (80.0%) 210 (71.7%)
    Unknown 20 5 25
mcv_cat


0.044
    Microcytic 172 (64.2%) 10 (40.0%) 182 (62.1%)
    Normocytic 85 (31.7%) 14 (56.0%) 99 (33.8%)
    Macrocytic 11 (4.1%) 1 (4.0%) 12 (4.1%)
    Unknown 20 5 25
rbc_transfused 66 (22.9%) 10 (33.3%) 76 (23.9%) 0.203
immun_status


0.042
    Full 223 (77.4%) 17 (56.7%) 240 (75.5%)
    Partial 62 (21.5%) 13 (43.3%) 75 (23.6%)
    None 3 (1.0%) 0 (0.0%) 3 (0.9%)
deworm_6mths_2 137 (56.8%) 11 (52.4%) 148 (56.5%) 0.692
    Unknown 47 9 56
rdt_positive 41 (14.2%) 3 (10.0%) 44 (13.8%) 0.781
mps_positive 26 (11.5%) 2 (8.0%) 28 (11.1%) >0.999
    Unknown 61 5 66
mal_prev_use 217 (75.3%) 26 (86.7%) 243 (76.4%) 0.165
mal_prev_repellent 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
mal_prev_clothes 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
mal_prev_spray_coil 82 (28.5%) 7 (23.3%) 89 (28.0%) 0.551
mal_prev_itn 135 (46.9%) 19 (63.3%) 154 (48.4%) 0.086
bld_loss_3mths_2 32 (11.1%) 5 (16.7%) 37 (11.6%) 0.369
age_months 42 (14, 94) 18 (8, 45) 38 (14, 93) 0.015
dura_hosp_stay 6 (3, 11) 4 (3, 6) 6 (3, 10) 0.166
picu_required 6 (2.1%) 7 (23.3%) 13 (4.1%) <0.001
txn_required


0.107
    FACTOR 8 CONCENTRATE 1 (0.3%) 0 (0.0%) 1 (0.3%)
    No 220 (76.4%) 19 (63.3%) 239 (75.2%)
    PLATELETS 1 (0.3%) 1 (3.3%) 2 (0.6%)
    Yes 66 (22.9%) 10 (33.3%) 76 (23.9%)
iron_supp_3mths 111 (38.5%) 14 (46.7%) 125 (39.3%) 0.386
exbf_4mths_older_chn 167 (58.0%) 16 (53.3%) 183 (57.5%) 0.624
eat_iron_veges 151 (56.3%) 15 (60.0%) 166 (56.7%) 0.724
    Unknown 20 5 25
family_income


0.874
    Low 195 (67.7%) 22 (73.3%) 217 (68.2%)
    Middle 81 (28.1%) 7 (23.3%) 88 (27.7%)
    High 12 (4.2%) 1 (3.3%) 13 (4.1%)
paternal_education


0.971
    None 40 (13.9%) 4 (13.3%) 44 (13.8%)
    Primary 88 (30.6%) 8 (26.7%) 96 (30.2%)
    Secondary 101 (35.1%) 12 (40.0%) 113 (35.5%)
    Tertiary 59 (20.5%) 6 (20.0%) 65 (20.4%)
maternal_education


0.434
    None 30 (10.4%) 2 (6.7%) 32 (10.1%)
    Primary 121 (42.0%) 9 (30.0%) 130 (40.9%)
    Secondary 89 (30.9%) 13 (43.3%) 102 (32.1%)
    Tertiary 48 (16.7%) 6 (20.0%) 54 (17.0%)
residence


0.429
    Rural 113 (39.2%) 14 (46.7%) 127 (39.9%)
    Urban 175 (60.8%) 16 (53.3%) 191 (60.1%)
gender


0.822
    Female 131 (45.5%) 13 (43.3%) 144 (45.3%)
    Male 157 (54.5%) 17 (56.7%) 174 (54.7%)
bld_film_done 101 (35.1%) 9 (30.0%) 110 (34.6%) 0.579
bf_ida 47 (16.3%) 7 (23.3%) 54 (17.0%) 0.330
bf_scd 26 (9.0%) 0 (0.0%) 26 (8.2%) 0.152
bf_infection 48 (16.7%) 6 (20.0%) 54 (17.0%) 0.644
bf_liver 12 (4.2%) 3 (10.0%) 15 (4.7%) 0.159
bf_renal 11 (3.8%) 2 (6.7%) 13 (4.1%) 0.352
bf_malignancy 6 (2.1%) 1 (3.3%) 7 (2.2%) 0.504
bf_hemolytic 9 (3.1%) 2 (6.7%) 11 (3.5%) 0.278
bf_malaria 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
bf_inflamation 9 (3.1%) 0 (0.0%) 9 (2.8%) >0.999
ida 86 (29.9%) 10 (33.3%) 96 (30.2%) 0.693
malaria 42 (14.6%) 4 (13.3%) 46 (14.5%) >0.999
scd 42 (14.6%) 1 (3.3%) 43 (13.5%) 0.097
g6pd 10 (3.5%) 0 (0.0%) 10 (3.1%) 0.607
anemia_of_malig 3 (1.0%) 1 (3.3%) 4 (1.3%) 0.329
anemia_of_chr_dx 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
diag_appendicitis 3 (1.0%) 0 (0.0%) 3 (0.9%) >0.999
diag_asthma 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
diag_bronchiolitis 5 (1.7%) 0 (0.0%) 5 (1.6%) >0.999
diag_gastroenteritis 26 (9.0%) 0 (0.0%) 26 (8.2%) 0.152
diag_Liver_pathology 3 (1.0%) 4 (13.3%) 7 (2.2%) 0.002
diag_nephropathy 18 (6.3%) 1 (3.3%) 19 (6.0%) >0.999
diag_malaria 22 (7.6%) 1 (3.3%) 23 (7.2%) 0.709
diag_sepsis 31 (10.8%) 9 (30.0%) 40 (12.6%) 0.006
diag_urti 7 (2.4%) 0 (0.0%) 7 (2.2%) >0.999
diag_lrti 28 (9.7%) 3 (10.0%) 31 (9.7%) >0.999
diag_cardiac 20 (6.9%) 1 (3.3%) 21 (6.6%) 0.706
diag_malignancy 15 (5.2%) 4 (13.3%) 19 (6.0%) 0.091
diag_others 22 (7.6%) 3 (10.0%) 25 (7.9%) 0.718
diag_cns 29 (10.1%) 3 (10.0%) 32 (10.1%) >0.999
diag_poison 9 (3.1%) 0 (0.0%) 9 (2.8%) >0.999
diag_dka 3 (1.0%) 0 (0.0%) 3 (0.9%) >0.999
diag_g6pd 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
diag_rbc_abnormalities 40 (13.9%) 1 (3.3%) 41 (12.9%) 0.149
diag_hiv 8 (2.8%) 1 (3.3%) 9 (2.8%) 0.595
diag_surgical 19 (6.6%) 0 (0.0%) 19 (6.0%) 0.235
1 n (%); Median (Q1, Q3)
2 Pearson’s Chi-squared test; Fisher’s exact test; Wilcoxon rank sum test