freqstatistics; data 1versus data 2

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Tue Mar 24 15:01:20 CET 2009

Hi Michael

On 13 Mar 2009, at 17:35, Michael Wibral wrote:

> Dear all,
> I have a quick question concerning  freqstatistics(cfg, data1, data2):
> If I get a positive raw effect at some time t and frequency f that
> means that: data2(t,f) > data1(t,f), correct?
> It's a bit difficult to follow the transformation of data1, data2
> and the design variables through the code of the various layers of
> statfuns.

The raw effect (i.e. the difference in the mean value in both
conditions) is not computed by freqstatistics, only the statistic of
the effect (usually the t-value) and its significance. But a positive
t-value means that htere is a positive effect in the difference of the
mean values.

You could simply add the raw effect to the statfun, e.g. in
statfun_indepsamplesT by changing line 109 into

   s.stat   = (avg1 - avg2)./sqrt(varc);  % this is the t-value
   s.effect = (avg1 - avg2);              % this is the raw effect

any parameter that is returned by the statfun and that has the correct
size (meaning that it can be reshaped into the original 3D array) will
be automatically passed along to the outside of the function, i.e. to
the command line on which you call freqstatistics.

best regards

The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also and

More information about the fieldtrip mailing list