[FieldTrip] ft_freqstatistics error

Jutras, Mike mjutras at emory.edu
Thu Jul 21 23:04:01 CEST 2011


Jörn,

I found the problem (which your answer led me to): the frequency bins did not match up between the two data structures, but after fixing them so they matched, the function ran without error. I had spaced the frequency bins far enough apart to account for the smoothing due to the multitapering, but I wanted to run the permutation test with multiple bin centers as I had done previously with an older version of freqstatistics. Thanks for your help!

-----Original Message-----
From: fieldtrip-bounces at donders.ru.nl [mailto:fieldtrip-bounces at donders.ru.nl] On Behalf Of "Jörn M. Horschig"
Sent: Thursday, July 21, 2011 4:33 PM
To: Email discussion list for the FieldTrip project
Subject: Re: [FieldTrip] ft_freqstatistics error

Hi Mike,

I think that the problem is caused by the multidimensionality of your 
freq-data. If you want to cover a whole frequency range, you cannot use 
15 different bins but have to work with multitapers instead and utilize 
how they smooth the frequencies, e.g. if you are interested in 
gamma-band activity between 60 and 120Hz, you use 90Hz (cfg.foi) and 
30Hz smoothing (cfg.tapsmofrq). I think this is also explained in one of 
the tutorials on the FT wiki, so you might want to have a look there.

Best,
Jörn

On 7/21/2011 10:00 PM, Jutras, Mike wrote:
> Hello,
>
> I'm receiving an error after attempting to run the new version ft_freqstatistics (fieldtrip-20110606). I'm attempting to run a cluster-based permutation test for two sets of time-frequency data. These data consist of 114 LFP recordings, 2 conditions. I'm not sure if I am arranging the data correctly or using the correct design, but here is what it looks like:
>
> % data variable 1
> cnd1_1 =
>          label: {'AD01'}
>           freq: [1x15 double]
>           time: [1x126 double]
>         dimord: 'subj_chan_freq_time'
>      powspctrm: [4-D double]
>            cfg: [1x1 struct]
>
>>> size(cnd1_1.powspctrm)
> ans =
>     114     1    15   126
>
> % data variable 2
> cnd2_1 =
>          label: {'AD01'}
>           freq: [1x15 double]
>           time: [1x126 double]
>         dimord: 'subj_chan_freq_time'
>      powspctrm: [4-D double]
>            cfg: [1x1 struct]
>
>>> size(cnd2_1.powspctrm)
> ans =
>     114     1    15   126
>
> % code for permutation test cfg
> cfg = [];
> cfg.channel      = 'AD01';
> cfg.avgoverchan  =  'no';
> cfg.avgoverfreq  =  'no';
> cfg.avgovertime =  'no';
>
> cfg.latency      =  'all';
> cfg.frequency    =  'all';
> %cfg.frequency    =  'all';
> cfg.parameter    =  'powspctrm';
> cfg.method       =  'montecarlo';
> cfg.statistic    =  'depsamplesT';
>
> dum = ones(1, size(cnd1_1.powspctrm,1));
> cfg.design       =  [dum 2.*dum; 1:size(cnd1_1.powspctrm,1) 1:size(cnd1_1.powspctrm,1)];
> cfg.numrandomization  = 1000;
> cfg.correctm     =  'cluster';
> cfg.alpha        =  0.05;
> cfg.tail         =  0;
> cfg.ivar         =  1;
> cfg.uvar         =  2;
> cfg.feedback     =  'text';
> cfg.clusterstatistic  = 'maxsum';
> cfg.clusterthreshold  = 'parametric';
> %cfg.clusterthreshold  = 'nonparametric_common';
> cfg.clusteralpha =  0.05;
> % clustercritval original value: 1.96
> cfg.clustercritval    = 1.96;
> cfg.clustertail  =  0;
> cfg.neighbours{1}.label = 'AD01';
> cfg.neighbours{1}.neighblabel = {};
>
>
>>> stat=ft_freqstatistics(cfg, cnd1_1, cnd2_1);
> computing statistic over the frequency range [2.058 29.950]
> computing statistic over the time range [-1.000 0.250]
> selection powspctrm along dimension 2
> selection powspctrm along dimension 3
> selection powspctrm along dimension 4
> selection powspctrm along dimension 2
> selection powspctrm along dimension 3
> selection powspctrm along dimension 4
> ??? Error using ==>  ft_freqstatistics at 248
> the number of observations in the design does not match the number of observations in the data
>
> Thanks for any advice,
> Michael
> --
> Michael Jutras, Ph.D.
> Postdoctoral fellow
> Emory University, Yerkes National Primate Research Center
> 404-712-9435
>
>
>
>
> ________________________________
>
> This e-mail message (including any attachments) is for the sole use of
> the intended recipient(s) and may contain confidential and privileged
> information. If the reader of this message is not the intended
> recipient, you are hereby notified that any dissemination, distribution
> or copying of this message (including any attachments) is strictly
> prohibited.
>
> If you have received this message in error, please contact
> the sender by reply e-mail message and destroy all copies of the
> original message (including attachments).
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


-- 
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: jm.horschig at donders.ru.nl
Tel:    +31-(0)24-36-68493
Web: http://www.ru.nl/donders

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




More information about the fieldtrip mailing list