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)), 
        age_cat = case_when(
            (age_months >= 3 & age_months <= 5) ~ "3 to 5 months", 
            (age_months >= 6 & age_months <= 23) ~ "6 to 23 months", 
            (age_months >= 24 & age_months <= 59) ~ "24 to 59 months", 
            (age_months >= 60 & age_months <= 143) ~ "5 to 11 years", 
            (age_months >= 144 & age_months <= 179 & gender == "Female") ~ 
                "12 to 14 years(girls)", 
            (age_months >= 144 & age_months <= 179 & gender == "Male") ~ 
                "12 to 14 years(boys)", 
            (age_months >= 180 & gender == "Female") ~ 
                ">= 15 years (girls)",
            (age_months >= 180 & gender == "Male") ~ 
                ">= 15 years (boys)") %>% 
            factor(levels = c(
                "3 to 5 months", "6 to 23 months", "24 to 59 months", 
                "5 to 11 years", "12 to 14 years(girls)", 
                "12 to 14 years(boys)",">= 15 years (girls)", 
                ">= 15 years (boys)")))
Joining with `by = join_by(study_id)`
Code
labelled::var_label(df_anemia_ready) <- 
    list(
        anemia ="Anemia Present", 
        rdw_cat = "Categorised RDW", 
        mcv_cat = "categorised MCV", 
        died = "Patient Died", 
        rbc_transfused = "Transfused Blood", 
        immun_status = "Immunity Status",
        deworm_6mths_2 = "Dewormed in the past 6 months", 
        rdt_positive = "RDT Positive", 
        mps_positive = "Malaria parasites positive", 
        mal_prev_use = "Use of Malatria prevention method", 
        mal_prev_repellent = "Prevention: Repellent", 
        mal_prev_clothes = "Prevention: Clothes",  
        mal_prev_spray_coil = "Prevention: Spray or Coil",
        mal_prev_itn = "Prevention: ITN", 
        bld_loss_3mths_2 = "Blood loss (past 2 months)", 
        age_months = "Age (Months)", 
        dura_hosp_stay = "Duration of Hospital Stay", 
        picu_required = "PICU admision required", 
        txn_required = "Transfusion required", 
        iron_supp_3mths = "Iron supp. past 3 months", 
        exbf_4mths_older_chn = 
            "Exclusive Breastfeeding (4 months) in older child", 
        eat_iron_veges = "Eats iron containing vegetables", 
        family_income = "Family Income",  
        paternal_education = "Father's educational level",
        maternal_education = "Mother's educational level", 
        residence = "Residence type",  
        gender = "Sex", 
        bld_film_done= "Blood film done", 
        bf_ida = "Blood Film: IDA", 
        bf_scd = "Blood Film: SCD", 
        bf_infection = "Blood Film: Infection", 
        bf_liver = "Blood Film: Liver pathology", 
        bf_renal = "Blood Film: Renal pathology", 
        bf_malignancy = "Blood Film: Malignancy", 
        bf_hemolytic = "Blood Film: Hemolysis", 
        bf_malaria = "Blood Film: Malaria", 
        bf_inflamation = "Blood Film: Inflamation", 
        ida = "Iron Defecienvy Anemia", 
        malaria = "Malaria", 
        scd = "Sicle cell Disease", 
        g6pd = "G6PD",
        anemia_of_malig = "Anemia of malignacy", 
        anemia_of_chr_dx = "Anemia of Chronic Disease",
        diag_bronchiolitis = "Diagnosis: Bronchiolitis",
        diag_gastroenteritis = "Diagnosis: Gastroenteritis", 
        diag_Liver_pathology = "Diagnosis: Liver Pathology",
        diag_nephropathy = "Diagnosis: Nephropathy", 
        diag_malaria = "Diagnosis: malaria",
        diag_sepsis = "Diagnosis: Sepsis",
        diag_urti = "Diagnosis: URTI",
        diag_lrti = "Diagnosis: LRTI", 
        diag_cardiac = "Diagnosis: Cardiopathy",
        diag_malignancy = "Diagnosis: malignancy", 
        diag_others = "Diagnosis: Others", 
        diag_cns = "Diagnosis: CNS",
        diag_poison = "Diagnosis: Poisons",
        diag_dka = "Diagnosis: DKA", 
        diag_rbc_abnormalities = "Diagnosis: Hemoglobinopathies",
        diag_hiv = "Diagnosis: HIV", 
        diag_surgical = "Diagnosis: Surgical", 
        age_cat = "Categorised Age")

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
Categorised RDW


<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
categorised MCV


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
Patient Died 8 (7.8%) 22 (10.2%) 30 (9.4%) 0.481
Transfused Blood 2 (1.9%) 74 (34.4%) 76 (23.9%) <0.001
Immunity 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%)
Dewormed in the past 6 months 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
Malaria parasites positive 1 (1.3%) 27 (15.5%) 28 (11.1%) <0.001
    Unknown 25 41 66
Use of Malatria prevention method 79 (76.7%) 164 (76.3%) 243 (76.4%) 0.934
Prevention: Repellent 2 (1.9%) 0 (0.0%) 2 (0.6%) 0.104
Prevention: Clothes 1 (1.0%) 1 (0.5%) 2 (0.6%) 0.544
Prevention: Spray or Coil 28 (27.2%) 61 (28.4%) 89 (28.0%) 0.825
Prevention: ITN 49 (47.6%) 105 (48.8%) 154 (48.4%) 0.833
Blood loss (past 2 months) 6 (5.8%) 31 (14.4%) 37 (11.6%) 0.025
Age (Months) 24 (11, 70) 45 (15, 105) 38 (14, 93) 0.002
Duration of Hospital Stay 5 (2, 8) 6 (3, 11) 6 (3, 10) 0.024
PICU admision required 3 (2.9%) 10 (4.7%) 13 (4.1%) 0.559
Transfusion 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. past 3 months 48 (46.6%) 77 (35.8%) 125 (39.3%) 0.065
Exclusive Breastfeeding (4 months) in older child 67 (65.0%) 116 (54.0%) 183 (57.5%) 0.061
Eats iron containing vegetables 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%)
Father's educational level


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%)
Mother's educational level


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 type


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


0.744
    Female 48 (46.6%) 96 (44.7%) 144 (45.3%)
    Male 55 (53.4%) 119 (55.3%) 174 (54.7%)
Blood film done 4 (3.9%) 106 (49.3%) 110 (34.6%) <0.001
Blood Film: IDA 2 (1.9%) 52 (24.2%) 54 (17.0%) <0.001
Blood Film: SCD 0 (0.0%) 26 (12.1%) 26 (8.2%) <0.001
Blood Film: Infection 3 (2.9%) 51 (23.7%) 54 (17.0%) <0.001
Blood Film: Liver pathology 1 (1.0%) 14 (6.5%) 15 (4.7%) 0.043
Blood Film: Renal pathology 1 (1.0%) 12 (5.6%) 13 (4.1%) 0.068
Blood Film: Malignancy 0 (0.0%) 7 (3.3%) 7 (2.2%) 0.101
Blood Film: Hemolysis 1 (1.0%) 10 (4.7%) 11 (3.5%) 0.112
Blood Film: Malaria 0 (0.0%) 2 (0.9%) 2 (0.6%) >0.999
Blood Film: Inflamation 1 (1.0%) 8 (3.7%) 9 (2.8%) 0.280
Iron Defecienvy Anemia 2 (1.9%) 94 (43.7%) 96 (30.2%) <0.001
Malaria 3 (2.9%) 43 (20.0%) 46 (14.5%) <0.001
Sicle cell Disease 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 malignacy 0 (0.0%) 4 (1.9%) 4 (1.3%) 0.309
Anemia of Chronic Disease 0 (0.0%) 2 (0.9%) 2 (0.6%) >0.999
Diagnosis: Bronchiolitis 5 (4.9%) 2 (0.9%) 7 (2.2%) 0.038
Diagnosis: Gastroenteritis 16 (15.5%) 10 (4.7%) 26 (8.2%) <0.001
Diagnosis: Liver Pathology 0 (0.0%) 7 (3.3%) 7 (2.2%) 0.101
Diagnosis: Nephropathy 2 (1.9%) 17 (7.9%) 19 (6.0%) 0.036
Diagnosis: malaria 1 (1.0%) 22 (10.2%) 23 (7.2%) 0.003
Diagnosis: Sepsis 5 (4.9%) 35 (16.3%) 40 (12.6%) 0.004
Diagnosis: URTI 4 (3.9%) 3 (1.4%) 7 (2.2%) 0.219
Diagnosis: LRTI 5 (4.9%) 26 (12.1%) 31 (9.7%) 0.042
Diagnosis: Cardiopathy 17 (16.5%) 4 (1.9%) 21 (6.6%) <0.001
Diagnosis: malignancy 5 (4.9%) 14 (6.5%) 19 (6.0%) 0.560
Diagnosis: Others 11 (10.7%) 14 (6.5%) 25 (7.9%) 0.196
Diagnosis: CNS 13 (12.6%) 19 (8.8%) 32 (10.1%) 0.294
Diagnosis: Poisons 3 (2.9%) 6 (2.8%) 9 (2.8%) >0.999
Diagnosis: DKA 1 (1.0%) 2 (0.9%) 3 (0.9%) >0.999
Diagnosis: Hemoglobinopathies 3 (2.9%) 40 (18.6%) 43 (13.5%) <0.001
Diagnosis: HIV 1 (1.0%) 8 (3.7%) 9 (2.8%) 0.280
Diagnosis: Surgical 12 (11.7%) 10 (4.7%) 22 (6.9%) 0.021
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()
categorised MCV
Total
Microcytic Normocytic Macrocytic
Categorised RDW



    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 Present 141 (58.3%) 74 (97.4%) 215 (67.6%) <0.001
Categorised RDW


<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
categorised MCV


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
Patient Died 20 (8.3%) 10 (13.2%) 30 (9.4%) 0.203
Immunity 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%)
Dewormed in the past 6 months 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
Malaria parasites positive 18 (9.9%) 10 (14.3%) 28 (11.1%) 0.320
    Unknown 60 6 66
Use of Malatria prevention method 190 (78.5%) 53 (69.7%) 243 (76.4%) 0.116
Prevention: Repellent 2 (0.8%) 0 (0.0%) 2 (0.6%) >0.999
Prevention: Clothes 1 (0.4%) 1 (1.3%) 2 (0.6%) 0.421
Prevention: Spray or Coil 68 (28.1%) 21 (27.6%) 89 (28.0%) 0.937
Prevention: ITN 122 (50.4%) 32 (42.1%) 154 (48.4%) 0.206
Blood loss (past 2 months) 25 (10.3%) 12 (15.8%) 37 (11.6%) 0.195
Age (Months) 35 (12, 84) 55 (21, 116) 38 (14, 93) 0.038
Duration of Hospital Stay 5 (2, 8) 8 (4, 16) 6 (3, 10) <0.001
PICU admision required 8 (3.3%) 5 (6.6%) 13 (4.1%) 0.201
Transfusion 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. past 3 months 98 (40.5%) 27 (35.5%) 125 (39.3%) 0.439
Exclusive Breastfeeding (4 months) in older child 144 (59.5%) 39 (51.3%) 183 (57.5%) 0.208
Eats iron containing vegetables 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%)
Father's educational level


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%)
Mother's educational level


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 type


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


0.877
    Female 109 (45.0%) 35 (46.1%) 144 (45.3%)
    Male 133 (55.0%) 41 (53.9%) 174 (54.7%)
Blood film done 62 (25.6%) 48 (63.2%) 110 (34.6%) <0.001
Blood Film: IDA 39 (16.1%) 15 (19.7%) 54 (17.0%) 0.463
Blood Film: SCD 11 (4.5%) 15 (19.7%) 26 (8.2%) <0.001
Blood Film: Infection 28 (11.6%) 26 (34.2%) 54 (17.0%) <0.001
Blood Film: Liver pathology 6 (2.5%) 9 (11.8%) 15 (4.7%) 0.002
Blood Film: Renal pathology 6 (2.5%) 7 (9.2%) 13 (4.1%) 0.017
Blood Film: Malignancy 4 (1.7%) 3 (3.9%) 7 (2.2%) 0.364
Blood Film: Hemolysis 6 (2.5%) 5 (6.6%) 11 (3.5%) 0.141
Blood Film: Malaria 1 (0.4%) 1 (1.3%) 2 (0.6%) 0.421
Blood Film: Inflamation 4 (1.7%) 5 (6.6%) 9 (2.8%) 0.039
Iron Defecienvy Anemia 57 (23.6%) 39 (51.3%) 96 (30.2%) <0.001
Malaria 26 (10.7%) 20 (26.3%) 46 (14.5%) <0.001
Sicle cell Disease 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 malignacy 3 (1.2%) 1 (1.3%) 4 (1.3%) >0.999
Anemia of Chronic Disease 0 (0.0%) 2 (2.6%) 2 (0.6%) 0.057
Diagnosis: Bronchiolitis 7 (2.9%) 0 (0.0%) 7 (2.2%) 0.203
Diagnosis: Gastroenteritis 26 (10.7%) 0 (0.0%) 26 (8.2%) 0.003
Diagnosis: Liver Pathology 4 (1.7%) 3 (3.9%) 7 (2.2%) 0.364
Diagnosis: Nephropathy 13 (5.4%) 6 (7.9%) 19 (6.0%) 0.412
Diagnosis: malaria 14 (5.8%) 9 (11.8%) 23 (7.2%) 0.075
Diagnosis: Sepsis 24 (9.9%) 16 (21.1%) 40 (12.6%) 0.011
Diagnosis: URTI 6 (2.5%) 1 (1.3%) 7 (2.2%) >0.999
Diagnosis: LRTI 17 (7.0%) 14 (18.4%) 31 (9.7%) 0.003
Diagnosis: Cardiopathy 19 (7.9%) 2 (2.6%) 21 (6.6%) 0.110
Diagnosis: malignancy 11 (4.5%) 8 (10.5%) 19 (6.0%) 0.091
Diagnosis: Others 24 (9.9%) 1 (1.3%) 25 (7.9%) 0.015
Diagnosis: CNS 29 (12.0%) 3 (3.9%) 32 (10.1%) 0.042
Diagnosis: Poisons 9 (3.7%) 0 (0.0%) 9 (2.8%) 0.121
Diagnosis: DKA 3 (1.2%) 0 (0.0%) 3 (0.9%) >0.999
Diagnosis: Hemoglobinopathies 22 (9.1%) 21 (27.6%) 43 (13.5%) <0.001
Diagnosis: HIV 7 (2.9%) 2 (2.6%) 9 (2.8%) >0.999
Diagnosis: Surgical 21 (8.7%) 1 (1.3%) 22 (6.9%) 0.027
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 Present 193 (67.0%) 22 (73.3%) 215 (67.6%) 0.481
Categorised RDW


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
categorised MCV


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
Transfused Blood 66 (22.9%) 10 (33.3%) 76 (23.9%) 0.203
Immunity 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%)
Dewormed in the past 6 months 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
Malaria parasites positive 26 (11.5%) 2 (8.0%) 28 (11.1%) >0.999
    Unknown 61 5 66
Use of Malatria prevention method 217 (75.3%) 26 (86.7%) 243 (76.4%) 0.165
Prevention: Repellent 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
Prevention: Clothes 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
Prevention: Spray or Coil 82 (28.5%) 7 (23.3%) 89 (28.0%) 0.551
Prevention: ITN 135 (46.9%) 19 (63.3%) 154 (48.4%) 0.086
Blood loss (past 2 months) 32 (11.1%) 5 (16.7%) 37 (11.6%) 0.369
Age (Months) 42 (14, 94) 18 (8, 45) 38 (14, 93) 0.015
Duration of Hospital Stay 6 (3, 11) 4 (3, 6) 6 (3, 10) 0.166
PICU admision required 6 (2.1%) 7 (23.3%) 13 (4.1%) <0.001
Transfusion 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. past 3 months 111 (38.5%) 14 (46.7%) 125 (39.3%) 0.386
Exclusive Breastfeeding (4 months) in older child 167 (58.0%) 16 (53.3%) 183 (57.5%) 0.624
Eats iron containing vegetables 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%)
Father's educational level


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%)
Mother's educational level


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 type


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


0.822
    Female 131 (45.5%) 13 (43.3%) 144 (45.3%)
    Male 157 (54.5%) 17 (56.7%) 174 (54.7%)
Blood film done 101 (35.1%) 9 (30.0%) 110 (34.6%) 0.579
Blood Film: IDA 47 (16.3%) 7 (23.3%) 54 (17.0%) 0.330
Blood Film: SCD 26 (9.0%) 0 (0.0%) 26 (8.2%) 0.152
Blood Film: Infection 48 (16.7%) 6 (20.0%) 54 (17.0%) 0.644
Blood Film: Liver pathology 12 (4.2%) 3 (10.0%) 15 (4.7%) 0.159
Blood Film: Renal pathology 11 (3.8%) 2 (6.7%) 13 (4.1%) 0.352
Blood Film: Malignancy 6 (2.1%) 1 (3.3%) 7 (2.2%) 0.504
Blood Film: Hemolysis 9 (3.1%) 2 (6.7%) 11 (3.5%) 0.278
Blood Film: Malaria 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
Blood Film: Inflamation 9 (3.1%) 0 (0.0%) 9 (2.8%) >0.999
Iron Defecienvy Anemia 86 (29.9%) 10 (33.3%) 96 (30.2%) 0.693
Malaria 42 (14.6%) 4 (13.3%) 46 (14.5%) >0.999
Sicle cell Disease 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 malignacy 3 (1.0%) 1 (3.3%) 4 (1.3%) 0.329
Anemia of Chronic Disease 2 (0.7%) 0 (0.0%) 2 (0.6%) >0.999
Diagnosis: Bronchiolitis 7 (2.4%) 0 (0.0%) 7 (2.2%) >0.999
Diagnosis: Gastroenteritis 26 (9.0%) 0 (0.0%) 26 (8.2%) 0.152
Diagnosis: Liver Pathology 3 (1.0%) 4 (13.3%) 7 (2.2%) 0.002
Diagnosis: Nephropathy 18 (6.3%) 1 (3.3%) 19 (6.0%) >0.999
Diagnosis: malaria 22 (7.6%) 1 (3.3%) 23 (7.2%) 0.709
Diagnosis: Sepsis 31 (10.8%) 9 (30.0%) 40 (12.6%) 0.006
Diagnosis: URTI 7 (2.4%) 0 (0.0%) 7 (2.2%) >0.999
Diagnosis: LRTI 28 (9.7%) 3 (10.0%) 31 (9.7%) >0.999
Diagnosis: Cardiopathy 20 (6.9%) 1 (3.3%) 21 (6.6%) 0.706
Diagnosis: malignancy 15 (5.2%) 4 (13.3%) 19 (6.0%) 0.091
Diagnosis: Others 22 (7.6%) 3 (10.0%) 25 (7.9%) 0.718
Diagnosis: CNS 29 (10.1%) 3 (10.0%) 32 (10.1%) >0.999
Diagnosis: Poisons 9 (3.1%) 0 (0.0%) 9 (2.8%) >0.999
Diagnosis: DKA 3 (1.0%) 0 (0.0%) 3 (0.9%) >0.999
Diagnosis: Hemoglobinopathies 42 (14.6%) 1 (3.3%) 43 (13.5%) 0.097
Diagnosis: HIV 8 (2.8%) 1 (3.3%) 9 (2.8%) 0.595
Diagnosis: Surgical 22 (7.6%) 0 (0.0%) 22 (6.9%) 0.245
1 n (%); Median (Q1, Q3)
2 Pearson’s Chi-squared test; Fisher’s exact test; Wilcoxon rank sum test

Figure I

Code
df_anemia_ready %>% 
    select(starts_with("diag_"), anemia) %>% 
    pivot_longer(cols = starts_with("diag_")) %>% 
    filter(value == "Yes") %>% 
    count(anemia, name, value) %>% 
    arrange(name, n) %>% 
    rename(`Anemia Present` = anemia) %>% 
    mutate(name = factor(
        name,
        levels = c(
            "diag_rbc_abnormalities", 
            "diag_sepsis", 
            "diag_lrti", 
            "diag_malaria", 
            "diag_cns", 
            "diag_nephropathy", 
            "diag_cardiac",  
            "diag_gastroenteritis", 
            "diag_malignancy",
            "diag_others","diag_surgical", "diag_hiv", "diag_poison",
            "diag_urti", "diag_bronchiolitis",
            "diag_dka", "diag_Liver_pathology"),
        labels = c(
            "Hematologic", 
            "Sepsis", 
            "LRTI",
            "Malaria", 
            "CNS", 
            "Nephropathy", 
            "Cardiology", 
            "Gastroenteritis",
            "Oncologic",
            "Others","Surgical", "HIV", "Poison", "URTI",
            "Asthma/Bronchiolitis",
             "DKA", "Hepathopathy"))) %>% 
    ggplot(
        aes(
            x = name, 
            y = n, 
            color = `Anemia Present`, 
            fill = `Anemia Present`))+
    geom_col(position = position_dodge(0.8), width = .70)+
    labs(x = NULL, y = "Frequency")+
    theme_bw()+
    scale_fill_grey()+
    scale_color_grey()+
    scale_fill_brewer(palette = "Set1")+
    scale_color_brewer(palette = "Set1")+
    theme(
        axis.text.x.bottom = element_text(
            angle = 90, 
            hjust = 1, 
            vjust = 0.5), 
        legend.position = "top")
Scale for fill is already present.
Adding another scale for fill, which will replace the existing scale.
Scale for colour is already present.
Adding another scale for colour, which will replace the existing scale.

Table I new

Code
df_anemia_ready %>%
    select(anemia, age_months, gender, residence, maternal_education,
           maternal_education, family_income, exbf_4mths_older_chn,
           eat_iron_veges, 
           bld_loss_3mths_2, mal_prev_use, iron_supp_3mths, deworm_6mths_2, 
           scd, g6pd, ida, diag_malignancy, rdt_positive, diag_lrti, 
           picu_required, rbc_transfused, dura_hosp_stay, died) %>% 
    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
Age (Months) 24 (11, 70) 45 (15, 105) 38 (14, 93) 0.002
Sex


0.744
    Female 48 (46.6%) 96 (44.7%) 144 (45.3%)
    Male 55 (53.4%) 119 (55.3%) 174 (54.7%)
Residence type


0.209
    Rural 36 (35.0%) 91 (42.3%) 127 (39.9%)
    Urban 67 (65.0%) 124 (57.7%) 191 (60.1%)
Mother's educational level


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%)
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%)
Exclusive Breastfeeding (4 months) in older child 67 (65.0%) 116 (54.0%) 183 (57.5%) 0.061
Eats iron containing vegetables 62 (68.9%) 104 (51.2%) 166 (56.7%) 0.005
    Unknown 13 12 25
Blood loss (past 2 months) 6 (5.8%) 31 (14.4%) 37 (11.6%) 0.025
Use of Malatria prevention method 79 (76.7%) 164 (76.3%) 243 (76.4%) 0.934
Iron supp. past 3 months 48 (46.6%) 77 (35.8%) 125 (39.3%) 0.065
Dewormed in the past 6 months 47 (57.3%) 101 (56.1%) 148 (56.5%) 0.855
    Unknown 21 35 56
Sicle cell Disease 2 (1.9%) 41 (19.1%) 43 (13.5%) <0.001
G6PD 0 (0.0%) 10 (4.7%) 10 (3.1%) 0.034
Iron Defecienvy Anemia 2 (1.9%) 94 (43.7%) 96 (30.2%) <0.001
Diagnosis: malignancy 5 (4.9%) 14 (6.5%) 19 (6.0%) 0.560
RDT Positive 3 (2.9%) 41 (19.1%) 44 (13.8%) <0.001
Diagnosis: LRTI 5 (4.9%) 26 (12.1%) 31 (9.7%) 0.042
PICU admision required 3 (2.9%) 10 (4.7%) 13 (4.1%) 0.559
Transfused Blood 2 (1.9%) 74 (34.4%) 76 (23.9%) <0.001
Duration of Hospital Stay 5 (2, 8) 6 (3, 11) 6 (3, 10) 0.024
Patient Died 8 (7.8%) 22 (10.2%) 30 (9.4%) 0.481
1 Median (Q1, Q3); n (%)
2 Wilcoxon rank sum test; Pearson’s Chi-squared test; Fisher’s exact test
Code
#       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) 

Table II new

Code
df_anemia_ready %>% 
    gtsummary::tbl_cross(
        row = age_cat,
        col = anemia_cat,
        missing = "no",
        percent = "row",
        digits = c(0,1)) %>% 
    gtsummary::bold_labels()
anemia_cat
Total
None Mild Moderate Severe
Categorised Age




    3 to 5 months 8 (57.1%) 3 (21.4%) 2 (14.3%) 1 (7.1%) 14 (100.0%)
    6 to 23 months 37 (38.9%) 22 (23.2%) 29 (30.5%) 7 (7.4%) 95 (100.0%)
    24 to 59 months 23 (29.5%) 14 (17.9%) 33 (42.3%) 8 (10.3%) 78 (100.0%)
    5 to 11 years 23 (25.6%) 4 (4.4%) 33 (36.7%) 30 (33.3%) 90 (100.0%)
    12 to 14 years(girls) 5 (35.7%) 2 (14.3%) 3 (21.4%) 4 (28.6%) 14 (100.0%)
    12 to 14 years(boys) 2 (16.7%) 1 (8.3%) 7 (58.3%) 2 (16.7%) 12 (100.0%)
    >= 15 years (girls) 0 (0.0%) 0 (0.0%) 3 (75.0%) 1 (25.0%) 4 (100.0%)
    >= 15 years (boys) 0 (NA%) 0 (NA%) 0 (NA%) 0 (NA%) 0 (NA%)
Total 98 (31.9%) 46 (15.0%) 110 (35.8%) 53 (17.3%) 307 (100.0%)

Table IIIA New

Code
df_anemia_ready %>%
    select(anemia, rdw_cat, mcv_cat) %>% 
    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
Categorised RDW


<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
categorised MCV


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
1 n (%)
2 Pearson’s Chi-squared test; Fisher’s exact test

Table IIIB new

Code
df_anemia_ready %>%
    mutate(
        anemia = factor(
            anemia, 
            levels = c("No", "Yes"), 
            labels = c("Anemia Absent", "Anemia Present"))) %>% 
  gtsummary::tbl_strata(
    strata = anemia,
    .tbl_fun = ~ .x %>% 
      gtsummary::tbl_cross(
        row = mcv_cat, 
        col = rdw_cat, 
        percent = "cell", 
        missing = "no", )) %>%
      gtsummary::bold_labels()
Anemia Absent
Anemia Present
Normal High Total Normal High Total
categorised MCV





    Microcytic 23 (26%) 33 (37%) 56 (62%) 20 (9.9%) 106 (52%) 126 (62%)
    Normocytic 23 (26%) 10 (11%) 33 (37%) 15 (7.4%) 51 (25%) 66 (33%)
    Macrocytic 0 (0%) 1 (1.1%) 1 (1.1%) 2 (1.0%) 9 (4.4%) 11 (5.4%)
Total 46 (51%) 44 (49%) 90 (100%) 37 (18%) 166 (82%) 203 (100%)

Table 4 New

Code
df_anemia_ready %>%
    select(anemia, age_months, gender, residence, maternal_education,
           maternal_education, family_income, exbf_4mths_older_chn,
           eat_iron_veges, 
           bld_loss_3mths_2, mal_prev_use, iron_supp_3mths, deworm_6mths_2, 
           scd, g6pd, ida, diag_malignancy, rdt_positive, diag_lrti, 
           picu_required, rbc_transfused, dura_hosp_stay, died) %>% 
    gtsummary::tbl_uvregression(
        method = glm,
        y = anemia,
        method.args = family(binomial),
        exponentiate = TRUE,
        pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)) %>% 
    gtsummary::modify_header(
            estimate ~ "**OR**",
            label ~ "**Variable**") %>%
    gtsummary::bold_labels() %>% 
    gtsummary::bold_p()
There was a warning running `tbl_regression()` for variable "g6pd". See message
below.
! glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit:
  fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, and
  collapsing to unique 'x' values
Variable N OR 95% CI p-value
Age (Months) 318 1.01 1.00, 1.01 0.004
Sex 318


    Female

    Male
1.08 0.67, 1.73 0.744
Residence type 318


    Rural

    Urban
0.73 0.45, 1.19 0.210
Mother's educational level 318


    None

    Primary
0.72 0.28, 1.69 0.472
    Secondary
0.70 0.27, 1.66 0.432
    Tertiary
0.52 0.19, 1.35 0.191
Family Income 318


    Low

    Middle
0.45 0.27, 0.75 0.002
    High
0.84 0.26, 3.20 0.779
Exclusive Breastfeeding (4 months) in older child 318


    No

    Yes
0.63 0.38, 1.02 0.062
Eats iron containing vegetables 293


    No

    Yes
0.47 0.28, 0.80 0.005
Blood loss (past 2 months) 318


    No

    Yes
2.72 1.17, 7.44 0.031
Use of Malatria prevention method 318


    No

    Yes
0.98 0.55, 1.69 0.934
Iron supp. past 3 months 318


    No

    Yes
0.64 0.40, 1.03 0.066
Dewormed in the past 6 months 262


    No

    Yes
0.95 0.56, 1.61 0.855
Sicle cell Disease 318


    No

    Yes
11.9 3.56, 74.0 <0.001
G6PD 318


    No

    Yes
7,863,854 0.00,
0.983
Iron Defecienvy Anemia 318


    No

    Yes
39.2 12.0, 242 <0.001
Diagnosis: malignancy 318


    No

    Yes
1.37 0.51, 4.32 0.561
RDT Positive 318


    No

    Yes
7.85 2.76, 33.0 <0.001
Diagnosis: LRTI 318


    No

    Yes
2.70 1.09, 8.16 0.049
PICU admision required 318


    No

    Yes
1.63 0.48, 7.37 0.468
Transfused Blood 318


    No

    Yes
26.5 8.07, 164 <0.001
Duration of Hospital Stay 318 1.04 1.01, 1.08 0.023
Patient Died 318


    No

    Yes
1.35 0.60, 3.34 0.483
Abbreviations: CI = Confidence Interval, OR = Odds Ratio

Table 4 - Multivariate

Code
df_anemia_ready %>%
    select(anemia, age_months, family_income, exbf_4mths_older_chn,
           eat_iron_veges, bld_loss_3mths_2, iron_supp_3mths, 
           scd, ida, rdt_positive, diag_lrti, 
           rbc_transfused, dura_hosp_stay) %>%
    glm(anemia ~ ., data = ., family=binomial) %>% 
    gtsummary::tbl_regression(
        pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)
    ) %>% 
    gtsummary::bold_p() %>% 
    gtsummary::bold_labels()
Characteristic log(OR) 95% CI p-value
Age (Months) 0.00 0.00, 0.01 0.193
Family Income


    Low
    Middle -0.14 -0.88, 0.61 0.721
    High 0.09 -1.6, 1.8 0.917
Exclusive Breastfeeding (4 months) in older child


    No
    Yes -0.01 -0.69, 0.68 0.974
Eats iron containing vegetables


    No
    Yes -0.29 -1.1, 0.50 0.476
Blood loss (past 2 months)


    No
    Yes 0.49 -0.63, 1.7 0.400
Iron supp. past 3 months


    No
    Yes -0.34 -1.1, 0.36 0.341
Sicle cell Disease


    No
    Yes 2.4 0.95, 4.3 0.004
Iron Defecienvy Anemia


    No
    Yes 3.7 2.4, 5.5 <0.001
RDT Positive


    No
    Yes 2.0 0.82, 3.5 0.003
Diagnosis: LRTI


    No
    Yes 0.57 -0.74, 1.9 0.392
Transfused Blood


    No
    Yes 2.2 0.90, 4.1 0.004
Duration of Hospital Stay 0.02 -0.03, 0.06 0.491
Abbreviations: CI = Confidence Interval, OR = Odds Ratio