<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Dear Annie</p>
<p><br>
</p>
<p>I think you are on the right track! If you are looking for the interaction effect between 2 group factors and 2 within group factors, calculating the difference wave between the two conditions within group and using the difference waves in a t-test will
 is conceptually the same as the interaction in a 2x2 ANOVA.</p>
<p><br>
</p>
<p>One thing is that it looks like you are creating the difference wave on the grand averages (assuming GA12, GA11, etc. stands for grand average, i.e., the group averages). You should do this on individual participant level data instead:: subtract condition
 A from condition B for each participant. The following step with ft_freqstatistics should also include the individual level data, not the group-level average data.<br>
</p>
<p><br>
</p>
<br>
<br>
<p>For expanding to a 3x2 mixed ANOVA design</p>
<p><br>
<br>
    <br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Fra:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> på vegne af Annie Menart via fieldtrip <fieldtrip@science.ru.nl><br>
<b>Sendt:</b> 2. juli 2025 20:49:58<br>
<b>Til:</b> fieldtrip@science.ru.nl<br>
<b>Cc:</b> Annie Menart<br>
<b>Emne:</b> [FieldTrip] 3x2 cluster-based permutation and random seed</font>
<div> </div>
</div>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear Fieldtrippers,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We are currently adapting a 2 group by 2 condition cluster-based permutation to be a 3 group by 2 condition cluster-based permutation. Following the documentation, we are subtracting the conditions to test the interaction. Does the code below look like a valid
 way to do this? It's running correctly and we don't get errors, but we wanted to make sure, since it differed from the setup of the K-by-L example.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Example code from the 2x2 documentation :</div>
<pre class="elementToProof" style="margin-top: 0px; margin-bottom: 0px; display: block;"><div class="elementToProof" style="text-align: left; text-indent: 0px; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);"><code style="font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;">cfg = [];
cfg.parameter = 'powspctrm';
cfg.operation = 'subtract';
GAdiff11_12 = ft_math(cfg, GA11, GA12);
GAdiff21_22 = ft_math(cfg, GA21, GA22);</code></div></pre>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
...</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[stat] = ft_freqstatistics(cfg, GAdiff11_12, GAdiff21_22);</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Our adaptation of the example code to be a 3x2 interaction:</div>
<pre class="elementToProof" style="margin-top: 0px; margin-bottom: 0px; display: block;"><div class="elementToProof" style="text-align: left; text-indent: 0px; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);"><code style="font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;">cfg = [];
cfg.parameter = 'powspctrm';
cfg.operation = 'subtract';
GAdiff11_12 = ft_math(cfg, GA11, GA12);
GAdiff21_22 = ft_math(cfg, GA21, GA22);</code></div></pre>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
GAdiff31_32 = ft_math(cfg, GA31, GA32);</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
...</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[stat] = ft_freqstatistics(cfg, GAdiff11_12, GAdiff21_22, GAdiff31_32);</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Secondly, for cluster-based permutations (ft_freqstatistics), can you set the seed using cfg.randomseed? In the documentation, we've seen it used for ft_componentanalysis, but we weren't sure if it also worked for ft_freqstatistics. We have it running with
 no errors, but wanted to make sure since we didn't see the parameter cfg.randomseed used directly in ft_freqstatistics. If not, is there a way to set the seed?</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Annie</div>
</div>
</body>
</html>