[FieldTrip] Question regarding nonparametric testing for coherence differences

Eric Maris e.maris at psych.ru.nl
Mon Sep 8 15:46:11 CEST 2014

Dear Hwee Ling,

In the paper you refer to (Maris et al, JNM, 2007), I did not perform a 
cluster-based permutation test at the level of the channel pairs. Instead, 
all coherences mentioned in the paper are coherence between a single EMG 
channel (2 electrodes mounted on the forearm) and all MEG electrodes. Thus, 
there are as many EMG-MEG coherences as there are MEG channels (275 in our 
lab), and the clustering of these coherences involves the same neighbourhood 
structure as the clustering of channel-specific statistics on power or 
evoked response. The analysis you propose involves clustering in a much more 
complex space, namely the formed by all (MEG,MEG) channel pairs 
(275*275=75625 pairs). In the early days of cluster-based permutation 
statistics, I have worked on this problem but did not pursue it because the 
resulting clusters are very hard to interpret.


Eric Maris

Dear all and Prof Maris,

I'm re-posting this question again, as I didn't get any replies previously.

I’m interested to investigate if there are any differences in phase 
synchronization in resting state data at timepoint 2 versus timepoint 1. The 
EEG data was collected using 64 EEG channels, resting state, eyes opened and 
eyes closed. I’ve arbitrarily segmented the resting state data into epochs 
of 2s each, and the epochs with artifacts are excluded completely from 
further analyses. I then performed mtmfft to get the fourier representation 
of the data, extracted the coherence, and compared the coherence difference 
of timepoint 2 versus timepoint 1 of all channels paired with all other 

I figured that if I extract the connectivity analyses without specifying the 
channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to 
perform cluster-based statistical analyses. I get an output with ‘chan_chan’ 
dimord variable. However, I was not 100% sure that this is correct, hence, I’ve 
inserted my code (see below). It’ll be great if you could tell me if what I’m 
doing makes any sense at all. Also, I don’t know how I can plot the results 
to see if it make any sense at all.

Also, I checked the values obtained from when I specified "cfg.channelcmb" 
and when I did not specify "cfg.channelcmb", I noticed that the values were 
somehow different. I would assume that the values to be similar, although 
I'm not sure why they would have differences in the values obtained from 
specifying "cfg.channelcmb".

This is my code that I've used thus far:

for sub = 1:5

    cfg                 = [];

    cfg.output          = 'fourier';

    cfg.channel         = {'all'};

    cfg.method          = 'mtmfft';

    cfg.keeptrials      = 'yes';

    cfg.tapsmofrq       = 5;

       cfg.foilim          = [0 100];

    cfg.taper           = 'dpss';

    % find the index for the c200 condition

   pre_c200_idx = find(data5.trialinfo == 201);

    cfg.trials          = pre_c200_idx;

    HLF_pre_c200         = ft_freqanalysis(cfg, data5);

post_c200_idx = find(data5.trialinfo == 200);

    cfg.trials          = post_c200_idx;

    HLF_post_c200         = ft_freqanalysis(cfg, data5);

cfg                 = [];

    cfg.keeptrials      = 'no';

    cfg.channel         = {'all'};

    cfg.removemean      = 'yes';

    cfg.method           = 'coh';

    HLF_pre_c200coh{sub}      = ft_connectivityanalysis(cfg, HLF_pre_c200);

    HLF_post_c200coh{sub}      = ft_connectivityanalysis(cfg, 



cfg_neighb.method = 'template';

cfg_neighb.layout = lay;

cfg_neighb.channel = 'all';

neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1});

cfg = [];

cfg.layout = lay;

cfg.neighbours = neighbours;

cfg.channel = 'all';

cfg.channelcmb = {cfg.channel, cfg.channel};

cfg.latency = 'all';

cfg.avgovertime = 'no';

cfg.avgoverchan = 'no';

cfg.parameter = 'cohspctrm';

cfg.method = 'montecarlo';

cfg.statistic = 'depsamplesT';

cfg.correctm = 'cluster';

cfg.tail = 0;

% cfg.clustertail = 0;

cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency 

cfg.numrandomization = 10000;

cfg.ivar = 2;

cfg.uvar = 1;

% design matrices

clear design;

design(1,:) = [1:5, 1:5];

design(2,:) = [ones(1,5), ones(1,5) * 2];

cfg.design = design;

% for theta band

cfg.avgoverfreq = 'yes';

cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), 
alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), 
and gamma (40-100).

[diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, 

When I tried to plot the results, I used this code:

cfg = [];

cfg.channel = 'all';

cfg.layout = 'lay';

cfg.zlim = [-1 1];

cfg.alpha = 0.05;

cfg.refchannel = 'all';

ft_clusterplot(cfg, diffc200_theta_stat);

However, I was not sure how I could plot the results. I get an error message 
from Fieldtrip when using ft_clusterplot:

Error using topoplot_common (line 366)

no reference channel is specified

Error in ft_topoplotTFR (line 192)

[cfg] = topoplot_common(cfg, varargin{:});

Error in ft_clusterplot (line 372)

      ft_topoplotTFR(cfgtopo, stat);

According to your paper in 2007, the topoplot of the results were masked by 
the spatio-spectral pattern of the significant clusters. I don't know how to 
do this, and I would really appreciate if you can show me how to make such a 

Thank you very much.

Kind regards,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140908/98b85280/attachment-0001.html>

More information about the fieldtrip mailing list