ERP pipeline · PSYCH 390 step 7 / 11

Bin Assignment and Epoching

How do you make good bins?

Figure 1

Bin Assignment With BINLISTER and Epoch Extraction

Presets

    bin 1 bin 2 bin 3 bin 4 unassigned event (hover for the reason)

    The recording and event list are simulated; the parser implements only the subset of the bin descriptor syntax used in this course.

    What You Are Looking At

    Every time a word appeared on the screen or the participant pressed a button, the stimulus computer stamped a number into the EEG file. These event codes are the experiment's bookkeeping. In the N400 task the target word carries a three-digit code: 111 for a related target with a correct response, 112 related but wrong, 121 unrelated correct, 122 unrelated wrong. The small 11 and 12 flags are prime words, 201 and 202 are the button presses, and "boundary" marks a place where the recording was paused. The gray trace in Panel A is one channel of the continuous EEG, which by itself tells you nothing about conditions.

    A bin is a condition defined by a sequence of codes. The text box on the left is a bin descriptor file: each bin has a number, a label, and a descriptor line that lists the codes in braces, separated by semicolons. The dot marks the time-locking event, the moment that becomes time zero of every epoch. BINLISTER walks through the event list, and every event that fits a bin is colored with that bin's color and given an epoch window, here −200 to 800 ms. Events that fit nothing stay gray; hover one to see why. In Panel B, the epochs are cut out, baseline-corrected on the prestimulus part, stacked as thin lines, and averaged into the heavy line, so you can see the unrelated bin come out more negative between 300 and 500 ms.

    Try This

    1. Start from the lab default. Both bins collect 60 trials, and the checklist is all green.
    2. Click Correct trials only via response window. The descriptor .{111}{t<200-1000>201} now requires a correct button press between 200 and 1000 ms after the target. Hover the gray targets to find responses that were too fast to be real decisions or too slow to be trusted.
    3. Split by accuracy into four bins. The error bins have far too few trials to average, and that is the reason the lab default collapses across accuracy.
    4. Try the typo preset. Code 131 exists nowhere in the recording, so the bin stays empty and trialsperbin reports zero. A zero here almost always means the file and the recording disagree about a code.
    5. Delete the blank line between the two bins (or click Missing blank line) and read the error message. Then widen the epoch to −500 to 1200 ms and watch a few epochs near a boundary get dropped.

    Why It Matters for the Pipeline

    Bin assignment is where the experimental design meets the data. EEG = pop_binlister(EEG, 'BDF', 'N400_bins.txt', 'IndexEL', 1, 'SendEL2', 'EEG', 'Voutput', 'EEG'); reads the descriptor file and stores the result in EEG.EVENTLIST; EEG = pop_epochbin(EEG, [-200 800], 'pre'); then cuts a fixed window around each time-locking event and subtracts the mean of the prestimulus baseline from every epoch, so slow drift and DC offsets do not carry into the average. Always look at EEG.EVENTLIST.trialsperbin afterwards. Somewhere between 50 and 200 trials per bin is typical; fewer than about 30 leaves a noisy average, and zero means a code mismatch.

    A time-conditioned list such as {t<200-1000>201} keeps only trials with a proper response. Responses faster than 200 ms are guesses that started before the word was read, and responses slower than a second usually mean a lapse of attention. Whether to drop error trials at all depends on why errors happen. In a simple task an error is usually a lapse, so dropping them cleans the data. In a hard memory task errors are genuine outcomes, and throwing them away changes the question. Good bins are numbered consecutively from 1, carry a label that says what they contain, differ from each other only in the thing you care about, and end up with similar trial counts (Luck, 2014; Lopez-Calderon & Luck, 2014). The codes follow the convention used in the lab guide for the ERP CORE N400 data (Kappenman et al., 2021).

    References

    Kappenman, E. S., Farrens, J. L., Zhang, W., Stewart, A. X., & Luck, S. J. (2021). ERP CORE: An open resource for human event-related potential research. NeuroImage, 225, Article 117465. https://doi.org/10.1016/j.neuroimage.2020.117465

    Lopez-Calderon, J., & Luck, S. J. (2014). ERPLAB: An open-source toolbox for the analysis of event-related potentials. Frontiers in Human Neuroscience, 8, Article 213. https://doi.org/10.3389/fnhum.2014.00213

    Luck, S. J. (2014). An introduction to the event-related potential technique (2nd ed.). MIT Press.