[FieldTrip] Question on coherence stats at sensor level

David Pedrosa david.pedrosa at ndcn.ox.ac.uk
Wed Mar 2 12:39:17 CET 2016


Hi Jorn,

thanks for the fast help! It was as you suggested.

Now, I have a different issue someone might be able to help me with. When I do the analyses as explained, fieldtrip tells me that cluster stats are not possible as there are no labels in the data. This of course makes sense as it is coherence data with a labelcmb instead of label structure. Is there a way to do the cluster correction in fieldtrip with coherence data anyway? Or would it make more sense to take the raw fourier data into ft_freqstatistics and do the stats as desired in a custom statfun function with the corrections as wanted, e.g. similar to indepsamplesZcoh but for between subjects analyses?

Best
David


________________________________
Dr. David Pedrosa

Clinical Research Fellow
Medical Research Council Brain Network Dynamics Unit at the University of Oxford
Nuffield Department of Clinical Neurosciences
University of Oxford
Level 6, West Wing
John Radcliffe Hospital, OX3 9DU
Tel: +44 (0)1865 572490
E-Mail: david.pedrosa at ndcn.ox.ac.uk

http://www.mrcbndu.ox.ac.uk/<https://owa.nexus.ox.ac.uk/owa/redir.aspx?C=E40BwPuNq0uXQGSOPDW39AmtYlwBR9IIjsI0PRu9uuTE46jeZnqjmG6XP02rBAUiF1EnCJtn3UU.&URL=http%3a%2f%2fwww.mrcbndu.ox.ac.uk%2f>
________________________________
Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Jörn M. Horschig [jorn at artinis.com]
Gesendet: Dienstag, 1. März 2016 16:20
An: 'FieldTrip discussion list'
Betreff: Re: [FieldTrip] Question on coherence stats at sensor level

Hi David,

The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?).
I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use.  The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun.

All the best,
Jörn

--
Jörn M. Horschig, PhD, Software Engineer
Artinis Medical Systems<http://www.artinis.com/>  |  +31 481 350 980

From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa
Sent: Tuesday, March 1, 2016 16:22
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] Question on coherence stats at sensor level

Dear list,

I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead?

Here's the used code I use:

                %% for loop normalizing coherence manually and creating 0-coherence data...
                coh_diff{1,1} =  coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ...
                coh_diff_null{1,1}.cohspctrm(:) =  0;

                cfg = [];
                cfg.channel                   = {'EEG' 'xEDC'};
                cfg.parameter               = 'cohspctrm';
                cfg.method                   = 'montecarlo';
                cfg.statistic                   = 'diff';
                cfg.tail                          = 0;
                cfg.clustertail                 = 0;
                cfg.alpha                       = .025;
                cfg.numrandomization    = 500;

                cfgl = [];
                cfgl.layout  = 'brainamp.sfp';
                cfg.layout   = ft_prepare_layout(cfgl);

                cfg.computestat          = 'yes';
                cfg.correctm               = 'cluster';
                cfg.clusteralpha          = .05;
                cfg.clusterstatistic       = 'maxsum';
                cfg.minnbchan            = 2;

                cfgn = [];
                cfgn.method = 'distance';
                cfgn.neighbourdist = 40; %in mm
                cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo);

                design = zeros( 2,2*numel(coh_diff));
                design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)];
                design(2,1:numel(coh_diff)) = 1;
                design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2;

                cfg.design = design;
                cfg.ivar  = 1;
                cfg.uvar = 2;
                [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12};

Thanks for your help.
Best,
David

________________________________
Dr. David Pedrosa

Clinical Research Fellow
Medical Research Council Brain Network Dynamics Unit at the University of Oxford
Nuffield Department of Clinical Neurosciences
University of Oxford
Level 6, West Wing
John Radcliffe Hospital, OX3 9DU
Tel: +44 (0)1865 572490
E-Mail: david.pedrosa at ndcn.ox.ac.uk<mailto:david.pedrosa at ndcn.ox.ac.uk>

http://www.mrcbndu.ox.ac.uk/<https://owa.nexus.ox.ac.uk/owa/redir.aspx?C=E40BwPuNq0uXQGSOPDW39AmtYlwBR9IIjsI0PRu9uuTE46jeZnqjmG6XP02rBAUiF1EnCJtn3UU.&URL=http%3a%2f%2fwww.mrcbndu.ox.ac.uk%2f>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160302/650c3572/attachment.html>


More information about the fieldtrip mailing list