#|label: fig-one
#|fig.width: 9
#|fig.height: 4
#|fig.cap: "Distribution of mothers' knkowledge of causes, complications, "
plot_one <-
nnj_mat %>%
select(
friend, anc, hprof, prev_chn, radio, social, othersnnj,
nnj_malaria:nnj_oth_cause, sunlight:herbs, comp_death:comp_eye) %>%
rename(
source_friend = friend,
source_anc = anc,
source_hprof = hprof,
source_prev_chn = prev_chn,
source_radio = radio,
source_social = social,
source_othersnnj = othersnnj,
tmt_breastfeed = breastfeed,
tmt_herbs = herbs,
tmt_glucose = glucose,
tmt_sunlight = sunlight
) %>%
pivot_longer(cols = source_friend:comp_eye) %>%
filter(value == "Yes") %>%
group_by(name) %>%
count() %>%
ungroup() %>%
mutate(
grp = str_extract(name, "^[a-z]+"),
perc = n/151,
grp = case_when(
grp == "comp" ~ "Complications",
grp == "nnj" ~ "Cause",
grp == "source" ~ "Source of Knowledge",
grp == "tmt" ~ "Treatment"),
name = case_when(
name == "comp_damage" ~ "Brain Damage",
name == "comp_death" ~ "Death",
name == "comp_devt" ~ "Developmental Delay",
name == "comp_eye" ~ "Visual Impairment",
name == "comp_retard" ~ "Mental Retardation",
name == "nnj_bld_incomp" ~ "Blood incompatibility",
name == "nnj_breastfeed" ~ "Breastfeeding",
name == "nnj_candidiasis" ~ "Candidiasis",
name == "nnj_eye_dxs" ~ "Eye Disease",
name == "nnj_fever" ~ "Fever",
name == "nnj_infection" ~ "Infections",
name == "nnj_liver_dxs" ~ "Liver Disease",
name == "nnj_malaria" ~ "Malaria",
name == "nnj_oilyfood" ~ "Oily Foods",
name == "nnj_oth_cause" ~ "Others",
name == "source_anc" ~ "Antenatal Clinic",
name == "source_friend" ~ "Friends/Relatives",
name == "source_hprof" ~ "Health Professional",
name == "source_othersnnj" ~ "Others",
name == "source_prev_chn" ~ "Previous child Birth",
name == "source_radio" ~ "Radio/Television",
name == "source_social" ~ "Social Media",
name == "tmt_breastfeed" ~ "Breastfeeding",
name == "tmt_glucose" ~ "Oral Glucose",
name == "tmt_herbs" ~ "Herbs",
name == "tmt_sunlight" ~ "Sunlight")
) %>%
ggplot(
aes(
x = fct_reorder(name, n),
y = n,
label = paste0(
n,
"(",
scales::percent(perc, accuracy = 0.1), ")"))) +
geom_bar(stat = 'identity', fill = "gray45") +
coord_flip()+
labs(x = NULL, y = NULL)+
ylim(c(0,100))+
geom_text(
vjust = 0.25,
hjust = -0.05,
color= "black",
size = 3,
fontface="italic")+
facet_wrap("grp", nrow = 2, scales = "free")+
theme_light()+
theme(
text = element_text(family = "serif", size = 12),
strip.background = element_rect(fil = "white"),
strip.text = element_text(colour = "black", size = 10, face = "bold"))
plot_one