<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"Formateret HTML Tegn";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
span.FormateretHTMLTegn
{mso-style-name:"Formateret HTML Tegn";
mso-style-priority:99;
mso-style-link:"Formateret HTML";
font-family:Consolas;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1879467880;
mso-list-template-ids:-1162605758;}
@list l0:level1
{mso-level-start-at:2;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l1
{mso-list-id:1882280191;
mso-list-template-ids:778706190;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style>
</head>
<body lang="DA" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US">Dear Guillermo<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US">If I remember correctly, the mask for the two-tailed test is based on cfg.alpha / 2.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US">Best regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US">Mikkel<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">Fra:
</span></b><span style="color:black">fieldtrip <fieldtrip-bounces@science.ru.nl> på vegne af Guillermo Sanchez-Garrido Campos via fieldtrip <fieldtrip@science.ru.nl><br>
<b>Dato: </b>onsdag, 20. marts 2024 kl. 10.25<br>
<b>Til: </b>fieldtrip@science.ru.nl <fieldtrip@science.ru.nl><br>
<b>Cc: </b>Guillermo Sanchez-Garrido Campos <gsancam@upo.es><br>
<b>Emne: </b>[FieldTrip] Inconsistency between stat.mask and p-values in ft_freqstatistics<o:p></o:p></span></p>
</div>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Hello FieldTrip team,<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">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.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Detailed Description:<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">I have configured my analysis as follows:<o:p></o:p></span></p>
<ol start="1" type="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo1">
<span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Calculation of Power Spectrum:<o:p></o:p></span></li></ol>
<div>
<pre><code>cfg = [];<o:p></o:p></code></pre>
<pre><code>cfg.method = 'mtmfft';<o:p></o:p></code></pre>
<pre><code>cfg.output = 'pow';<o:p></o:p></code></pre>
<pre><code>cfg.taper = 'hanning';<o:p></o:p></code></pre>
<pre><code>cfg.foilim = [1 100]; % Frequency range<o:p></o:p></code></pre>
<pre><code>cfg.polyremoval = -1; <o:p></o:p></code></pre>
<pre><code>cfg.pad = 'nextpow2';<o:p></o:p></code></pre>
<pre><code>datafftpre = ft_freqanalysis(cfg, datapre); % Same for post<o:p></o:p></code></pre>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"> <o:p></o:p></span></p>
</div>
</div>
<ol start="2" type="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo2">
<span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Statistical Analysis:<o:p></o:p></span></li></ol>
<div>
<pre><code>cfg = [];<o:p></o:p></code></pre>
<pre><code>cfg.method = 'montecarlo';<o:p></o:p></code></pre>
<pre><code>cfg.statistic = 'ft_statfun_depsamplesT';<o:p></o:p></code></pre>
<pre><code>cfg.correctm = 'no';<o:p></o:p></code></pre>
<pre><code>cfg.alpha = 0.05;<o:p></o:p></code></pre>
<pre><code>cfg.tail = 0;<o:p></o:p></code></pre>
<pre><code>cfg.correcttail = 'prob';<o:p></o:p></code></pre>
<pre><code>cfg.computestat = 'yes';<o:p></o:p></code></pre>
<pre><code>cfg.computeprob = 'yes';<o:p></o:p></code></pre>
<pre><code>cfg.computecritval = 'yes';<o:p></o:p></code></pre>
<pre><code><o:p> </o:p></code></pre>
<pre><code><o:p> </o:p></code></pre>
<pre><code>% Design configuration for dependent groups<o:p></o:p></code></pre>
<pre><code>nsubj = size(data, 1); <o:p></o:p></code></pre>
<pre><code>design = zeros(2, 2 * nsubj);<o:p></o:p></code></pre>
<pre><code>design(1, 1:nsubj) = 1; <o:p></o:p></code></pre>
<pre><code>design(1, nsubj+1:2*nsubj) = 2; <o:p></o:p></code></pre>
<pre><code>design(2, :) = repmat(1:nsubj, 1, 2);<o:p></o:p></code></pre>
<pre><code><o:p> </o:p></code></pre>
<pre><code>cfg.design = design;<o:p></o:p></code></pre>
<pre><code>cfg.ivar = 1; <o:p></o:p></code></pre>
<pre><code>cfg.uvar = 2; <o:p></o:p></code></pre>
<pre><code><o:p> </o:p></code></pre>
<pre><code>stat = ft_freqstatistics(cfg, datafftpre, data);<o:p></o:p></code></pre>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"> <o:p></o:p></span></p>
</div>
</div>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">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.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Input Data:<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">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.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">I appreciate any guidance or suggestions on how to correctly interpret the results of my analysis.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Thank you for your attention and support.<o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>