<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p dir="auto">Hello FieldTrip team,</p>
<p dir="auto">I've been using the ft_freqstatistics function to perform statistical analysis on my LFP data (recorded with Neuropixels system). I've noticed a discrepancy between the values in stat.mask and the p-values in stat.prob, which has caused confusion in interpreting the results.</p>
<p dir="auto">Detailed Description:</p>
<p dir="auto">I have configured my analysis as follows:</p>
<ol dir="auto">
<li>Calculation of Power Spectrum:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto">
<pre class="notranslate"><code class="notranslate">cfg = [];
cfg.method = 'mtmfft';
cfg.output = 'pow';
cfg.taper = 'hanning';
cfg.foilim = [1 100]; % Frequency range
cfg.polyremoval = -1;
cfg.pad = 'nextpow2';
datafftpre = ft_freqanalysis(cfg, datapre); % Same for post
</code></pre>
<div class="zeroclipboard-container position-absolute right-0 top-0"> </div>
</div>
<ol dir="auto" start="2">
<li>Statistical Analysis:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto">
<pre class="notranslate"><code class="notranslate">cfg = [];
cfg.method = 'montecarlo';
cfg.statistic = 'ft_statfun_depsamplesT';
cfg.correctm = 'no';
cfg.alpha = 0.05;
cfg.tail = 0;
cfg.correcttail = 'prob';
cfg.computestat = 'yes';
cfg.computeprob = 'yes';
cfg.computecritval = 'yes';
% Design configuration for dependent groups
nsubj = size(data, 1);
design = zeros(2, 2 * nsubj);
design(1, 1:nsubj) = 1;
design(1, nsubj+1:2*nsubj) = 2;
design(2, :) = repmat(1:nsubj, 1, 2);
cfg.design = design;
cfg.ivar = 1;
cfg.uvar = 2;
stat = ft_freqstatistics(cfg, datafftpre, data);
</code></pre>
<div class="zeroclipboard-container position-absolute right-0 top-0"> </div>
</div>
<p dir="auto">However, upon inspecting the results, I noticed that stat.mask did not match the p-values in stat.prob. I expected the values in stat.mask to reflect the p-values lower than cfg.alpha, but this was not the case.</p>
<p dir="auto">Input Data:</p>
<p dir="auto">My data is organized into two 3D matrices, datafftpre and datafftpost, each with 3 subjects (1st dimension), 310 rows (recording channels), and 649 columns (frequencies). Each cell contains the value of the power spectrum for each subject, channel, and frequency.</p>
<p dir="auto">I appreciate any guidance or suggestions on how to correctly interpret the results of my analysis.</p>
<p dir="auto">Thank you for your attention and support.</p>
</body></html>