[Eeglablist] ERSP Difference of 2 conditions across frequency bands

Delorme, Arnaud adelorme at ucsd.edu
Fri Aug 14 18:58:40 PDT 2020


Dear Deepika,

> [erspDiff1,itcDiff1,powbaseDiff1,timesDiff1,freqsDiff1,erspbootDiff1,itcbootDiff1, tfdataDiff1] = newtimef({Post1.data(Post1E59,:,:) Pre1.data(Pre1E59,:,:)}, Pre1.pnts, [1000*Pre1.xmin 1000*Pre1.xmax], Pre1.srate);
> 
> Now I am looking to analyze these ERSPDiff and erspAvgAll values averaged across frequency bands. If I run newtimef() to get ERSPs for a single subject, I can add parameters like 'freqs', [4 30] to only output frequencies of a certain range, but when I try to add parameters when using newtimef() for two conditions, I am unable to do so.

This should work, but you can always select frequency after the facts

[~,fInd1] = min( abs(freqsDiff1 - yourlowfreq ));
[~,fInd2] = min( abs(freqsDiff1 - yourhifreq ));

erspAvgAll = erspAvgAll(fInd1:fInd2,:);
tftopo(erspAvgAll, timesDiff1, freqsDiff1(fInd1:fInd2)); % replot the time-frequency decomposition

> I am also now thinking that in order to get statistical measures from eeglab, I should use a STUDY.

You should definitely use STUDY which has replaced this feature of newtimef and allow for more than 2 conditions, and more flexible statistical analysis.

> I can create a study by loading all my datasets, re-epoching them so all epochs are the same length, and then creating a study with the re-epoched data. However, every time I try to compute ERSPs through 'pre-compute channel measures', I get 'Error while calling function, check syntax'. I am not sure where this error is as I am using the pre-set parameters.

Yes, this is the way to go. The error in syntax is due to the optional parameters you enter. Which version of EEGLAB are you using?

> 2) How can I use STUDY to look at ERSPs across specific frequency bands for the difference of two conditions?

For difference between condition, you will still have to do it on the command line (take the output of std_erspplot) as even STUDY does not plot the difference.

Best wishes,

Arno




More information about the eeglablist mailing list