s1_delta_dsi <- s1_dsi_agg %>%
arrange(authorship, n_essay) %>%
select(dsi_z, n_essay, authorship) %>%
group_by(authorship, n_essay) %>%
summarise(dsi_z = mean(dsi_z)) %>%
ungroup() %>%
group_by(authorship) %>%
mutate(delta_dsi = dsi_z - dsi_z[n_essay == 2]) %>%
mutate(log_n_essay = log(n_essay)) %>%
mutate(dsi_z_lagged = lag(dsi_z)) %>%
mutate(pct_change = (dsi_z / dsi_z_lagged) - 1) %>%
ungroup() %>%
filter(n_essay <= 34) %>%
filter(n_essay >= 2) %>%
mutate(authorship = as.factor(authorship)) %>%
mutate(authorship = factor(
authorship,
levels = c("spsp_s1_diverse", "spsp_s1_random", "spsp_s1_gpt")
)) %>%
mutate(
authorship = case_match(
authorship,
"spsp_s1_diverse" ~ "Diverse Applicants",
"spsp_s1_random" ~ "General Applicants",
"spsp_s1_gpt" ~ "GPT-4"
)
) %>%
mutate(Authorship = as.factor(authorship)) %>%
mutate(Authorship = factor(
Authorship,
levels = c("Diverse Applicants", "General Applicants", "GPT-4")
)) %>%
mutate(Authorship = relevel(Authorship, ref = "General Applicants"))
s1_p2 <- s1_delta_dsi %>%
ggplot(aes(n_essay, delta_dsi, color = authorship)) +
geom_point(alpha = 0.3) +
geom_smooth(method = "lm",
formula = 'y ~ log(x)',
se = T) +
labs(x = "Number of Essays",
y = expression(
atop(
"Increase in the Aggregated Creativity",
"(" * Delta * " in Average of Standardized DSI)"
)
)) +
ggeasy::easy_add_legend_title("Authorship") +
ggeasy::easy_move_legend("top") +
ggeasy::easy_rotate_x_labels(0, "right") +
scale_color_brewer(palette = "Set1") +
easy_remove_legend() +
scale_y_continuous(limits = c(0, 0.7)) +
scale_x_continuous(breaks = seq(from = 2, to = 34, by = 2))
s1_p2