Statistical comparisons in virtual electrode spectrograms

Piers Cornelissen p.cornelissen at PSYCH.YORK.AC.UK
Wed Nov 8 15:19:00 CET 2006

Dear all

Can anyone advise on the following:

I have 6 sets of virtual electrode data (from CTF based MEG recordings) 
from a total of 9 subjects, each of whom carried out 4 conditions of 

So far, for each virtual electrode I have succeeded (I hope) in computing 
group level spectrograms for each condition, where each spectrogram 
reflects either evoked or evoked+induced power changes.

What I would like to do is to a) compare spectrograms, and also b)compute 
statistics for each group level spectrogram to ask the question whether 
the power changes in the active window (0 - 700ms) are significantly 
different from the those in the passive/baseline window (-250 - 0 ms).

So far I have had alot of help from Jan, and, on his suggestion, I have 
copied out my query below, plus provided the matlab scripts which cause 
the problem:

The attached script E_versus_EI.m shows the code for 
analysing one condition from one particular virtual electrode. This gives 
the evoked as well as the evoked+induced spectrograms (as far as I 
understand it).

To carry out the comaprison between the evoked versus evoked+Induced test, 
I thought I should be able to modify the freqgrandaverage step for 
generating both iefgranfavg and efgrandavg by setting cfg.keepindividual 
to 'yes'. In doing so, I was hoping that this would retain the 9 separate 
powerspectra in each case, which it seems to have done. I was then hoping 
that this would be sufficient input to the second script test_clusrand.m 
(which is just a minor modification of  E_versus_EL.m). Certainly the  
powspctrm field for each dataset appears as: [4-D double] which I think is 

However, when I ran clusterrandanalysis on iefgranfavg and efgrandavg, I 
got the following errors:

cfg15 =

         statistic: 'depsamplesT'
       alphathresh: 0.0500
      makeclusters: 'yes'
         minnbchan: 2
   clusterteststat: 'maxsum'
            onetwo: 'twosided'
             alpha: 0.0500
        nranddraws: 100
           channel: {'V0'}

>> %cfg15.latency = [0 0.5]  % increases sensitivity if prior temporal 
information is  knowm
>> cfg15.frequency = [5 40];
>> %frange = 'all_freqs';  % file addition for saving
>> [clusrand] = clusterrandanalysis (cfg15, ind_efgrandavg, 
Selecting and formatting the data.
selected 1 channels
selected 191 time bins
selected 176 frequency bins
Calculating the neighbourhood structure of the channels.
??? Error using ==> clusterrandanalysis (getneighbgeometry)
Did not find gradiometer or electrode information.

Error in ==> /home/willis/plc/matlab/clusterrandanalysis.m
On line 473  ==> [cfg,data] = getneighbgeometry(cfg,data,varargin{1});


I noticed also that the way I used freqgrandaverage in order to compile 
the two datasets appeared to throw out the gradiometer information. At 
least there was a warning to this effect. So, I am guessing that using 
freqgrandaverage in this way is incorrect. Therefore please could anyone 
suggest how I compile my 2 sets of nine spectrograms in such a way that 
they provide appropriate input to clusterrandanalysis. Or, if as Jan seems 
to suggest, that clusterrandanalysis can't cope with virtual electrode 
data, does anyone have any other clever solutions.


Thanks in anticipation

Piers C

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_clusrand.m
Type: application/octet-stream
Size: 4665 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: E_versus_EI.m
Type: application/octet-stream
Size: 4809 bytes
Desc: not available
URL: <>

More information about the fieldtrip mailing list