1 Intuition from application: Flanker Task

Let’s look at experimental data from a common cognitive task, the flanker task. These are real data recently published in Hall, Schreiber, Allen, & Hallquist, Journal of Personality. This is a sample of 107 young adults who completed a version of the Eriksen flanker task.). In each trial, participants saw five horizontal arrows and were told to press a key corresponding to the direction of the center arrow (left or right). Participants were instructed to respond as quickly and accurately as possible. Half of the trials presented arrows on either side of the center arrow that pointed in the same direction (“congruent” trials), whereas the flanking arrows on the other trials pointed in the opposite direction (“incongruent” trials).

Participants completed 160 trials in two conditions: mostly congruent (70% of trials congruent) and mostly incongruent (70% of trials incongruent). Each condition was split into blocks of 40 trials. The direction of the central arrow was counterbalanced across trials. Four blocks of forty trials were presented in ABBA order, where A is a mostly congruent block and B is a mostly incongruent block. Stimuli were displayed for 1000ms each with a 500ms inter-trial interval (ITI).

Congruent: \(\leftarrow \leftarrow \leftarrow \leftarrow \leftarrow\)

Incongruent: \(\leftarrow \leftarrow \rightarrow \leftarrow \leftarrow\)

1.1 Data structure

flanker <- readRDS(file="flanker_jop.rds") %>% arrange(id, trial)
str(flanker)
## tibble [17,120 × 11] (S3: tbl_df/tbl/data.frame)
##  $ id            : num [1:17120] 1 1 1 1 1 1 1 1 1 1 ...
##  $ run           : num [1:17120] 1 1 1 1 1 1 1 1 1 1 ...
##  $ trial         : num [1:17120] 1 2 3 4 5 6 7 8 9 10 ...
##  $ run_trial     : int [1:17120] 1 2 3 4 5 6 7 8 9 10 ...
##  $ block         : Factor w/ 2 levels "most_incon","most_con": 2 2 2 2 2 2 2 2 2 2 ...
##  $ cond          : Factor w/ 2 levels "congruent","incongruent": 1 2 1 1 2 1 1 1 2 2 ...
##  $ rt            : num [1:17120] 537 599 397 450 376 413 403 377 439 445 ...
##  $ correct       : num [1:17120] 1 1 1 1 1 1 1 1 1 1 ...
##  $ exclude       : num [1:17120] 0 0 0 0 0 0 0 0 0 0 ...
##  $ MPS_aggression: num [1:17120] 0 0 0 0 0 0 0 0 0 0 ...
##  $ MPS_alienation: num [1:17120] 1 1 1 1 1 1 1 1 1 1 ...

The key dependent variables are reaction time (rt) and accuracy (correct). We will defer models of accuracy for a later workshop. Let’s just focus on rt for today.

lattice::histogram(~ rt | cond*block, flanker)