Load data

RT_data <- read_csv(here('data/processed_data/trimmed_RTdata.csv'))
## Parsed with column specification:
## cols(
##   subject = col_character(),
##   block_number = col_double(),
##   block_type = col_character(),
##   trial_number = col_double(),
##   item_type = col_character(),
##   trial_type = col_character(),
##   trial_complexity = col_character(),
##   item_id = col_character(),
##   rt = col_double()
## )

Descriptive

RT_data %>% 
  distinct(subject) %>% 
  count()
## # A tibble: 1 x 1
##       n
##   <int>
## 1   161

Raw data

overall

RT_data %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  scale_x_log10() 
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

by trial type

RT_data %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  scale_x_log10() + 
  facet_wrap(~trial_type)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

by trial complexity

RT_data %>% 
  ggplot(aes(x = rt)) + 
  geom_histogram() + 
  scale_x_log10() + 
  facet_wrap(~trial_complexity)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

by block type

RT_data %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  scale_x_log10() + 
  facet_wrap(~block_type)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

by item id

simple

RT_data %>% 
  filter(trial_complexity == "simple") %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  scale_x_log10() + 
  facet_wrap(~item_id)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

complex

RT_data %>% 
  filter(trial_complexity == "complex") %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  scale_x_log10() + 
  facet_wrap(~item_id)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Basic plotting of RT data

pruning:

rt_summary <- df.rt_trimmed %>% summarise( median = median(log(rt)), mad = mad(log(rt)), upper = median + 3 * mad, lower = median - 3 * mad)

df.rt_trimmed <- df.rt_trimmed %>% filter(!(log(rt) > rt_summary\(upper | log(rt) < rt_summary\)lower))

# before exclusion
summarized <- RT_data %>%
group_by(trial_number, item_type, trial_complexity) %>% 
summarise(meanRT=mean(rt), maxRT=max(rt), minRT=min(rt), medianRT=median(rt), Std=sd(rt), SE = std.error(rt), n = n())
## `summarise()` regrouping output by 'trial_number', 'item_type' (override with `.groups` argument)
ggplot(summarized, aes(x=trial_number, y=medianRT, colour=item_type)) + geom_line() + geom_errorbar(aes(ymin=medianRT-SE, ymax=medianRT+SE),
                width=0.8, size = 0.8, position = position_dodge(width = 0.2), show.legend = FALSE, alpha = 0.8) +
  geom_point(position = position_dodge(width = 0.2), size=2.5) + geom_line(size=1.2, position = position_dodge(width = 0.2)) + ylab("RT [msec]") +
  theme_gray()  + theme(
    panel.grid.minor = element_blank(), 
    plot.title = element_text(hjust=0.5, size=22, face="bold"),
    axis.title.x = element_text(size=18, face='bold'),
    axis.title.y = element_text(size=18, face='bold'),
    axis.text = element_text(size=15),
    legend.title = element_blank(),
    legend.text = element_text(size=14, face='bold'),
    strip.text = element_text(size=17, face='bold'),
    legend.key.size = unit(2.5, 'lines')) + 
  scale_x_continuous(name="Trial Number", breaks =c(2,4,6,8)) +
  facet_grid(~trial_complexity)