> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/getting-started/demo-studies/8-1-demo-studies/demo-study-strooptest-psychology-experiment.md).

# Demo study: Strooptest (Psychology experiment)

Record a Stroop test run in Psychtoolbox for MATLAB with a screen recording and API live markers, and annotate response times in iMotions Lab.

*This help center article offers background information to the downloadable demo study:* [***Strooptest study.***](https://files.imotions.com/studies/v4/DEMO%20-%20Strooptest%2028-03-20%2015h48m.zip)

The ‘Stroop effect’ was first presented by J. R. Stroop in 1935. This classic effect in psychology refers back to a basic task, wherein respondents have to name the color (i.e., the color of the ink) of printed color-words – for instance: the word ‘blue’. That is very easy if the word blue is presented in the color blue (because the word and the color are *congruent*), but the same task is somewhat more difficult if the word blue is presented in the color red (because the word and the color are *incongruent*). Note that, here, the correct answer is: red. For incongruent words, due to a psychological phenomenon called ‘cognitive interference’, respondents would more often accidentally report the word (‘blue’) rather than the color of the word (‘red’); for incongruent words, the time for reporting the color of the word also tends to be slower.

The ‘Stroop test’ exists in many variations – including both paper tests and computerized versions of the test. In this example study, we used a computerized version of the Strooptest with three color words (‘red’, ‘green’ and ‘blue’), which were presented in the colors red, green and blue; the respondents pressed a key on the keyboard to answer (i.e., the leftward, downward and rightward arrow key).

The purpose of this example study is to illustrate the possibility to work with external stimulus presentation software within the iMotions software; the software used here, was Psychtoolbox in Matlab. Doing this, requires setting up a communication between Matlab and iMotions over the API (Application Programming Interface) such that the data can be *recorded* and *analyzed* in iMotions, while the stimulus presentation itself is controlled by Psychtoolbox in Matlab.

**Methodologies:**

* API

*Do we observe a Stroop effect? Are the responses for incongruent words more often incorrect and generally slower than the responses for congruent words?*

Below, we list a few tools for analyzing the data from an external stimulus presentation software.

## Use a screen recording to work with an external stimulus presentation software

By adding a ‘screen recording’ to the iMotions experiment, it is possible to record data from your respondents while they interact with an external software. Here, the stimulus presentation was first controlled by iMotions; namely, for giving task instructions (created using the survey tool). Hereafter, a screen recording was launched. As soon as the screen recording started, in Matlab, the Psychtoolbox experiment was launched to take over stimulus presentation.

![Slide1.PNG](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-7c838fb8bf237e88cc8a0d863c19c14184f2ea27%2F14827ceb94_slide1-19-.webp?alt=media)

Read more \*: [How to use E-Prime with iMotions](https://help.imotions.com/lab/study-setup-and-design/other-tools/how-to-use-e-prime-with-imotions.md)

Read more \*: [How to combine iMotions with Presentation (Neurobehavioral Systems)](https://help.imotions.com/lab/study-setup-and-design/other-tools/how-to-combine-imotions-with-presentation-neurobehavioral-systems.md)

\* Note that the setups for different external stimulus presentation tools vary. The help center articles referred to here discuss the setups for E-Prime and Presentation.

## Use event-receiving API to communicate event markers to iMotions with precision

For measuring the *accuracy* of the responses, a millisecond resolution is not necessary. However, for measuring the *response times* (i.e., from the moment the word appears on the screen until a response is given), a millisecond resolution is essential. The possibility to present stimuli and collect responses with a near-perfect resolution is one of the reasons to opt for working with external stimulus presentation software – Psychtoolbox in Matlab is a software that is specialized in exactly that.

It is possible to communicate this time information to iMotions over the API, and add ‘live markers’ to your data without any loss of precision; this is done by adding API commands to the Psychtoolbox experiment. Here, this was done to mark the precise onset of the words (C1, C2, C3, C4, C5, C6, C7, C8, and C9, i.e. referring to the different word-color combinations) and the precise response times; the response event further indicated whether the response was ‘correct’ or ‘false’.

![Slide2.PNG](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-34433368a01b535872ab67228de57f1b9db1cbe0%2Fe712c4d692_slide2-20-.webp?alt=media)

Read more: [Timestamping and synchronization method](https://help.imotions.com/lab/getting-started/multimodal-data-overview/timestamping-and-synchronization-method.md)

Read more: [How to create live markers and what for](https://help.imotions.com/lab/data-collection/creating-live-markers-during-data-collection.md)

## Use annotations to measure response times

If ‘live markers’ were recorded, it is possible to set the cursor to step per ‘marker’ and annotate the exact time from stimulus onset (i.e. the word appears on the screen) to response (i.e., the respondent presses a key to respond).

![Slide3.PNG](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-d27fe840fae16eb99e1f55ea1c245efd6fc8c7c8%2Fdfb9199158_slide3-21-.webp?alt=media)

Read more: [Annotations](https://help.imotions.com/lab/analysis/signal-processing-r-notebooks/my-library/annotations.md)

Read more: [How to create live markers and what for](https://help.imotions.com/lab/data-collection/creating-live-markers-during-data-collection.md)

## Example analysis

In this example analysis, we compare the accuracy and response times for congruent and incongruent words. Were the response times longer for incongruent words? Did the respondents make more mistakes? In other words: did we observe a ‘Stroop effect’?

To answer this question we first counted the correct and false responses – for congruent and incongruent words, respectively. Hereafter, we computed the average duration of the annotations for congruent and incongruent words.

![Slide4.PNG](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-bbea1615663bd34761a90034025499885a621b59%2F385d2c7570_image-1673617558089.webp?alt=media)

Yes, we observed a ‘Stroop effect’. For incongruent words, we observed more incorrect responses (**Reduced accuracy**) than for congruent words and the response times were, on average, longer (**Reduced response speed**).

\*Note that more than three respondents would be needed to draw statistically relevant conclusions; this analysis is merely an example.

## References

Stroop, J. R. (1935). Studies of interference in serial verbal reactions. *Journal of Experimental Psychology, 18*(6), 643–662.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/getting-started/demo-studies/8-1-demo-studies/demo-study-strooptest-psychology-experiment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
