[FieldTrip] ft_freqstatistics wrong permutation dimension (?)

Tim Guth Guth at mailbox.org
Wed Oct 7 17:44:44 CEST 2020


Dear community,


my name is Tim Guth and I am working at the University Clinic Freiburg 
on intracranial EEG data. I am relatively new to fieldtrip and have a 
question about the function ft_freqstatistics.

I tried using it to do a cluster-based permutation test over 
time-frequency powerspectrum data to compare successfull and 
non-successfull memory encoding intervals of equal length.

I obtained the following two data structures by applying ft_freqanalysis 
on EEG data from 943 separate channels, averaging the powerspectrum 
results over trials and then concatenating them in a for loop.

allChanSuccEnc =

   struct with fields:

     powspctrm: [943×50×751 double]
         label: {943×1 cell}
        dimord: 'chan_freq_time'
          time: [1×751 double]
          freq: [1×50 double]

allChanFailEnc =

   struct with fields:

     powspctrm: [943×50×751 double]
         label: {943×1 cell}
        dimord: 'chan_freq_time'
          time: [1×751 double]
          freq: [1×50 double]

I then executed ft_freqstatistics(cfg, allChanSuccEnc, allChanFailEnc) 
with the following configurations:

cfg                            = [];
cfg.method             = 'montecarlo';
cfg.statistic             = 'indepsamplesT'; % use paired ttest
cfg.correctm           = 'cluster';
cfg.clusteralpha     = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.neighbours       = [];
cfg.tail                     = 0;
cfg.clustertail        = 0;
cfg.alpha                = 0.025;
cfg.numrandomization = 500;
cfg.latency             = [0, 1.5]; % clusters during encoding period
cfg.neighbours      = [];
cfg.design               = [ones(1, size(allChanSuccEnc.powspctrm, 1)), 
ones(1, size(allChanFailEnc.powspctrm, 1)) * 2];
cfg.ivar                    = 1;

Unfortunately I get the following error message:

Error using ft_freqstatistics (line 180)
the length of the design matrix (1) does not match the number of 
observations in the data (2)

It seems like the function does not expect input with only one average 
trial where the permutation has to be done over channels. Do you have 
any idea how I can perform the permutation test with the channels (and 
not the trials) being permutet?

Thank you for your help

Tim



More information about the fieldtrip mailing list