path.data <- file.path("~", "Downloads", "mia2_submissions.csv")
df.stroop <- path.data %>%
read_csv(show_col_types = FALSE) %>%
separate("Timestamp", into = c("date", "time"), sep = " ") %>%
mutate(date = mdy(date), year = year(date)) %>%
filter(year == 2024) %>%
select(-date, -time) %>%
unique() %>%
rename(congruent = `Task 1: Copy & paste the amount of time (secs) elapsed it took you to complete \"The easy practice test\"`,
incongruent = `Task 2: Copy & paste the amount of time (secs) elapsed it took you to complete \"The real hard test\"`,
email = `Email Address`) %>%
mutate(ln_congruent = log(congruent),
ln_incongruent = log(incongruent))
vec.congruent_outliers <- df.stroop %>%
rstatix::identify_outliers(congruent) %>%
pull(Name)
vec.incongruent_outliers <- df.stroop %>%
rstatix::identify_outliers(incongruent) %>%
pull(Name)
vec.outlier_ids <- c(vec.congruent_outliers, vec.incongruent_outliers)
df.stroop <- df.stroop %>%
filter(!Name %in% vec.outlier_ids)
set.seed(100)
df.stroop %>%
select(Name, ln_congruent, ln_incongruent) %>%
pivot_longer(cols = starts_with("ln_"),
names_to = "condition",
names_prefix = "ln_",
values_to = "rt") %>%
ggplot(mapping = aes(x = condition,
y = rt,
color = condition)) +
geom_jitter(width = 0.15,
height = 0,
alpha = 0.3,
size = 6.5) +
stat_summary(geom = "linerange",
fun.data = mean_cl_boot,
linewidth = 2,
col = "black") +
stat_summary(fun = mean,
size = 1,
col = "black") +
labs(title = "Stroop Task",
subtitle = paste0("Psych 45 - Spring 2024 (N = ", df.stroop %>% pull(email) %>% unique %>% length, ")"),
x = "",
y = "ln(RT)") +
scale_color_brewer(palette = "Set1")