Within-subject coherence statististics for virtual sources

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed Nov 8 21:17:53 CET 2006

Hi Lorina

On 8 Nov 2006, at 20:00, Lorina Naci wrote:
> I tried to run the script as you suggested but it did not work. The
> error message I get is to do with
> [stat] = statistics_wrapper(cfg, varargin{:}). It just gives me an
> error message pointing to this line,saying: error using
> fieldtrip-20061003/private/statistics_wrapper, could not determine
> the type of input data.

Then it means that the data structure that you have obtained from
besa2fieldtrip is not recognized. It is also not clear to me how your
data looks like (i.e. as a Matlab structure). It is virtual channel
data, time-frequency analyzed, and then single trial coherences

Could you show the output that you get on screen after

dataA = besa2fieldtrip('filenameA.tfc')   % i.e. without semicolon,
to show the output on screen
dataB = besa2fieldtrip('filenameB.tfc')   % i.e. without semicolon,
to show the output on screen

> Also, the function 'cfg.numrandomization' requires a number, but I
> am not sure what the choice of the number depends on? I've inputed
> 500 as in the documentation example.

That is the number of resamplings that is used to construct the
reference distribution, 500 should be fine.

> Finally, at risk making my ignorance of how Fieldtrip works
> entirely transparent, I am not quite sure how the function you send
> me 'statfun_diff.m' links with the 'freqstatistics.m,' and whether
> I do need to use it?

You just have to put it on your Matlab path somewhere, and you specify
   cfg.statistic ='diff'
in freqstatistics. In general by specifying cfg.statistic='xxx', the
function statfun_xxx will be called. Please look in the function
statfun_diff.m to see how the statistic for each sample (=time-
frequency-channel point) is computed.

best regards,

More information about the fieldtrip mailing list