<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Arial,Helvetica,sans-serif'>
<p>Dear FieldTrip community,</p>
<p>I have a similar problem that may be of help here.</p>
<p>It's my first message on this mailing list so, first of all, thank you very much for this free toolbox and the help you're providing. I'm a PhD student in Marseille (France) and I'm doing LFP recordings with tetrodes or silicon probes in freely moving rats. (I apologize in advance for this very detailed – and long – email).</p>
<p>I'm trying to compare the power in a certain frequency range between 2 conditions (Trial and Baseline). I can see a clear rising during the trial and I want to run the statistics now.</p>
<p>Like Zita, I'd like to run a cluster permutation test on data with frequency and time information, and my signal is averaged over channels.</p>
<p>I followed this tutorial : <a href="http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics">http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics<span style="text-decoration: underline;">.</span> </a>Based on this, this is what I did :</p>
<p>1) I cut epochs of 6s (trials), filter [0.1 250Hz] and average over channels to have an averaged signal per probe (32 channels = 4 shanks = 1 probe).</p>
<p>2) I do the same for the baseline.</p>
<p>3) I create a structure data_all which gather all the epochs, with the appropriate design matrix (0 if baseline, 1 if trial).</p>
<p>4) I do a Time Frequency Transform averaged over time with ft_freqanalysis, 'mtmfft', with keeptrials='yes'. It give me, for each trial, a profile Power=f(Freq) averaged during the time of the epoch. The difference in my frequency range is very clear when I plot the profiles.</p>
<p>5) I use ft_freqstatistics like this :</p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg = [];</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.channel = </span></span></span><span style="color: #a020f0;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">'Str'</span></span></span><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.design = data_all.designmatrix;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.method = </span></span></span><span style="color: #a020f0;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">'montecarlo'</span></span></span><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"> <span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.numrandomization = 500;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"> <span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.statistic = </span></span></span><span style="color: #a020f0;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">'indepsamplesT'</span></span></span><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"> <span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.ivar = 1;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"> <span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.correctm = </span></span></span><span style="color: #a020f0;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">'cluster'</span></span></span><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"> <span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.neighbours = [];</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"> <span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.alpha=0.05;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"> <span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.tail=0;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"> <span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">cfg.correcttail=</span></span></span><span style="color: #a020f0;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">'alpha'</span></span></span><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">;</span></span></span></p>
<p style="margin-bottom: 0in; line-height: 100%;"><span style="color: #000000;"><span style="font-family: lucidatypewriter,serif;"><span style="font-size: small;">[stat]=ft_freqstatistics(cfg, FR_alltrials)</span></span></span></p>
<p>And this is not working because I have only NaNs...</p>
<p>stat =</p>
<p>stat: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN]</p>
<p>prob: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]</p>
<p>cirange: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]</p>
<p>mask: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]</p>
<p>ref: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN]</p>
<p>dimord: 'chan_freq'</p>
<p>freq: [1x25 double]</p>
<p>label: {'Str'}</p>
<p>cfg: [1x1 struct]</p>
<p><br /> Would you have an idea to resolve my problem ? Maybe I forgot to precise a parameter somewhere ?</p>
<p>Thank you for your help!</p>
<p>Best regards,</p>
<p>Laetitia</p>
<p><br /> </p>
<p> </p>
<p>On 24-03-2016 13:15, Zita Eva Patai wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div dir="ltr">Dear FT-ers
<div> </div>
<div>I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels.</div>
<div> </div>
<div>I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. </div>
<div> </div>
<div>If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. </div>
<div> </div>
<div>Is there an easy way to fix this?</div>
<div> </div>
<div>I am using the FT inside SPM12.</div>
<div> </div>
<div>Thanks very much,</div>
<div>zita</div>
<div> </div>
<div> </div>
</div>
<!-- html ignored --><br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br /> fieldtrip mailing list<br /><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br /><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</blockquote>
<p> </p>
<div> </div>
</body></html>