<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>Hello FieldTrip team,</p>
<p>I've been utilizing the <code>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>stat.mask</code> and the p-values in <code>stat.prob</code>, which has led to confusion in interpreting the results.</p>
<p><strong>Detailed Description:</strong></p>
<p><strong>Power Spectrum Calculation:</strong></p>
<p>cfg = [];<br />cfg.method       = 'mtmfft';<br />cfg.output       = 'pow';<br />cfg.taper        = 'hanning';<br />cfg.foilim       = [1 100]; % Frequency range<br />cfg.polyremoval  = -1; <br />cfg.pad          = 'nextpow2';<br />datafftpre = ft_freqanalysis(cfg, datapre); % Same for post</p>
<p><strong>Statistical Analysis Configuration:</strong></p>
<div><span>cfg = [];</span></div>
<div><span>cfg.method           = 'montecarlo';</span></div>
<div><span>cfg.statistic        = 'ft_statfun_depsamplesT';</span></div>
<div><span>cfg.correctm         = 'no';</span></div>
<div><span>cfg.alpha            = 0.05;</span></div>
<div><span>cfg.tail             = 0;</span></div>
<div><span>cfg.correcttail      = 'prob';</span></div>
<div><span>cfg.computestat      = 'yes';</span></div>
<div><span>cfg.computeprob      = 'yes';</span></div>
<div><span>cfg.computecritval   = 'yes';</span></div>
<div><span> </span></div>
<div><span>% Design configuration for dependent groups</span></div>
<div><span>nsubj = size(data, 1); </span></div>
<div><span>design = zeros(2, 2 * nsubj);</span></div>
<div><span>design(1, 1:nsubj)         = 1; </span></div>
<div><span>design(1, nsubj+1:2*nsubj) = 2; </span></div>
<div><span>design(2, :) = repmat(1:nsubj, 1, 2);</span></div>
<div><span> </span></div>
<div><span>cfg.design = design;</span></div>
<div><span>cfg.ivar   = 1; </span></div>
<div><span>cfg.uvar   = 2; </span></div>
<div><span> </span></div>
<div><span>stat = ft_freqstatistics(cfg, datafftpre, data);</span></div>
<div> </div>
<p><strong>Observations:</strong></p>
<p>Upon reviewing the results, I observed that <code>stat.mask</code> did not align with the p-values in <code>stat.prob</code> as expected. I anticipated that <code>stat.mask</code> would indicate values lower than <code>cfg.alpha</code>, but this was not consistent with the p-values. Additionally, I noticed that when <code>stat.cirange</code> contains values of "0", corresponding values of "1" appear in <code>stat.mask</code>, despite the p-value not being lower than <code>cfg.alpha</code>.</p>
<p><strong>Input Data:</strong></p>
<p>My data is structured into two 3D matrices, <code>datafftpre</code> and <code>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>I would greatly appreciate any guidance or suggestions on correctly interpreting the results of my analysis.</p>
<p>Thank you for your attention and support.</p>
<p>Warm regards,</p>

</body></html>