wwbi_data |>
dplyr::filter(indicator_code %in% c("BI.PWK.PRVS.FE.ZS", "BI.PWK.PUBS.FE.ZS")) |>
mutate(sector = case_when(indicator_code == "BI.PWK.PUBS.FE.ZS" ~ "public",
indicator_code == "BI.PWK.PRVS.FE.ZS" ~ "private")) |>
select(-indicator_code) |>
pivot_wider(id_cols = country_code:year, names_from = sector, values_from = value) |>
#filter(year <= 2012) |>
group_by(country_code) |>
top_n(1, year) |>
left_join(wwbi_country, by = c("country_code")) |>
ggplot(aes(x = public, y = private)) +
geom_point(aes(color = region), size = 2) +
geom_abline(slope = 1, intercept = 0) +
geom_hline(yintercept = 0.5, color = "brown") +
geom_vline(xintercept = 0.5, color = "brown") +
geom_text_repel(aes(label = country_code), size = 3.5, color = "darkgrey") +
scale_color_brewer(palette = "Dark2") +
labs(title = "Proportion of female as share of each sector",
x = "Public sector",
y = "Private sector") +
theme_minimal() +
theme(legend.position = "bottom", legend.title = element_blank())