[Eeglablist] Subtracting conditions and statistics
Arnaud Delorme
arno at ucsd.edu
Wed Mar 30 19:21:42 PDT 2011
Dear Veronique,
you cannot subtract ERP averages between conditions yet in EEGLAB graphic interface. You will need to use command line tools. Let's say you want to do a 2x2 repeated measure ANOVA on your MMN. The easiest in EEGLAB itself would be to create a design (using the graphic interface) with all of your conditions 2 x 4 with
A B C D
E F G H
with you MMN equal
A-B C-D
E-F G-H
Then compute the ERP in the graphic interface and simply plot the ERP of all the conditions using the EEGLAB GUI. This will load all the ERPs in memory of all subjects for you 2x4 design in memory. Typing eegh will also look up the relevant commands from the command line if you want to write an automated script in the future. The ERP data is in
STUDY.changrp(X).erpdata
where X is the channel index you are interested in.
or
STUDY.cluster(X).erpdata
if you are working with independent component clusters.
Let's consider the channel case (for channel X). STUDY.changrp(X).erpdata will be a cell array containing 2x4 arrays of ERPs
128x16 128x16 128x16 128x16
128x16 128x16 128x16 128x16
where 128 is the number of data points and 16 is your number of subjects (for example). Note that STUDY.changrp(X).erptime contains the time indices (1x128). Now you will compute the MMN and run statistics:
erp = STUDY.changrp(X).erpdata;
myMMNdata = { erp{1,1}-erp{1,2} erp{1,3} erp{1,4};
erp{2,1}-erp{2,2} erp{2,3} erp{2,4} };
[F df pvals] = statcond(myMMNdata); % computes repeated measure ANOVA
panovavals = pvals{3}; % the ANOVA is stored in the last array, see statcond help for more info
panovavals_corrected = fdr(panovavals); % apply False Discovery Rate to compensate for multiple comparisons
figure; plot(STUDY.changrp(X).erptime, -log10(panovavals_corrected)); % plot p-values across time
The last plot indicates the number of decimal in your p-value for all time indices (a value of 1 means that p=0.1, a value of 2 means that p=0.01, a value of 3 means that p=0.001 etc...). I personally like this representation. You may also change the call to statcond() to use permutation for your statistics.
Hope this helps,
Arno
On Mar 25, 2011, at 10:16 AM, Veronique Boulenger wrote:
> Dear EEGLab users,
>
> I am new to EEGlab so I apologize in advance if answers to my questions
> are obvious. I ran an MMN experiment and would like to subtract 2
> conditions to compute a difference waveform (i.e. the MMN). I managed to
> plot the MMN using Sum/Compare ERPs from the Plot menu but I don't know
> how to save it as a "new condition" (to do some stats afterwards). Can
> anyone help?
>
> Also, I would like to do an ANOVA to compare MMN latency and amplitude
> between 2 types of contrasts and 2 groups of subjects (2x2 design). For
> this, I'd like to extract numerical values for peak latency and peak
> amplitude in a given time-window. Does anyone know how to do it with EEGlab?
>
> Many thanks in advance for your help!
>
> Cheers,
> Veronique Boulenger
>
> --
> Véronique Boulenger, PhD
> Chargée de Recherches CNRS
> Laboratoire Dynamique du Langage – UMR 5596
> Institut des Sciences de l’Homme
> 14 avenue Berthelot
> F69363 Lyon Cedex 07
>
> (33) 04.72.72.79.24
> (33) 04.72.72.65.90
> veronique.boulenger at ish-lyon.cnrs.fr
> http://www.ddl.ish-lyon.cnrs.fr/Annuaires/Boulenger
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
More information about the eeglablist
mailing list