Statistical comparisons in virtual electrode spectrograms

Jan Mathijs Schoffelen Jan.Schoffelen at FCDONDERS.RU.NL
Wed Nov 8 16:15:34 CET 2006

Hi Piers and Eric,

Eric, you're absolutely right in the case one would analyze sensor-data.
However, Piers is working on virtual channel data, so the actual
neighbourhood structure does not exist at all, and should be defined such
that none of the channels actually has a neighbour.



-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Eric Maris
Sent: Wednesday, November 08, 2006 4:06 PM
Subject: Re: [FIELDTRIP] Statistical comparisons in virtual electrode

Hi Piers,

I think this is an easy problem to solve. In fact, you are not the first
person to stumble over it. The cause of the problem is that freqgrandaverage
throws away the gradiometer configurations (the .grad-fields) that are
present in each of the subject-specific data structures produced by

The solution is simple: Copy a .grad-field from one subjects (it does not
matter which one) to ind_efgrandavg and rerun clusterrandanalysis. In the
analysis, this .grad-field is only used to calculate the

Good luck,

Eric Maris

> -----Original Message-----
> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On
Behalf Of
> Piers Cornelissen
> Sent: Wednesday, November 08, 2006 3:19 PM
> Subject: [FIELDTRIP] Statistical comparisons in virtual electrode
> 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
> interest.
> 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
> correct.
> 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,
> ind_iefgrandavg);
> 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.
> Please!
> Thanks in anticipation
> Piers C

More information about the fieldtrip mailing list