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 < 8) ~ "Moderate", 
            (age_months >= 1 & hb < 9) ~ "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 >= 5 & mcv > 85 ~ "Macrocytic", 
            age_months >= 6 & mcv >= 73  ~ "Normocytic",
            age_months >= 6 & mcv < 73  ~ "Microcytic",
            age_months >= 1 & mcv > 108 ~ "Macrocytic", 
            age_months >= 1 & mcv >= 74  ~ "Normocytic",
            age_months >= 1 & mcv < 74  ~ "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",
            age_months >= 1 & rdw_cv > 16.5 ~ "High", 
            age_months >= 1 & rdw_cv >= 11.0  ~ "Normal",
            age_months >= 1 & rdw_cv < 11.0  ~ "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),
        malnutrition = case_when(
            str_detect(history, "MALNUTRITION") ~ "Yes", 
            str_detect(history_other, "MALNUTRITION") ~ "Yes", 
            str_detect(discharge_diagnosis_upper, "MALNUTRITION") ~ "Yes", 
            TRUE ~ "No"),
        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 >= 1 & 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)")), 
        age_cat_2 = case_when(
            (age_months >= 6 & age_months <= 59) ~ "6 to 59 months", 
            (age_months < 6) ~ "< 6 months", 
            (age_months > 59) ~ "> 59 months"), 
        exbf_4mths_older_chn = case_when(
            age_months <= 48 ~ exbf_4mths_older_chn ))
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", 
        age_cat_2 = "Categorised Age (6-59)", 
        malnutrition = "Malnutrition")

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(
            "Haematologic", 
            "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, alpha = .9)+
    labs(x = NULL, y = "Frequency")+
    theme_bw()+
    scale_fill_manual(
        name = NULL, 
        labels = c("Normal", "Anaemia"), 
        values = c("#376996", "#db143b"))+
    scale_color_manual(
        name = NULL, 
        labels = c("Normal", "Anaemia"), 
        values = c("#376996", "#db143b"))+
    theme(
        axis.text.x.bottom = element_text(
            angle = 90, 
            hjust = 1, 
            vjust = 0.5), 
        legend.position = "top")

Code
ggsave("Anemia at PEU/Figures/Figure I.jpg", width = 6, height = 4)

Table I

Code
table_one_new <- 
    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, diag_sepsis,  malnutrition, 
           rdt_positive, diag_lrti, 
           picu_required, rbc_transfused, dura_hosp_stay, died, 
           age_cat_2) %>% 
    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()

table_one_new
Characteristic
Anemia Present
Overall
N = 3181
p-value2
No
N = 1061
Yes
N = 2121
Age (Months) 23 (10, 68) 47 (16, 106) 38 (14, 93) <0.001
Sex


0.633
    Female 50 (47.2%) 94 (44.3%) 144 (45.3%)
    Male 56 (52.8%) 118 (55.7%) 174 (54.7%)
Residence type


0.293
    Rural 38 (35.8%) 89 (42.0%) 127 (39.9%)
    Urban 68 (64.2%) 123 (58.0%) 191 (60.1%)
Mother's educational level


0.653
    None 10 (9.4%) 22 (10.4%) 32 (10.1%)
    Primary 41 (38.7%) 89 (42.0%) 130 (40.9%)
    Secondary 33 (31.1%) 69 (32.5%) 102 (32.1%)
    Tertiary 22 (20.8%) 32 (15.1%) 54 (17.0%)
Family Income


0.019
    Low 62 (58.5%) 155 (73.1%) 217 (68.2%)
    Middle 40 (37.7%) 48 (22.6%) 88 (27.7%)
    High 4 (3.8%) 9 (4.2%) 13 (4.1%)
Exclusive Breastfeeding (4 months) in older child 47 (66.2%) 59 (54.6%) 106 (59.2%) 0.123
    Unknown 35 104 139
Eats iron containing vegetables 62 (68.9%) 104 (51.2%) 166 (56.7%) 0.005
    Unknown 16 9 25
Blood loss (past 2 months) 6 (5.7%) 31 (14.6%) 37 (11.6%) 0.019
Use of Malatria prevention method 82 (77.4%) 161 (75.9%) 243 (76.4%) 0.779
Iron supp. past 3 months 49 (46.2%) 76 (35.8%) 125 (39.3%) 0.074
Dewormed in the past 6 months 47 (57.3%) 101 (56.1%) 148 (56.5%) 0.855
    Unknown 24 32 56
Sicle cell Disease 2 (1.9%) 41 (19.3%) 43 (13.5%) <0.001
G6PD 0 (0.0%) 10 (4.7%) 10 (3.1%) 0.034
Iron Defecienvy Anemia 3 (2.8%) 94 (44.3%) 97 (30.5%) <0.001
Diagnosis: malignancy 5 (4.7%) 14 (6.6%) 19 (6.0%) 0.503
Diagnosis: Sepsis 7 (6.6%) 33 (15.6%) 40 (12.6%) 0.023
Malnutrition 15 (14.2%) 34 (16.0%) 49 (15.4%) 0.660
RDT Positive 3 (2.8%) 41 (19.3%) 44 (13.8%) <0.001
Diagnosis: LRTI 5 (4.7%) 26 (12.3%) 31 (9.7%) 0.032
PICU admision required 3 (2.8%) 10 (4.7%) 13 (4.1%) 0.555
Transfused Blood 3 (2.8%) 73 (34.4%) 76 (23.9%) <0.001
Duration of Hospital Stay 5 (2, 8) 6 (3, 11) 6 (3, 10) 0.041
Patient Died 9 (8.5%) 21 (9.9%) 30 (9.4%) 0.684
Categorised Age (6-59)


<0.001
    < 6 months 16 (15.1%) 9 (4.2%) 25 (7.9%)
    > 59 months 30 (28.3%) 90 (42.5%) 120 (37.7%)
    6 to 59 months 60 (56.6%) 113 (53.3%) 173 (54.4%)
1 Median (Q1, Q3); n (%)
2 Wilcoxon rank sum test; Pearson’s Chi-squared test; Fisher’s exact test
Code
file.remove("Anemia at PEU/Tables/table_one_new.docx")
[1] TRUE
Code
table_one_new %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave("Anemia at PEU/Tables/table_one_new.docx")

Table II

Code
table_two_new <- 
    df_anemia_ready %>% 
    gtsummary::tbl_cross(
        row = age_cat,
        col = anemia_cat,
        missing = "ifany",
        percent = "row",
        digits = c(0,1)) %>% 
    gtsummary::bold_labels()

table_two_new
anemia_cat
Total
None Mild Moderate Severe
Categorised Age




    3 to 5 months 16 (64.0%) 4 (16.0%) 2 (8.0%) 3 (12.0%) 25 (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 106 (33.3%) 47 (14.8%) 110 (34.6%) 55 (17.3%) 318 (100.0%)
Code
file.remove("Anemia at PEU/Tables/table_two_new.docx")
[1] TRUE
Code
table_two_new %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave("Anemia at PEU/Tables/table_two_new.docx")

Table IIIA

Code
table_threeA_new <- 
    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()

table_threeA_new
Characteristic
Anemia Present
Overall
N = 3181
p-value2
No
N = 1061
Yes
N = 2121
Categorised RDW


<0.001
    Normal 53 (50.0%) 40 (18.9%) 93 (29.2%)
    High 53 (50.0%) 172 (81.1%) 225 (70.8%)
categorised MCV


0.180
    Microcytic 67 (63.2%) 128 (60.4%) 195 (61.3%)
    Normocytic 38 (35.8%) 73 (34.4%) 111 (34.9%)
    Macrocytic 1 (0.9%) 11 (5.2%) 12 (3.8%)
1 n (%)
2 Pearson’s Chi-squared test; Fisher’s exact test
Code
file.remove("Anemia at PEU/Tables/table_threeA_new.docx")
[1] TRUE
Code
table_threeA_new %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave("Anemia at PEU/Tables/table_threeA_new.docx")

Table IIIB

Code
table_threeB_new <- 
    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 = "ifany", )) %>%
      gtsummary::bold_labels()

table_threeB_new
Anemia Absent
Anemia Present
Normal High Total Normal High Total
categorised MCV





    Microcytic 27 (25%) 40 (38%) 67 (63%) 20 (9.4%) 108 (51%) 128 (60%)
    Normocytic 26 (25%) 12 (11%) 38 (36%) 18 (8.5%) 55 (26%) 73 (34%)
    Macrocytic 0 (0%) 1 (0.9%) 1 (0.9%) 2 (0.9%) 9 (4.2%) 11 (5.2%)
Total 53 (50%) 53 (50%) 106 (100%) 40 (19%) 172 (81%) 212 (100%)
Code
file.remove("Anemia at PEU/Tables/table_threeB_new.docx")
[1] TRUE
Code
table_threeB_new %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave("Anemia at PEU/Tables/table_threeB_new.docx")

Table 4: Uni-variate Regression

Code
x <- 
    df_anemia_ready %>%
    select(anemia, age_months, gender, residence, maternal_education,
           maternal_education, family_income, exbf_4mths_older_chn,
           eat_iron_veges, malnutrition,
           bld_loss_3mths_2, mal_prev_use, iron_supp_3mths, deworm_6mths_2, 
           scd, g6pd, ida, diag_malignancy, rdt_positive, diag_lrti, 
           diag_sepsis,
           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 ~ "**COR**",
            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

Table 4 - Multivariate

Code
y <- 
    df_anemia_ready %>% 
    select(anemia, age_months, family_income, 
           eat_iron_veges, bld_loss_3mths_2, iron_supp_3mths, 
           scd, ida, rdt_positive, diag_lrti, diag_sepsis,
           rbc_transfused, dura_hosp_stay) %>%
    glm(anemia ~ ., data = ., family=binomial) %>%
    gtsummary::tbl_regression(
        pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3),
        exponentiate = T
    ) %>% 
    gtsummary::modify_header(
            estimate ~ "**AOR**",
            label ~ "**Variable**") %>% 
    gtsummary::bold_p() %>% 
    gtsummary::bold_labels()


table_four_new <- 
    gtsummary::tbl_merge(
        tbls = list(x, y), 
        tab_spanner = c("Univariate", "Multivariate"))
The number rows in the tables to be merged do not match, which may result in
rows appearing out of order.
ℹ See `tbl_merge()` (`?gtsummary::tbl_merge()`) help file for details. Use
  `quiet=TRUE` to silence message.
Code
table_four_new
Variable
Univariate
Multivariate
N COR 95% CI p-value AOR 95% CI p-value
Age (Months) 318 1.01 1.00, 1.01 0.002 1.01 1.00, 1.01 0.179
Sex 318





    Female




    Male
1.12 0.70, 1.79 0.633


Residence type 318





    Rural




    Urban
0.77 0.47, 1.25 0.293


Mother's educational level 318





    None




    Primary
0.99 0.41, 2.23 0.975


    Secondary
0.95 0.39, 2.20 0.907


    Tertiary
0.66 0.26, 1.64 0.380


Family Income 318





    Low


    Middle
0.48 0.29, 0.80 0.005 0.80 0.37, 1.72 0.572
    High
0.90 0.28, 3.42 0.865 0.99 0.17, 5.26 0.987
Exclusive Breastfeeding (4 months) in older child 179





    No




    Yes
0.61 0.33, 1.14 0.125


Eats iron containing vegetables 293





    No


    Yes
0.47 0.28, 0.80 0.005 0.81 0.36, 1.81 0.605
Malnutrition 318





    No




    Yes
1.16 0.61, 2.29 0.661


Blood loss (past 2 months) 318





    No


    Yes
2.85 1.23, 7.80 0.024 1.75 0.57, 5.83 0.338
Use of Malatria prevention method 318





    No




    Yes
0.92 0.52, 1.59 0.779


Iron supp. past 3 months 318





    No


    Yes
0.65 0.40, 1.04 0.075 0.69 0.34, 1.41 0.313
Dewormed in the past 6 months 262





    No




    Yes
0.95 0.56, 1.61 0.855


Sicle cell Disease 318





    No


    Yes
12.5 3.73, 77.5 <0.001 9.70 2.37, 66.7 0.005
G6PD 318





    No




    Yes
8,213,090 0.00,
0.983


Iron Defecienvy Anemia 318





    No


    Yes
27.4 9.88, 114 <0.001 36.6 10.3, 234 <0.001
Diagnosis: malignancy 318





    No




    Yes
1.43 0.53, 4.52 0.505


RDT Positive 318





    No


    Yes
8.23 2.90, 34.6 <0.001 7.91 2.39, 36.2 0.002
Diagnosis: LRTI 318





    No


    Yes
2.82 1.14, 8.55 0.039 1.92 0.52, 7.38 0.326
Diagnosis: Sepsis 318





    No


    Yes
2.61 1.18, 6.62 0.027 2.30 0.65, 9.03 0.209
PICU admision required 318





    No




    Yes
1.70 0.51, 7.70 0.428


Transfused Blood 318





    No


    Yes
18.0 6.48, 75.0 <0.001 8.65 2.22, 58.0 0.007
Duration of Hospital Stay 318 1.03 1.00, 1.07 0.033 1.01 0.96, 1.06 0.655
Patient Died 318





    No




    Yes
1.18 0.54, 2.82 0.684


Abbreviations: CI = Confidence Interval, OR = Odds Ratio
Code
file.remove("Anemia at PEU/Tables/table_four_new.docx")
[1] TRUE
Code
table_four_new %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave("Anemia at PEU/Tables/table_four_new.docx")

Mortality and associated factors

Code
table_four_new <- 
    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, diag_sepsis,  malnutrition, 
           rdt_positive, starts_with("daig_"), 
           picu_required, rbc_transfused, dura_hosp_stay, died, 
           age_cat_2) %>% 
    gtsummary::tbl_summary(
        by = died, 
        digits = list(gtsummary::all_categorical() ~ c(0,1))) %>% 
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**Death**") %>% 
    gtsummary::add_overall(last = T) %>%
    gtsummary::add_p(
        pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)) %>%
    gtsummary::bold_labels() %>%
    gtsummary::bold_p()

table_four_new
Characteristic
Death
Overall
N = 3181
p-value2
No
N = 2881
Yes
N = 301
Anemia Present 191 (66.3%) 21 (70.0%) 212 (66.7%) 0.684
Age (Months) 42 (14, 94) 18 (8, 45) 38 (14, 93) 0.015
Sex


0.822
    Female 131 (45.5%) 13 (43.3%) 144 (45.3%)
    Male 157 (54.5%) 17 (56.7%) 174 (54.7%)
Residence type


0.429
    Rural 113 (39.2%) 14 (46.7%) 127 (39.9%)
    Urban 175 (60.8%) 16 (53.3%) 191 (60.1%)
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%)
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%)
Exclusive Breastfeeding (4 months) in older child 95 (60.9%) 11 (47.8%) 106 (59.2%) 0.234
    Unknown 132 7 139
Eats iron containing vegetables 151 (56.3%) 15 (60.0%) 166 (56.7%) 0.724
    Unknown 20 5 25
Blood loss (past 2 months) 32 (11.1%) 5 (16.7%) 37 (11.6%) 0.369
Use of Malatria prevention method 217 (75.3%) 26 (86.7%) 243 (76.4%) 0.165
Iron supp. past 3 months 111 (38.5%) 14 (46.7%) 125 (39.3%) 0.386
Dewormed in the past 6 months 137 (56.8%) 11 (52.4%) 148 (56.5%) 0.692
    Unknown 47 9 56
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
Iron Defecienvy Anemia 87 (30.2%) 10 (33.3%) 97 (30.5%) 0.724
Diagnosis: malignancy 15 (5.2%) 4 (13.3%) 19 (6.0%) 0.091
Diagnosis: Sepsis 31 (10.8%) 9 (30.0%) 40 (12.6%) 0.006
Malnutrition 41 (14.2%) 8 (26.7%) 49 (15.4%) 0.105
RDT Positive 41 (14.2%) 3 (10.0%) 44 (13.8%) 0.781
PICU admision required 6 (2.1%) 7 (23.3%) 13 (4.1%) <0.001
Transfused Blood 66 (22.9%) 10 (33.3%) 76 (23.9%) 0.203
Duration of Hospital Stay 6 (3, 11) 4 (3, 6) 6 (3, 10) 0.166
Categorised Age (6-59)


0.031
    < 6 months 20 (6.9%) 5 (16.7%) 25 (7.9%)
    > 59 months 114 (39.6%) 6 (20.0%) 120 (37.7%)
    6 to 59 months 154 (53.5%) 19 (63.3%) 173 (54.4%)
1 n (%); Median (Q1, Q3)
2 Pearson’s Chi-squared test; Wilcoxon rank sum test; Fisher’s exact test
Code
file.remove("Anemia at PEU/Tables/table_four_new.docx")
[1] TRUE
Code
table_four_new %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave("Anemia at PEU/Tables/table_four_new.docx")