Creating epochs between two event codes (stimulus and response)

Hi everyone,

I am attempting to epoch data that I have imported into Python from EEGLAB .set files. I am just beginning to use MNE - I am accustomed to using EEGLAB’s bin assignment and epoching functions, which allow me to create a bin between two event codes and then create epochs within a specific timeframe. However, I cannot figure out how to achieve this using MNE.

For example, I have several stimulus codes (e.g., 3, 4, 5, 6) and two response codes (1 = correct response, 2 = incorrect response). How can I create an epoch that pairs the stimulus codes with the response type, which I can then trim down to -200 to +800 ms?

I’m using MNE version 1.10.2 on Windows 11.

Thank you for your help,

Lauren

Edit: I’ve managed to edit the metadata according to this link so that there is a column for correct/incorrect responses and rows corresponding to the stimulus type. I’m still confused about how to meaningfully join these together such that the stimulus type is tied to the response. I plan to decode the data depending on the stimulus type AND response.

I’m not sure I understand exactly what you are trying to do, but did you create the epochs with mne.Epochs as mentioned in the tutorial you have linked? If you already have a column for correct/incorrect responses in your metadata (let’s call that column response_correct), then you should be able to get the correct epochs with epochs["response_correct"] and the incorrect epochs with epochs["not response_correct"].