[FieldTrip] Technical issue with cluster based selection of electrodes (ft_freqstatistics)

Tertikas, Georgios georgios.tertikas at kcl.ac.uk
Fri Sep 11 15:01:21 CEST 2020


Hi Jan-Mathijs,

Thank you very much for your fast reply and your input. I apologize for the format of the data, I will keep in mind your advice for the future.

Unfortunately I tried to put non-grand averaged input ( cell {12,1} containing one structure of TFR data from each participant) and the input I got was:

Error using ft_checkdata (line 529)
This function requires freq data as input, see ft_datatype_freq.

Error in ft_freqstatistics (line 97)
  varargin{i} = ft_checkdata(varargin{i}, 'datatype', 'freq', 'feedback', 'no');

Would you happen to know an alternative?

Thank you once again,

George

Από: fieldtrip <fieldtrip-bounces at science.ru.nl> για λογαριασμό του "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
Απάντηση σε: FieldTrip discussion list <fieldtrip at science.ru.nl>
Ημερομηνία: Παρασκευή, 11 Σεπτεμβρίου 2020 - 13:41
Προς: FieldTrip discussion list <fieldtrip at science.ru.nl>
Θέμα: Re: [FieldTrip] Technical issue with cluster based selection of electrodes (ft_freqstatistics)

Hi Georgios,

The issue you are facing, is that you input grandaveraged data into ft_freqstatistics, which does not contain the individual subject estimates anymore. So indeed, as you already suspected yourself, there’s something wrong with the input into the function. Once the individual subject dimension is gone, it is impossible to compute a group-level T-statistic, let alone a corresponding critical value for clustering.

Indeed, once I managed to download the wetransfer files and load in one of the files, which nearly crashed my matlab because of its uncompressed size, it looks as if you are using the wrong variable as input to the statistics function.

Just for future reference, please only save (and upload) the variables that are needed to reproduce your problem, rather than your full matlab workspace).

Best wishes,
Jan-Mathijs



On 11 Sep 2020, at 11:56, Tertikas, Georgios <georgios.tertikas at kcl.ac.uk<mailto:georgios.tertikas at kcl.ac.uk>> wrote:

Hi List,

I am currently analyzing EEG data looking at alpha band frequencies.

I am analyzing TFR sequences from 12 participants for left and right stimuli (2 conditions) and I want to isolate the electrodes that show differential activation between the two conditions. As such I have been trying to perform cluster based selection of electrodes but I receive the following error message when using ft_freqstatistics:

Error using ft_statistics_montecarlo (line 242)
could not determine the parametric critical value for clustering

Error in ft_freqstatistics (line 193)
  [stat, cfg] = statmethod(cfg, dat, design);

Could someone aid me in that? I am also not entirely sure whether grand averaged data will be useful in my case but that is what is suggested in the official site.

My code up to this point is the following:

%% compute the cluster based statistics
cfg = [];

cfg.channel          = {'Fp1';'Fz';'F3';'FT9';'FC5';'FC1';'C3';'T7';'TP9';'CP5';'CP1';'Pz';'P3';'P7';'O1';'Oz';'O2';'P4';'P8';'TP10';'CP6';'CP2';'C4';'T8';'FT10';'FC6';'FC2';'F4';'F8';'AFz';'F1';'F5';'FT7';'FC3';'C1';'C5';'TP7';'CP3';'P1';'P5';'PO7';'PO3';'POz';'PO4';'PO8';'P6';'P2';'CPz';'CP4';'TP8';'C6';'C2';'FC4';'FT8';'F6';'AF4';'F2';'FCz'};
cfg.latency          = [0.8 1.15];
cfg.frequency        = 'all';
cfg.method           = 'montecarlo';
cfg.statistic        = 'ft_statfun_depsamplesT';
cfg.correctm         = 'cluster';
cfg.clusteralpha     = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan        = 2;
cfg.tail             = 0;
cfg.clustertail      = 0;
cfg.alpha            = 0.025;
cfg.numrandomization = 1000;
% specifies with which sensors other sensors can form clusters

cfg.neighbours       = neighbours

subj = 12;
design = zeros(2,2*subj);
for i = 1:subj
  design(1,i) = i;
end
for i = 1:subj
  design(1,subj+i) = i;
end
design(2,1:subj)        = 1;
design(2,subj+1:2*subj) = 2;

cfg.design   = design;
cfg.uvar     = 1;
cfg.ivar     = 2;

[stat] = ft_freqstatistics(cfg,grand_averaged_11_TFR ,grand_averaged_12_TFR)


And the output that I receive is:

cfg =

  struct with fields:

             channel: {58×1 cell}
             latency: [0.8000 1.1500]
           frequency: 'all'
              method: 'montecarlo'
           statistic: 'ft_statfun_depsamplesT'
            correctm: 'cluster'
        clusteralpha: 0.0500
    clusterstatistic: 'maxsum'
           minnbchan: 2
                tail: 0
         clustertail: 0
               alpha: 0.0250
    numrandomization: 1000
          neighbours: [1×66 struct]

the call to "ft_selectdata" took 1 seconds and required the additional allocation of an estimated 22 MB
using specified neighbours for the channels
there are on average 6.8 neighbours per channel
the call to "ft_prepare_neighbours" took 0 seconds and required the additional allocation of an estimated 5 MB
using "ft_statistics_montecarlo" for the statistical testing
using "ft_statfun_depsamplesT" for the single-sample statistics
constructing randomized design
total number of measurements     = 2
total number of variables        = 24
number of independent variables  = 1
number of unit variables         = 1
number of within-cell variables  = 0
number of control variables      = 0
using a permutation resampling approach
repeated measurement in variable 1 over 1 levels
number of repeated measurements in each level is 2
the maximum number of unique permutations is 2
Warning: cfg.numrandomization is larger than the maximum number of unique permutations, better use 'all'
generated 1000 random permutations
computing a parametric threshold for clustering
Error using ft_statfun_depsamplesT (line 83)
The data must contain at least two units of observation (trials or subjects).
Error using ft_statistics_montecarlo (line 242)
could not determine the parametric critical value for clustering

Error in ft_freqstatistics (line 193)
  [stat, cfg] = statmethod(cfg, dat, design);


This is a wetransfer link with my data and with a mat file that I have created for the specific electrode array that I have (acticap_64).

https://we.tl/t-Jqn4HBFNzf<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwe.tl%2Ft-Jqn4HBFNzf&data=01%7C01%7Cgeorgios.tertikas%40kcl.ac.uk%7C169b94c1018147156d8908d8564fef23%7C8370cf1416f34c16b83c724071654356%7C0&sdata=ahWoHXNH0218zr36G%2FQjdl7nGJ7lDOYGwj1ovT%2BV6y4%3D&reserved=0>

Thank you very much in advance for your help.



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7Cgeorgios.tertikas%40kcl.ac.uk%7C169b94c1018147156d8908d8564fef23%7C8370cf1416f34c16b83c724071654356%7C0&sdata=9zkBFewuTQ45Gc2oL7IiaPQJR93jxPvSmyHe6ne9%2BcM%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=01%7C01%7Cgeorgios.tertikas%40kcl.ac.uk%7C169b94c1018147156d8908d8564fef23%7C8370cf1416f34c16b83c724071654356%7C0&sdata=Adao04QSrNdSuxImlmxXmK902oZdiEeZu6W2iI5l0jI%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200911/c7e89819/attachment.htm>


More information about the fieldtrip mailing list