<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Guillermo,
<div class=""><br class="">
</div>
<div class="">Is there any new information in this e-mail? I recall that you asked the same question, in more or less the same e-mail last week, and that one of our colleagues - Mikkel - has taken the time to answer it. I might have missed it, but I did not
see any follow up on Mikkel’s reply on this list. </div>
<div class=""><br class="">
</div>
<div class="">In contrast to the previous message, you now write: "<span style="font-family: Verdana, Geneva, sans-serif;" class="">Upon reviewing the results, I observed that</span><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><code class="">stat.mask</code><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><span style="font-family: Verdana, Geneva, sans-serif;" class="">did
not align with the p-values in</span><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><code class="">stat.prob</code><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><span style="font-family: Verdana, Geneva, sans-serif;" class="">as
expected. I anticipated that</span><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><code class="">stat.mask</code><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><span style="font-family: Verdana, Geneva, sans-serif;" class="">would
indicate values lower than</span><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><code class="">cfg.alpha</code><span style="font-family: Verdana, Geneva, sans-serif;" class="">, but this was not consistent with the p-values. Additionally,
I noticed that when</span><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><code class="">stat.cirange</code><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><span style="font-family: Verdana, Geneva, sans-serif;" class="">contains
values of "0", corresponding values of "1" appear in</span><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><code class="">stat.mask</code><span style="font-family: Verdana, Geneva, sans-serif;" class="">, despite the p-value not being
lower than</span><span style="font-family: Verdana, Geneva, sans-serif;" class=""> </span><code class="">cfg.alpha</code><font face="Verdana, Geneva, sans-serif" class="">.” </font>This is still way to vague in order to give the readership any handles to
be able to think along with you. Note, that we are all scientists that are keen to help each other out, but that this e-mail list is not a helpdesk.</div>
<div class=""><br class="">
</div>
<div class=""><font face="Verdana, Geneva, sans-serif" class=""><br class="">
</font></div>
<div class="">I don’t understand well why</div>
<div class="">-you specify ‘montecarlo’ as method, but you don’t specify a number of randomizations</div>
<div class="">-you think that you need to look at the cirange in the output</div>
<div class=""><br class="">
</div>
<div class="">Moreover, I don’t know whether</div>
<div class="">-it makes sense to do second-level statistics with only 3 subjects</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">But more generally: Have you reviewed the documentation on the fieldtrip website about how to properly conduct a statistical test in fieldtrip? The code that you pasted uses inconsistently datafftpre and data as input to ft_freqstatistics, and
while you mention that datafftpre contains 3 subjects worth of data, the call to ft_freqanalysis that precedes in your pasted code example the call to ft_freqstatistics suggests otherwise.</div>
<div class=""><br class="">
</div>
<div class="">Just as a general problem-solving strategy, after you have studied all documentation about performing statistical comparisons in FieldTrip, I suggest that you look up in the codebase the lines of code (in ft_statistics_montecarlo), where the mask
(and cirange) are computed. This will most likely take most of the magic away. If you would do this, you would see that probably the only situation in which the mask, p-values and alpha level do not relate to one another in a predictable way, is when cfg.correctm
= ‘fdr’. But since you didn’t mention this in the code you pasted, it will probably not be the cause for your observed discrepancy (which to repeat myself is still not clear to the readership).</div>
<div class=""><br class="">
</div>
<div class="">And now it’s time for BWV891.</div>
<div class=""><br class="">
</div>
<div class="">Good luck,</div>
<div class=""><br class="">
</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 25 Mar 2024, at 17:20, Guillermo Sanchez-Garrido Campos via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="font-size: 10pt; font-family: Verdana,Geneva,sans-serif" class="">
<p class="">Hello FieldTrip team,</p>
<p class="">I've been utilizing the <code class="">ft_freqstatistics</code> function to conduct statistical analysis on my LFP data, recorded using the Neuropixels system. During my analysis, I encountered a discrepancy between the values in
<code class="">stat.mask</code> and the p-values in <code class="">stat.prob</code>, which has led to confusion in interpreting the results.</p>
<p class=""><strong class="">Detailed Description:</strong></p>
<p class=""><strong class="">Power Spectrum Calculation:</strong></p>
<p class="">cfg = [];<br class="">
cfg.method = 'mtmfft';<br class="">
cfg.output = 'pow';<br class="">
cfg.taper = 'hanning';<br class="">
cfg.foilim = [1 100]; % Frequency range<br class="">
cfg.polyremoval = -1; <br class="">
cfg.pad = 'nextpow2';<br class="">
datafftpre = ft_freqanalysis(cfg, datapre); % Same for post</p>
<p class=""><strong class="">Statistical Analysis Configuration:</strong></p>
<div class=""><span class="">cfg = [];</span></div>
<div class=""><span class="">cfg.method = 'montecarlo';</span></div>
<div class=""><span class="">cfg.statistic = 'ft_statfun_depsamplesT';</span></div>
<div class=""><span class="">cfg.correctm = 'no';</span></div>
<div class=""><span class="">cfg.alpha = 0.05;</span></div>
<div class=""><span class="">cfg.tail = 0;</span></div>
<div class=""><span class="">cfg.correcttail = 'prob';</span></div>
<div class=""><span class="">cfg.computestat = 'yes';</span></div>
<div class=""><span class="">cfg.computeprob = 'yes';</span></div>
<div class=""><span class="">cfg.computecritval = 'yes';</span></div>
<div class=""><span class=""> </span></div>
<div class=""><span class="">% Design configuration for dependent groups</span></div>
<div class=""><span class="">nsubj = size(data, 1); </span></div>
<div class=""><span class="">design = zeros(2, 2 * nsubj);</span></div>
<div class=""><span class="">design(1, 1:nsubj) = 1; </span></div>
<div class=""><span class="">design(1, nsubj+1:2*nsubj) = 2; </span></div>
<div class=""><span class="">design(2, :) = repmat(1:nsubj, 1, 2);</span></div>
<div class=""><span class=""> </span></div>
<div class=""><span class="">cfg.design = design;</span></div>
<div class=""><span class="">cfg.ivar = 1; </span></div>
<div class=""><span class="">cfg.uvar = 2; </span></div>
<div class=""><span class=""> </span></div>
<div class=""><span class="">stat = ft_freqstatistics(cfg, datafftpre, data);</span></div>
<div class=""> </div>
<p class=""><strong class="">Observations:</strong></p>
<p class="">Upon reviewing the results, I observed that <code class="">stat.mask</code> did not align with the p-values in
<code class="">stat.prob</code> as expected. I anticipated that <code class="">stat.mask</code> would indicate values lower than
<code class="">cfg.alpha</code>, but this was not consistent with the p-values. Additionally, I noticed that when
<code class="">stat.cirange</code> contains values of "0", corresponding values of "1" appear in
<code class="">stat.mask</code>, despite the p-value not being lower than <code class="">
cfg.alpha</code>.</p>
<p class=""><strong class="">Input Data:</strong></p>
<p class="">My data is structured into two 3D matrices, <code class="">datafftpre</code> and
<code class="">datafftpost</code>, each representing LFP recordings for 3 subjects (1st dimension), across 310 channels (rows), and 649 frequencies (columns). Each cell contains the power spectrum value for the corresponding subject, channel, and frequency.</p>
<p class="">I would greatly appreciate any guidance or suggestions on correctly interpreting the results of my analysis.</p>
<p class="">Thank you for your attention and support.</p>
<p class="">Warm regards,</p>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C29eb0f0a8410484acd5e08dc4cef8cd7%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638469838931444997%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=tcOvWBxVpAKT1VDqv3yiV8yurbtXJ1xTxRaP%2FKGjDjk%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="eg64iF6uuKWTfq4nuGjzMkYOrOdlGiS3xYmmwZD0htFS6LCVgptlArlrTg0GAQO5H1EZXtRQ8kfX5GZdNJU7EO1vrxv0vJ7hy5KPrPDk2pQapjTB+JaFs1XXaWRJlcrDpiFwgUnve/REsS9R5M50xts8MAurQBwrT0nO+GAD0Lo=" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>