library(dplyr)

library(ggplot2)

dat %

mutate(x_right = x > 15.9,

x_left = x %

ggplot() +

geom_segment(x = 0, xend = 0, y = 0, yend = dnorm(0, 2, 8.1), color = ‘red’) +

geom_segment(x = 2, xend = 2, y = 0, yend = dnorm(2, 2, 8.1), color = ‘blue’) +

geom_area(data = dat %>%

filter(x_right),

aes(x = x, y = y),

fill = ‘red’) +

geom_area(data = dat %>%

filter(x_left),

aes(x = x, y = y),

fill = ‘red’) +

geom_line(aes(x, y), size = 0.7) +

geom_point(x = 17, y = 0) +

xlab(“Estimated effect size”) +

ylab(“Relative frequency”) +

theme_bw()