Commit c618859c authored by Christian Poth's avatar Christian Poth
Browse files

Add analysis.

parent f211eb79
# Experiment alert_expect: Analysis.
#
# Christian Poth, 2021-, c.poth@uni-bielefeld.de
library(dplyr)
library(ggplot2)
options(scipen = 999)
# Read data.
setwd("../")
setwd("./data")
files <- list.files(pattern = ".dat")
d <- tibble()
for (f in files){
d <- rbind(d, read.table(f, header = TRUE, sep = "\t"))
}
# Exclude practice trials.
d <- d %>% filter(practice == 0)
# Recode variables.
d <- d %>% mutate(rt = rt - vbl_target)
# Inspect data.
head(d)
d %>%
group_by(participant, alert, ac_valid) %>%
summarize(n = sum(!is.na(trial)))
# Exclude trials without target.
d <- d %>% filter(tg_yes == 1)
# Overall accuracy.
dd_acc <- d %>%
group_by(participant, alert, ac_valid) %>%
summarize(pc = mean(correct),
n = sum(!is.na(trial)))
dd_acc
# RTs.
# Clean up.
d <- d %>%
filter(abs(rt-mean(rt)) < 2*sd(rt))
dd <- d %>%
group_by(participant, alert, ac_valid) %>%
summarize(mrt = mean(rt))
dd
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment