Übung 5: Lösung

Reaktionszeitverteilungen in einem Simon Task.

Published

2022-04-13

Aufgabenstellung

In dieser Übung analysieren Sie Verhaltensdaten einer Studie, in welcher der Einfluss der kortikalen Aktivität im medial orbitofrontal cortex (mOFC) bei einer Konfliktsituation auf die Geschwindigkeit nachfolgender Antworten untersucht wurde (Verstynen 2014). Ein Konflikt wurde mittels eines colour-word Stroop Tasks induziert. Der Hauptbefund in Bezug auf die behavioralen Daten:

In a conflict-related region of the medial orbitofrontal cortex (mOFC), stronger BOLD responses predicted faster response times (RTs) on the next trial.

Stroop Task

Der durchgeführe Task ist eine Standardversion eines Stroop Tasks:

Stroop task. Participants performed the color-word version of the Stroop task (Botvinick et al. 2001; Gratton et al. 1992; Macleod 1991; Stroop 1935) comprised of congruent, incongruent, and neutral conditions while in the MR scanner. Participants were instructed to ignore the meaning of the printed word and respond to the ink color in which the word was printed. For example, in the congruent condition the words “RED,” “GREEN,” and “BLUE” were displayed in the ink colors red, green, and blue, respectively. In this condition, attentional demands were low because the ink color matched the prepotent response of reading the word, so response conflict was at a minimum. However, for the incongruent condition the printed words were different from the ink color in which they were printed (e.g., the word “RED” printed in blue ink). This condition elicited conflict because responding according to the printed word would result in an incorrect response. As a result, attentional demands were high and participants needed to inhibit the prepotent response of reading the word and respond according to the ink color in which the word was printed. On the other hand, the neutral condition consisted of noncolor words presented in an ink color (e.g., the word “CHAIR” printed in red ink) and had a low level of conflict and low attentional demands.

Versuchspersonen musste mit einer Response Box eine von drei Tasten drücken. Es wurde festgehalten, ob die Antwort korrekt war.

Participants were instructed to respond to the ink color in which the text appeared by pressing buttons under the index, middle, and ring fingers on their right hand, each button corresponding to one of the three colors (red, green, and blue, respectively) on an MR-safe response box. The task was briefly practiced in the scanner to acquaint the participant with the task and to ensure understanding of the instructions. The task began with the presentation of a fixation cross hair for 1,000 ms followed by the Stroop stimulus for 2,000 ms, during which participants were instructed to respond as quickly as possible. A total of 120 trials were presented to each participant (42 congruent, 42 neutral, 36 incongruent). A lower number of incongruent trials was used in order to reduce the expectancy of a stimulus conflict relative to the other conditions.

Datenanalyse

Von Interesse sind die Reaktionszeiten der korrekten Antworten in den Bedingungen kongruent, inkongruent und neutral.

Behavioral analysis. The primary behavioral variable of interest was response time (RT), recorded as the time between cue onset and registered key press (in milliseconds). All first-level analyses were restricted to correct responses. To determine condition-level effects, a one-way repeated-measures ANOVA was used, as were post hoc one-sample t-tests.

Daten importieren

── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
✔ ggplot2 3.3.6     ✔ purrr   0.3.4
✔ tibble  3.1.7     ✔ dplyr   1.0.9
✔ tidyr   1.2.0     ✔ stringr 1.4.0
✔ readr   2.1.2     ✔ forcats 0.5.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
Loading required package: viridisLite

Angenommen, Sie haben das CSV File in einem Subordner namens data gespeichert:

d <- read_csv("data/stroop-data.csv")
Rows: 3337 Columns: 4
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (3): ID, condition, correct
dbl (1): RT

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Rows: 3,337
Columns: 4
$ ID        <chr> "001", "001", "001", "001", "001", "001", "001", "001", "001…
$ condition <chr> "neutral", "congruent", "congruent", "neutral", "neutral", "…
$ correct   <chr> "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", …
$ RT        <dbl> 1.186, 0.667, 0.614, 0.696, 0.752, 0.864, 0.793, 0.662, 0.71…
d <- d |> 
    mutate(across(where(is.character), ~as_factor(.)),
           condition = fct_relevel(condition, "congruent"))

Im Datensatz befinden sich die Daten 28 Personen:

length(levels(d$ID))
[1] 28

Die Variable correct ist mit “Y” und “N” codiert. Wir bevorzugen die Werte 1 und 0.

d <- d |> 
  mutate(correct = if_else(correct == "Y", 1, 0))

Mittlere RT vs Fehlerrate

Wir plotten zuerst median RT versus Fehlerrate (beides pro VP/Bedingung), um uns einen Überblick zu verschaffen.

d_individual_summary <- d |> 
  group_by(ID, condition) |>        
  summarize(RT = median(RT),
            error_rate = 1 - mean(correct))
`summarise()` has grouped output by 'ID'. You can override using the `.groups`
argument.
head(d_individual_summary)
# A tibble: 6 × 4
# Groups:   ID [2]
  ID    condition      RT error_rate
  <fct> <fct>       <dbl>      <dbl>
1 001   congruent   0.788     0     
2 001   neutral     0.817     0.0952
3 001   incongruent 0.953     0.167 
4 002   congruent   0.774     0.146 
5 002   neutral     0.839     0.286 
6 002   incongruent 0.908     0.389 
d_individual_summary |> 
  ggplot(aes(x = RT, y = error_rate)) +
  geom_point() +
  facet_wrap(~condition)

Es sieht aus, als sei die Fehlerrate im Mittel in der inkongruenten Bedingung grösser als in den kongruenten neutralen Bedingungen. Dies ist zu erwarten.

Wir wollen hier nur die Reaktionszeiten korrekter Antworten analysieren. Filtern Sie den Datensatz, so dass nur noch die korrekten Antworten bleiben.

d <- d |> 
  filter(correct == 1)

RT Histogramme

Plotten Sie mit folgender Funktion die RT Histogramme zufällig ausgewählter Personen (28 VP sind zuviele, um sie so in einer Grafik darzustellen).

plot_hist <- function(d) {
  d |> 
  ggplot(aes(x = RT,
             fill = condition,
             color = condition,)) + 
    geom_histogram(aes(y = ..density..), 
                   alpha = 0.5, bins = 30) + 
    # facet_grid(condition~ID) +
      facet_wrap(~ID) +
    coord_cartesian(xlim=c(0, 1.8)) +
    scale_fill_viridis(discrete = TRUE, option = "E") +
    scale_color_viridis(discrete = TRUE, option = "E")
}

Wir plotten hier die RT Histogramme 9 zufällig ausgewählter Personen. ::: {.cell hash=‘solution_05_cache/html/unnamed-chunk-12_9b5124d7154035b458f8566b2b0ef58b’}

n_persons <- 9

d |> 
  filter(ID %in% sample(levels(ID), n_persons)) |> 
  plot_hist()

:::

Aufgaben

Aufgabe 1

  1. Berechnen Sie die mittlere RT pro Person/Bedingung, und stellen Sie die mittlere RT pro Bedingung, gemittelt über Personen, mit Fehlerbalken grafisch dar.

  2. Beschreiben Sie in 1-2 Sätzen, was Sie gefunden haben.

by_subject <- d |> 
  group_by(ID, condition) |> 
  summarise(RT = mean(RT))
`summarise()` has grouped output by 'ID'. You can override using the `.groups`
argument.
agg <- Rmisc::summarySEwithin(by_subject,
                       measurevar = "RT",
                       withinvars = "condition",
                       idvar = "ID",
                       na.rm = FALSE,
                       conf.interval = .95)
agg |> 
  ggplot(aes(condition, RT)) +
  geom_line(aes(group = 1), linetype = 3) +   
  geom_errorbar(aes(ymin = RT-se, ymax = RT+se),
                width = 0.1, size=1, color="black") +
  geom_point(size = 4) +
  theme(legend.position = "none")

Die mittlere Reaktionszeit für korrekte Entscheidungen ist in der inkongruenten Bedingung grösser als in der neutralen Bedingungen, währens die mittlere RT in der kongruenten Bedingung kleiner als in der neutralen Bedingung. Wenn wir anstelle der Standardfehler die Konfidenzintervalle plotten, sehen wir, dass diese Unterschiede signifikant wären, wenn wir dies testen wollten (die 95% Konfidenzintervalle überlappen nicht).

agg |> 
  ggplot(aes(condition, RT)) +
  geom_line(aes(group = 1), linetype = 3) +   
  geom_errorbar(aes(ymin = RT-ci, ymax = RT+ci),
                width = 0.1, size=1, color="black") +
  geom_point(size = 4) +
  theme(legend.position = "none")

Aufgabe 2

  1. Untersuchen Sie mittels einer Shift Function den Unterschied zwischen den Bedingungen congruent und incongruent.

  2. Beschreiben Sie in 1-2 Sätzen, was Sie gefunden haben.

  3. Pratte et al. (2010) haben festgestellt, dass Stroop Effekte bei längeren Reaktionszeiten ansteigen. Ist diese Aussage mit Ihren Befunden vereinbar?

Zuerst entfernen wir die Faktorstufe neutral:

dd <- d |> 
  filter(!(condition %in% "neutral")) |> 
  mutate(condition = fct_drop(condition))

Nun verwenden wir die Funktion hsf() aus dem rogme Package, um Shift Functions für jede Person in den beiden Bedingungen zu berechnen, und die gemittelten Differenzen der Dezile zu erhalten.

Die Formel, welche Sie für die Funktion brauchen, lautet

RT ~ condition + ID 

Diese Formel ist so zu lesen: RT Quantile werden durch condition und ID vorhergesagt.

out <- dd |> 
  rogme::hsf(RT ~ condition + ID)

Stellen Sie die Shift Function grafisch dar.

rogme::plot_hsf(out)

Auf der X-Achse sind die Dezile der congruent Bedingung und auf der Y-Achse die Differenz congruent - incongruent. Die Differenz ist bei jedem Dezil negativ und scheint stetig stärker negativ zu werden. Die incongruent Bedingung führt zu längeren und variableren Reaktionszeiten. Der Stroop-Effekt, das heisst längere RTs bei inkongruenten Trials, ist bei langsamen Antworten stärker ausgeprägt. Dies ist mit dem Befund von Pratte et al. (2010) vereinbar.

References

Pratte, Michael S., Jeffrey N. Rouder, Richard D. Morey, and Chuning Feng. 2010. “Exploring the Differences in Distributional Properties Between Stroop and Simon Effects Using Delta Plots.” Attention, Perception, & Psychophysics 72 (7): 2013–25. https://doi.org/10.3758/APP.72.7.2013.
Verstynen, Timothy D. 2014. “The Organization and Dynamics of Corticostriatal Pathways Link the Medial Orbitofrontal Cortex to Future Behavioral Responses.” Journal of Neurophysiology 112 (10): 2457–69. https://doi.org/10.1152/jn.00221.2014.

Reuse

Citation

BibTeX citation:
@online{ellis2022,
  author = {Andrew Ellis},
  title = {Übung 5: {Lösung}},
  date = {2022-04-13},
  url = {https://kogpsy.github.io/neuroscicomplabFS22//pages/solutions/solution_05.html},
  langid = {en}
}
For attribution, please cite this work as:
Andrew Ellis. 2022. “Übung 5: Lösung.” April 13, 2022. https://kogpsy.github.io/neuroscicomplabFS22//pages/solutions/solution_05.html.