<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>Thanks for looking into this in such an amount of detail. To me, this functional behavior does not make sense (i.e. the overwriting of the non-parametrically derived p-value). </div>
<div><br>
</div>
<div>Would you mind raising this as an issue on the fieldtrip github repository <a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffieldtrip%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Ca7d2bae8b7d244aa71d508ddd8cb415c%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638905089661508669%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=E%2BYy%2FBXhh1wR9B4eakdExJHvGXw%2FKeqInB1Com3hmu8%3D&reserved=0" originalsrc="https://github.com/fieldtrip/fieldtrip">
https://github.com/fieldtrip/fieldtrip</a>, and copy over the relevant information from this e-mail thread?</div>
<div><br>
</div>
<div>I did not write the original code, so it could be that the person who wrote this had a particular reason to have the code behave as it currently does, or it is a genuine ‘bug’.</div>
<div><br>
</div>
<div>Best wishes and thanks,</div>
<div><br>
</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br id="lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 8 Aug 2025, at 12:21, Cihan Dogan <cdogan1994@hotmail.co.uk> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; letter-spacing: revert !important; orphans: auto; text-transform: revert !important; widows: auto; word-spacing: revert !important; -webkit-text-stroke-width: 0px; text-decoration: none; aspect-ratio: revert !important; background: revert !important; block-size: revert !important; bottom: revert !important; color: revert !important; color-scheme: revert !important; cursor: revert !important; direction: revert !important; font-size: revert !important; height: revert !important; hyphens: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important; resize: revert !important; rotate: revert !important; scale: revert !important; tab-size: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-shadow: revert !important; text-wrap: revert !important; top: revert !important; transition: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; word-break: revert !important; writing-mode: revert !important; zoom: revert !important; border: 0px !important; display: table !important; width: 859px; table-layout: fixed !important; float: none !important; border-spacing: 0px !important;">
<tbody style="aspect-ratio: revert !important; background: revert !important; block-size: revert !important; border: revert !important; bottom: revert !important; color: revert !important; color-scheme: revert !important; cursor: revert !important; direction: revert !important; font-size: revert !important; height: revert !important; hyphens: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important; resize: revert !important; rotate: revert !important; scale: revert !important; tab-size: revert !important; table-layout: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-shadow: revert !important; text-transform: revert !important; text-wrap: revert !important; top: revert !important; transition: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; width: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important; display: block !important;">
<tr style="aspect-ratio: revert !important; background: revert !important; block-size: revert !important; border: revert !important; bottom: revert !important; color: revert !important; color-scheme: revert !important; cursor: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; height: revert !important; hyphens: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important; resize: revert !important; rotate: revert !important; scale: revert !important; tab-size: revert !important; table-layout: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-shadow: revert !important; text-transform: revert !important; text-wrap: revert !important; top: revert !important; transition: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; width: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important;">
<td valign="middle" width="1px" bgcolor="#A6A6A6" cellpadding="7px 2px 7px 2px" style="aspect-ratio: revert !important; background-image: revert !important; background-position: revert !important; background-size: revert !important; background-repeat: revert !important; background-attachment: revert !important; background-origin: revert !important; background-clip: revert !important; block-size: revert !important; border: revert !important; bottom: revert !important; color: revert !important; color-scheme: revert !important; cursor: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; height: revert !important; hyphens: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; position: revert !important; resize: revert !important; rotate: revert !important; scale: revert !important; tab-size: revert !important; table-layout: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-shadow: revert !important; text-transform: revert !important; text-wrap: revert !important; top: revert !important; transition: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important; padding: 7px 2px !important; background-color: rgb(166, 166, 166) !important; width: 0px !important;">
</td>
<td valign="middle" width="100%" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 15px" style="aspect-ratio: revert !important; background-image: revert !important; background-position: revert !important; background-size: revert !important; background-repeat: revert !important; background-attachment: revert !important; background-origin: revert !important; background-clip: revert !important; block-size: revert !important; border: revert !important; bottom: revert !important; color-scheme: revert !important; cursor: revert !important; direction: revert !important; display: revert !important; height: revert !important; hyphens: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; position: revert !important; resize: revert !important; rotate: revert !important; scale: revert !important; tab-size: revert !important; table-layout: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-shadow: revert !important; text-transform: revert !important; text-wrap: revert !important; top: revert !important; transition: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important; width: 825px; background-color: rgb(234, 234, 234) !important; padding: 7px 5px 7px 15px !important; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif !important; font-size: 12px !important; font-weight: normal !important; color: rgb(33, 33, 33) !important; text-align: left !important; overflow-wrap: break-word !important;">
<div style="aspect-ratio: revert !important; background: revert !important; block-size: revert !important; border: revert !important; bottom: revert !important; color: revert !important; color-scheme: revert !important; cursor: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; height: revert !important; hyphens: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important; resize: revert !important; rotate: revert !important; scale: revert !important; tab-size: revert !important; table-layout: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-shadow: revert !important; text-transform: revert !important; text-wrap: revert !important; top: revert !important; transition: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; width: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important;">
You don't often get email from<span class="Apple-converted-space"> </span><a href="mailto:cdogan1994@hotmail.co.uk" style="color: blue; text-decoration: underline;">cdogan1994@hotmail.co.uk</a>.<span class="Apple-converted-space"> </span><a href="https://aka.ms/LearnAboutSenderIdentification" style="color: revert !important; text-decoration: underline; background: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; opacity: revert !important; rotate: revert !important; scale: revert !important; visibility: revert !important;">Learn
why this is important</a></div>
</td>
<td valign="middle" align="left" width="75px" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 5px" style="aspect-ratio: revert !important; background-image: revert !important; background-position: revert !important; background-size: revert !important; background-repeat: revert !important; background-attachment: revert !important; background-origin: revert !important; background-clip: revert !important; block-size: revert !important; border: revert !important; bottom: revert !important; color-scheme: revert !important; cursor: revert !important; direction: revert !important; display: revert !important; height: revert !important; hyphens: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; position: revert !important; resize: revert !important; rotate: revert !important; scale: revert !important; tab-size: revert !important; table-layout: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-shadow: revert !important; text-transform: revert !important; text-wrap: revert !important; top: revert !important; transition: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important; width: 75px !important; background-color: rgb(234, 234, 234) !important; padding: 7px 5px !important; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif !important; font-size: 12px !important; font-weight: normal !important; color: rgb(33, 33, 33) !important; text-align: left !important; overflow-wrap: break-word !important;">
</td>
</tr>
</tbody>
</table>
<div 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;">
<div class="WordSection1" style="page: WordSection1;">
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Hi Jan,<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Of course – here’s my setup:<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg = [];<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.latency = TIME_WINDOW;<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.channel = 'eeg';<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.statistic = 'ft_statfun_depsamplesT';<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.method = 'montecarlo';<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.correctm = 'cluster';<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.neighbours = neighbours;<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.clusteralpha = 0.025;<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.numrandomization = n_permutations;<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.tail = 0;<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.design = design_matrix;<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.computeprob = 'no'; <<<<< only factor I change<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.alpha = 0.05;<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.correcttail = 'alpha';<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.clusterthreshold = 'nonparametric_common';<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.uvar = 1;<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> cfg.ivar = 2;<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> stat = ft_timelockstatistics(cfg, group_one{:}, group_two{:});<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> probs = stat.prob < if computeprob = ‘Yes’ p-values are much lower on average, when compared to computeprob = ‘No’.<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">I then had a look through<span class="Apple-converted-space"> </span><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffieldtrip%2Ffieldtrip%2Fblob%2Fmaster%2Fstatfun%2Fft_statfun_depsamplesT.m%23L128&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Ca7d2bae8b7d244aa71d508ddd8cb415c%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638905089661523671%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=5Cx9T5MLvXo1PjWrPSkvaTOiJfrIhy4Fok15zqljHFU%3D&reserved=0" originalsrc="https://github.com/fieldtrip/fieldtrip/blob/master/statfun/ft_statfun_depsamplesT.m#L128" originalsrc="https://github.com/fieldtrip/fieldtrip/blob/master/statfun/ft_statfun_depsamplesT.m#L128" style="color: blue; text-decoration: underline;">ft_statfun_depsamplesT</a><span class="Apple-converted-space"> </span>function,
and it seems what actually happens is when computeprob is True, it calculates p-values from this parametric test (line 128). Then at the very end of the<span class="Apple-converted-space"> </span><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffieldtrip%2Ffieldtrip%2Fblob%2Fmaster%2Fft_statistics_montecarlo.m%23L528&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Ca7d2bae8b7d244aa71d508ddd8cb415c%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638905089661537979%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=FaWv%2FYeHzNs%2FZhOTtYLiq9%2FH7jBDYpg0Iia4pxqKsIc%3D&reserved=0" originalsrc="https://github.com/fieldtrip/fieldtrip/blob/master/ft_statistics_montecarlo.m#L528" originalsrc="https://github.com/fieldtrip/fieldtrip/blob/master/ft_statistics_montecarlo.m#L528" style="color: blue; text-decoration: underline;">ft_statistics_montcarlo</a><span class="Apple-converted-space"> </span>(line
528) if computeprob was set to true, the parametric two sample p-values are copied over the nonparametric p-values and returned.<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">I have highly skewed non-gaussian data, therefore I think this is why the p-values in stat.prob are much lower across
time and space when computeprob is True, vs. when it is not.<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">I just wanted to confirm if my understanding was correct.<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Thank you,<o:p></o:p></span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Cihan<o:p></o:p></span></div>
</div>
<div class="MsoNormal" align="center" style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif; text-align: center;">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><b><span style="font-size: 11pt; font-family: Calibri, sans-serif;">From:</span></b><span style="font-size: 11pt; font-family: Calibri, sans-serif;"><span class="Apple-converted-space"> </span>fieldtrip
<fieldtrip-bounces@science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) via fieldtrip <fieldtrip@science.ru.nl><br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Friday, August 8, 2025 11:40<br>
<b>To:</b><span class="Apple-converted-space"> </span>FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Cc:</b><span class="Apple-converted-space"> </span>Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen@donders.ru.nl><br>
<b>Subject:</b><span class="Apple-converted-space"> </span>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;"> <o:p></o:p></div>
</div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Hi Cihan,<span class="Apple-converted-space"> </span><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;">Difficult to comment on this. Perhaps some example code and data might be helpful to demonstrate. <o:p></o:p></div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><br>
<br>
<o:p></o:p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">On 8 Aug 2025, at 10:53, 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>
<div>
<div id="x_mail-editor-reference-message-container">
<div id="x_mail-editor-reference-message-container">
<div>
<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="xapple-converted-space"> </span><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;">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="xapple-converted-space"> </span>level), but more so the sample (1<sup>st</sup>) level p-values.<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;">Thank you in advance for the help,<o:p></o:p></div>
</div>
<div>
<p class="MsoNormal" style="margin: 0cm 0cm 12pt; font-size: 12pt; font-family: Aptos, sans-serif;">
Cihan<o:p></o:p></p>
</div>
<div class="MsoNormal" align="center" style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif; text-align: center;">
<hr size="1" width="100%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<div>
<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>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-family: Calibri, sans-serif;"> </span><o:p></o:p></div>
</div>
</div>
</div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Hi Cihan,<o:p></o:p></div>
</div>
<div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
</div>
</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>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
</div>
</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>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
</div>
</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>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
</div>
</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>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;">Jan-Mathijs<o:p></o:p></div>
</div>
</div>
<div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
</div>
</div>
<div>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
</div>
</div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<div>
<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>
<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;">Hi FieldTrip community,<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 you’re doing well.<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 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>
<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;">Any clarification would be greatly appreciated.<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 regards,<br>
Cihan<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;"><span style="font-size: 10.5pt; font-family: Helvetica, sans-serif;">_______________________________________________</span><br>
<span style="font-size: 10.5pt; font-family: Helvetica, sans-serif;">fieldtrip mailing list</span><br>
<span style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"><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%7Ca7d2bae8b7d244aa71d508ddd8cb415c%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638905089661552865%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=UYVYAqwQvLPe5cgkgQk3LutfAT7Ka5ogOw4qUtzVXus%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, sans-serif;"><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%7Ca7d2bae8b7d244aa71d508ddd8cb415c%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638905089661566000%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=UhPcZpuf7TKqov0si6B%2BUjPEmZuTR0b1ejHlMy3XEa4%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>
</div>
</blockquote>
<div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"> <o:p></o:p></div>
</div>
</div>
</div>
</div>
<div style="margin: 0cm; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 10.5pt; font-family: Helvetica, sans-serif;">_______________________________________________<br>
fieldtrip mailing list<br>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br>
https://doi.org/10.1371/journal.pcbi.1002202</span></div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>