Skip to content

Studio Tutorial: Making Difference Waves and Other Bin Operations

David Railton Garrett edited this page Apr 18, 2024 · 3 revisions

Our next step will be to add an unrelated-minus-related difference wave to the grand average. This will isolate the N400 effect, subtracting out any brain activity that is equivalent for the unrelated and related targets.

Make sure the grand average ERPset (named grand) is still selected in the ERPsets panel. Now go to the Bin Operations panel. The top part of the panel is a text area with several lines. On the first line, type the following: bin5 = bin4 - bin3 label unrelated-minus-related (as shown in the screenshot below). This is an equation that tells ERPLAB to create a new bin (bin 5) and make it equal to bin 4 (unrelated trials) minus bin 3 (related trials) with a bin label of “unrelated-minus-related”. This is a very simple equation, and much more complex equations can be used when desired (see the ERP Bin Operations page in the ERPLAB Manual).

Bin Operations

We’re using the “Modify Existing ERPset” mode, which allows us to simply add a new bin to the set of existing bins. If we wanted to do something more complicated, like deleting bins or changing the contents of existing bins, we would typically use the “Create New ERPset” mode.

Click Run to add the new bin to the grand ERPset. If you look in the Bin & Channel Selection panel, you can see there is now a Bin 5, labeled unrelated-minus-related (see screenshot).

Bin & Channel Selection

Select Bins 3-5 and click Apply so that you can plot the difference wave (Bin 5) overlaid with the parent waves (Bins 3 and 4). The results should look like the screenshot below. Note that there is no standard error shading for the difference wave. When you create a new bin from an equation, ERPLAB doesn’t know what the standard error should be for this new bin.

Grand + Difference Wave

However, it would be nice to see the standard error of the difference wave. The easiest way to see this is to make the difference wave for each participant and then compute the grand average. The standard error is computed by default for each bin when you make a grand average, so this will allow us to see the standard error of the difference wave.

To accomplish this, first click Clear in the ERPsets panel to eliminate the existing grand average. Now select the ERPsets for the six participants in the ERPsets panel. If you go to the Bin Operations panel, the equation for making the difference wave should still be there. If it’s not, enter it again. Now click Run in the Bin Operations panel. This will apply the equation to all six selected ERPsets. You can verify that it worked by looking for the new bin (Bin 5) in the Bin & Channel Selection panel.

Note that the updated ERPsets have not been saved to disk. That is, the new bin is present only in the versions stored in RAM. If you wanted to save the updated ERPsets to disk, you could click the Save button in the ERPsets panel (assuming that all six ERPsets are still selected).

Now you can make a grand average of the updated ERPsets by making sure all ERPsets are selected, going to the Average Across ERPsets panel, clicking Run, and naming the new ERPset grand (just as you did before, except that it’s a good idea to save the grand average to disk for later steps in the tutorial). Select Bins 3-5 in the Bin & Channel Selection panel, and now you will see that the difference wave in grand has standard error shading around it (see screenshot below).

Grand + Difference Wave + SEM

Data Quality Metrics for Difference Waves

If you go to the View Data Quality Metrics panel and click Show in a table, you will see that standardized measurement error (aSME) values are present only for bins 1-4, not for the difference waves in bin 5. For bins 1-4, the Average Across ERPsets function took the single-subject aSME values from these bins and combined them together to create the aSME values for the grand average. However, there were no aSME values for bin 5 in the single-participant ERPsets (because the Bin Operations function did not “know” how to estimate the aSME values for the different waves). Therefore, there were no aSME values to combine when the grand average was created.

For mathematically derived values, such as difference waves or averages across multiple electrode sites, a procedure called “bootstrapping” must be used to estimate the standardized measurement error, and this currently requires scripting. Bootstrapping is described in our paper on the SME, and we have provided several examples of bootstrapping scripts.

By contrast, the standard error at each individual time point in the grand average is not created by using the single-subject standard errors. Instead, the standard errors in the grand average are computed by taking the standard deviation of the single-subject voltages at a given time point and dividing by the square root of the number of ERPsets being averaged together.


Previous Page Next Page 🏠
◀️ Grand Average Filtering ERPs ▶️ Home
Part 1 Part 2 Part 3 Part 4
General Overview Filtering EEG Plotting ERPs Shifting Event Codes
Importing EEG Data The EventList ERP Information Epoch Continuous EEG
Example Experiment BINLISTER Grand Average Spectral Data Quality
Load and View Data Epoch and Baseline ➡️ Bin Operations Channels and Locations
Artifact Detection Filtering ERPs Re-Sampling; Re-Epoching
Averaging (ERPs) Averaging (Channels) Converting to CSD
Artifact Correction Channel Operations
Interpolation Measurement Tool
Clone this wiki locally