[FieldTrip] clusterstat on multiple frequencies

Matt Mollison matt.mollison at gmail.com
Tue Dec 13 18:47:40 CET 2011


Hi Zita,

I have not used this method much, but it actually is possible to plot
clusters without averaging over the frequency dimension
using ft_multiplotTFR (where cfg.avgoverchan = 'no'; cfg.avgovertime =
'no'; cfg.avgoverfreq='no'; in your statistical test—so you'll get space,
time, and frequency information). You can also highlight the significant
portions of time and frequency space, using cfg.mask='yes',
cfg.maskparameter='mask', and set a cfg.maskalpha. Do keep in mind that
there are important reasons for averaging over frequency, as Dr. Maris
described in this post (specifically, to increase power): <
http://mailman.science.ru.nl/pipermail/fieldtrip/2010-November/003312.html>.

Cheers,
Matt

--
Univ. of Colorado at Boulder
Dept. of Psychology and Neuroscience
matthew.mollison at colorado.edu
http://psych.colorado.edu/~mollison/

On Tue, Dec 13, 2011 at 10:10 AM, Zita Eva Patai <eva.patai at psy.ox.ac.uk>wrote:

> Dear Jan-Mathijs,
>
> Thank you for that, it makes a lot more sense. I figured the data was too
> complex for display, so I will average over frequencies as you suggested,
> as I am interested in an effect that would encompass that range anyway...
>
> Thank you again and happy holidays!
>  z
>
> On Tue, Dec 13, 2011 at 4:22 PM, jan-mathijs schoffelen <
> jan.schoffelen at donders.ru.nl> wrote:
>
>> Hi Zita,
>>
>> OK. I now understand the point. ft_clusterplot throws an error because it
>> does not know how to collapse across frequencies. If the clusters have
>> spectral extent (as well as spatial extent) it's a non-trivial question
>> what are the channels to be plotted, because different channels can
>> contribute different time and frequency points to the significant cluster.
>> The time points are dealt with because ft_clusterplot shows the cluster
>> evolving over time; the frequencies are not dealt with. FieldTrip does not
>> make the choice of which channels to highlight for you (should all
>> frequencies be significant for a given time point, or only one, or just a
>> few?) and thus throws an error. However, if you have a priori reasons to
>> expect your effect to occur in a particular frequency range (as you seem to
>> do, because of your specification of the cfg before calling
>> ft_freqstatistics), you can also specify cfg.avgoverfreq to 'yes', yielding
>> a single observation per channel (and by construction the clustering only
>> occurs over channels), making the plotting trivial.
>>
>> I hope this helps.
>>
>> BW,
>>
>> JM
>>
>>
>>
>> On Dec 12, 2011, at 12:22 PM, Zita Eva Patai wrote:
>>
>> Dear Jan-Mathijs,
>>
>> Sorry I was so vague, i thought maybe it was a common problem...
>>
>> OK, so i was running a clusterstat with the following input ( main point,
>> i want to look at the difference between conditions over a set of
>> frequencies)
>> ***
>> load blk1_tf_avg
>> load blk3_tf_avg
>>
>> cfg = [];
>> cfg.latency          = [1.0 1.5 ];
>> cfg.frequency        = [4 8];
>> cfg.method           = 'montecarlo';
>> cfg.statistic        = '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;
>> cfg.feedback = 'yes';
>> cfg.neighbours       = ft_neighbourselection(cfg, blk1_tf_avg);
>>  subj = 15;
>> 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, blk3_tf_avg, blk1_tf_avg);
>>
>>
>> save stat_tf_theta_1000_1500_bkey3vsbkey1 stat
>>
>>
>> ***
>>
>> The error comes during the plotting phase when it says that i should not
>> have multiple frequencies, as the data should be averaged across
>> frequencies. And it does save my file (stat_theta....) but and i can see
>> the pos/neg clusters in the data structure...but i can't plot with :
>>
>> cfg = [];
>> cfg.highlightsymbolseries = ['*','*','.','.','.'];
>> cfg.layout = '/Applications/fieldtrip/template/neuromag306mag.lay';
>> cfg.contournum = 0;
>> cfg.markersymbol = '.';
>> cfg.alpha = 0.05;
>> cfg.zparam = 'stat';
>> ft_clusterplot(cfg,stat);
>>
>>
>>
>> I have also tried plotting with the script from the tutorial
>>
>>
>> pos_cluster_pvals = [stat.posclusters(:).prob];
>> pos_signif_clust = find(pos_cluster_pvals < stat.cfg.alpha);
>> pos = ismember(stat.posclusterslabelmat, pos_signif_clust);
>>
>>
>> neg_cluster_pvals = [stat.negclusters(:).prob];
>> neg_signif_clust = find(neg_cluster_pvals < stat.cfg.alpha);
>> neg = ismember(stat.negclusterslabelmat, neg_signif_clust);
>>
>> for k = 1:20;
>>
>> etc.
>> but this makes the plot really weird looking...and i am not sure how i
>> can only plot the data from the frequencies i would like to display (in
>> this case 4-8Hz). I know how to make the subtraction image (between my two
>> conditions), but not how to specify the frequency range that i want
>> displayed...
>>
>> If this is too complicated, is there a way to average over a set of
>> frequencies in the data, and then just input files into the permutation
>> test that are already collapsed across the frequency range i am interested
>> in?
>>
>>
>> Thank  you!
>> z
>>
>>
>> On Mon, Dec 12, 2011 at 7:59 AM, jan-mathijs schoffelen <
>> jan.schoffelen at donders.ru.nl> wrote:
>>
>>> Hi Zita,
>>>
>>> Could you provide some more information please? What plotting function
>>> are you using? What does the stat-structure look like etc.? With sufficient
>>> additional information we can try and reproduce the problem, and if it's a
>>> bug fix it. If it's not a bug, we may give you some hints to fool the
>>> system...
>>>
>>> BW,
>>>
>>> Jan-Mathijs
>>>
>>> On Dec 11, 2011, at 8:28 PM, Zita Eva Patai wrote:
>>>
>>> Dear FT-ers,
>>>
>>> I have tried to run a permutation test on time-frequency data, and would
>>> have like to see a statistical evealuation over a set of frequencies (ex:
>>> 4-8Hz)
>>>
>>> It seems that the test itself runs, but it crashes when i try to plot
>>> the data, saying that 'stat' must not contain multiple frequencies.
>>>
>>> I was wondering if there was a way to evaluate the difference between
>>> two conditions over a set range of frequencies?
>>>
>>> Thank you!
>>> zita
>>>
>>>
>>> --
>>>
>>> Zita Patai
>>> DPhil Candidate, Experimental Psychology
>>> University of Oxford
>>> bcl.psy.ox.ac.uk/people/zita-eva-patai/
>>> eva.patai at psy.ox.ac.uk
>>>
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>
>>>
>>>    Jan-Mathijs Schoffelen, MD PhD
>>>
>>> Donders Institute for Brain, Cognition and Behaviour,
>>> Centre for Cognitive Neuroimaging,
>>> Radboud University Nijmegen, The Netherlands
>>>
>>> Max Planck Institute for Psycholinguistics,
>>> Nijmegen, The Netherlands
>>>
>>> J.Schoffelen at donders.ru.nl
>>> Telephone: +31-24-3614793
>>>
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>
>>
>>
>>
>> --
>>
>> Zita Patai
>> DPhil Candidate, Experimental Psychology
>> University of Oxford
>> bcl.psy.ox.ac.uk/people/zita-eva-patai/
>> eva.patai at psy.ox.ac.uk
>>
>>
>>  _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
>>
>>    Jan-Mathijs Schoffelen, MD PhD
>>
>> Donders Institute for Brain, Cognition and Behaviour,
>> Centre for Cognitive Neuroimaging,
>> Radboud University Nijmegen, The Netherlands
>>
>> Max Planck Institute for Psycholinguistics,
>> Nijmegen, The Netherlands
>>
>> J.Schoffelen at donders.ru.nl
>> Telephone: +31-24-3614793
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
>
>
>
> --
>
> Zita Patai
> DPhil Candidate, Experimental Psychology
> University of Oxford
> bcl.psy.ox.ac.uk/people/zita-eva-patai/
> eva.patai at psy.ox.ac.uk
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20111213/955b27b3/attachment.html>


More information about the fieldtrip mailing list