[Eeglablist] Subtracting conditions

Kaelasha Tyler kaelasha.tyler at gmail.com
Sun Jan 3 14:17:53 PST 2021

Hi all,

Will the following work to subtract the eeg/ERP in one condition
(ALLEEG(1)), from the eeg/ERP in another (ALLEEG(2)):



eeglab redraw

In this case, I have two data sets loaded into EEGlab: ALLEEG(1) and
These are the eeg trials in the two different conditions, both are aligned
to the same specific time point and contain an identical number of
trials, data points etc.
I created ALLEEG(3) as a replica of ALLEEG(2) in order to house the new
Then I replace ALLEEG(3).data with the data created by subtracting the two
ALLEEG(3) is what I hope the ERP subtracted data to be. Eg, when I plot
channel ERPs for ALLEEG(3) I hope these will be the resulting event related
potentials of one condition subtracted from the other.
If needed, I will run an ICA on ALLEEG(3) afterwards, to create new
components based on the subtracted data.

WIll this work? Are there any problems with subtracting data this way?

I see some previous email threads regarding subtracting conditions, using
ERPlab and command window scripting using the Study structure.
However I would like to keep it simple and use a small script without
resorting to creating a study structure or using ERPlab.

Thanks in advance,

More information about the eeglablist mailing list