<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Hi Cihan,
<div><br>
</div>
<div>Difficult to comment on this. Perhaps some example code and data might be helpful to demonstrate. <br id="lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 8 Aug 2025, at 10:53, cxd425--- via fieldtrip <fieldtrip@science.ru.nl> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div id="mail-editor-reference-message-container">
<div id="mail-editor-reference-message-container">
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Dear Jan,<br>
<br>
Thank you for the response, this is helpful.<span class="Apple-converted-space"> </span><o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">May I ask then, if cfg.method=‘montecarlo’ and cfg.computeprob=True the p-values, are much lower in stat.prob compared to when cfg.method=‘montecarlo’ and cfg.computeprob=False – they
are mostly 1s when computeprob is False. I’m not referring to the cluster p-values (2<sup>nd</sup><span class="Apple-converted-space"> </span>level), but more so the sample (1<sup>st</sup>) level p-values.<o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Thank you in advance for the help,<o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Cihan<br>
<br>
<o:p></o:p></div>
<div class="MsoNormal" align="center" style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif; text-align: center;">
<hr size="0" width="100%" align="center">
</div>
<div id="divRplyFwdMsg">
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><b><span style="font-family: Calibri, sans-serif;">From:</span></b><span style="font-family: Calibri, sans-serif;"> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Schoffelen,
J.M. (Jan Mathijs) via fieldtrip <fieldtrip@science.ru.nl><br>
<b>Sent:</b> Wednesday, August 6, 2025 12:26 pm<br>
<b>To:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Cc:</b> Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen@donders.ru.nl><br>
<b>Subject:</b> Re: [FieldTrip] Query regarding stat.prob and permutation tests</span><o:p></o:p></div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-family: Calibri, sans-serif;"> <o:p></o:p></span></div>
</div>
</div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Hi Cihan,<o:p></o:p></div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">cfg.computeprob is an option that is used by (some of) the ’statfuns’, to convert a test-statistic with a known shape into a p-value, based on the shape of the parameter, (e.g. a T or
F statistic).<o:p></o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">The computational algorithm with which the p-value is computed (+returned in the output of a high level function call to ft_timelock/freq/sourcestatistics) depends on a combination of
the contents of cfg.method (indeed if you would use cfg.method=‘montecarlo’, then the returned p-values are based on a permutation test, if you would use cfg.method=‘analytic’ the p-values will be based on the known distributions), and cfg.correctm.<o:p></o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">I hope that this helps,<o:p></o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">best wishes,<o:p></o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Jan-Mathijs<o:p></o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
</div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">On 31 Jul 2025, at 17:03, cxd425--- via fieldtrip <fieldtrip@science.ru.nl> wrote:<o:p></o:p></div>
</div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Hi FieldTrip community,<o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">I hope you’re doing well.<o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">I was just curious how the p-values are computed at the first level - I couldn’t find any documentation explaining the behaviour of stat.prob when cfg.computeprob is set to true or false.
When I set computeprob = false, the resulting stat object still contains p-values. Could it be that when cfg.computeprob = true, the p-values at the first level are computed using a permutation test, whereas when it’s set to false, a simpler non-permutation
statistical test (e.g., a two-sample t-test) is used instead?<o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Any clarification would be greatly appreciated.<o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Best regards,<br>
Cihan<o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 10.5pt; font-family: Helvetica;">_______________________________________________</span><br>
<span style="font-size: 10.5pt; font-family: Helvetica;">fieldtrip mailing list</span><br>
<span style="font-size: 10.5pt; font-family: Helvetica;"><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%7C73b099571f764c968c8b08ddd65faaee%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638902428581312079%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=QqSvNpise4c0t3TzrykKx4diSFk1en7oEr%2Fyr%2BySae8%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="color: blue; text-decoration: underline;">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></span><br>
<span style="font-size: 10.5pt; font-family: Helvetica;"><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C73b099571f764c968c8b08ddd65faaee%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638902428581344972%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=uD16jQ8rScF8vheXt%2Bc85nVnbst%2Fgxej0ZBGo0BvxQU%3D&reserved=0" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" style="color: blue; text-decoration: underline;">https://doi.org/10.1371/journal.pcbi.1002202</a></span><o:p></o:p></div>
</blockquote>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
</div>
</div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">fieldtrip
mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">https://doi.org/10.1371/journal.pcbi.1002202</span></div>
</blockquote>
</div>
<br>
</div>
</body>
</html>