-
Notifications
You must be signed in to change notification settings - Fork 32
/
02_parental_leave.Rmd
70 lines (57 loc) · 2.7 KB
/
02_parental_leave.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name:parentalleave
# Maternal Leave
The OECD provides a comparative report on how much paid leave women are entitled to after childbirth. But leave takes different forms. In some places, the allowed leave is longer, but sometimes that means that the pay out compared to the regular salary is lower. To emphasize the different forms that law around paid leave take, I plotted the total payout available to mothers as areas of rectangles, where one side is the length of leave allowed, and the other side is the proportion of salary paid to the new mom.
```{r, echo = F}
library(readxl)
library(tidyverse)
df <- read_xlsx("raw_data/OECD Parental Leave system.xlsx")[-(36:45), ] %>%
arrange(
desc(`Total paid leave full rate equivalent in weeks`),
desc(`Total paid leave in weeks`),
desc(`Total paid leave avg payment rate (%)`)
) %>%
mutate(rank_name = paste0("#", 1:35, ": ", Country)) %>%
mutate(paid_leave_months = `Total paid leave in weeks` * 7 / 365 * 12) %>%
mutate(paid_leave_months = `Total paid leave in weeks` * 7 / 365 * 12) %>%
mutate(total_paid_yearly_salaries = `Total paid leave full rate equivalent in weeks` / 52)
```
A random sample from the data set:
```{r, echo = F}
knitr::kable(sample_n(df, 5), format = "html")
```
---
```{r parent_leave, fig.width=12, fig.height= 8, eval=F, echo=F}
ggplot(df) +
aes(x = paid_leave_months) +
aes(y = `Total paid leave avg payment rate (%)`) +
aes(xmin = 0) +
aes(xmax = paid_leave_months) +
aes(ymin = 0) +
aes(ymax = `Total paid leave avg payment rate (%)`) +
facet_wrap(fct_inorder(rank_name) ~ .) +
geom_rect(fill = "blue", alpha = .2) +
aes(yend = 0) +
aes(xend = 0) +
geom_segment(
aes(yend = `Total paid leave avg payment rate (%)`),
lty = "dashed") +
geom_segment(aes(xend = paid_leave_months),
lty = "dashed") +
scale_y_continuous(limits = c(0, 100),
expand = c(0, 0),
breaks = c(0, 50, 100)) +
scale_x_continuous(limits = c(0, 44),
expand = c(0, 0)) +
labs(x = "Length of paid leave entitlement (months)") +
labs(y = "Percent of income paid (average over entitlement period)") +
labs(title = "Total paid leave available to mothers in the OECD") +
labs(subtitle = "Countries rank ordered by paid leave full rate equivalent (blue rectangular area)\nVisualization: Gina Reynolds | Data source: OECD.org ") +
theme_bw(base_size = 12)
```
```{r, echo = F, warning=F, message=F, eval = T, fig.show='hide'}
get_what_save_what <- "parent_leave"
eval(parse(text = paste(knitr:::knit_code$get(get_what_save_what), collapse = "")))
ggsave(paste0("figures/", get_what_save_what, ".png"), dpi = 300)
```
`r apply_reveal("parent_leave")`
---