<div dir="ltr">Dear all,<div><br></div><div>I would like to run ANOVA  to test the main and interaction effects on my beamforming results. (I used DISC beamformer)</div><div>I've already looked at the FAQ on the FieldTrip website and also the questions in the mailing list.</div><div><br></div><div>To check if I have done the steps correctly, I have also done the 2x2 ANOVA using SPM and I got significant results, but without FWE/FDR correction for multiple comparisons at the voxel level.</div><div><br></div><div>When I apply the steps described in the FieldTrip and also the mailing list (for cluster-based permutation) I could not get any significant clusters. This is surprising for me because I get always nicer results from permutation tests than I do not get from SPM.</div><div><br></div><div>I think I'm doing something wrong and I would appreciate any help.</div><div><br></div><div>So, as far as I understood, I can not use F statistics for 2x2 ANOVA, and therefore I used dependent sample T statistics for within-subject design as explained by Eric in the mailing list. </div><div><br></div><div>here is my code :</div><div>So, I have 2 conditions A and B, each with 2 levels (I & II).</div><div>For the averages, I used ft_ grandaverage for 2 conditions/levels, and I got a matrix of pow = [number of subjects x number of voxels] = [12x 411477]</div><div><br></div><div>Here is the code:</div><div><br></div><div>my data is arranged such that the columns are the conditions (A/B) and the rows are the levels (I/II).</div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;min-height:12px"><span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(34,139,34)">% Main effect of levels (I/II)</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">I  = ft_sourcegrandaverage([],GA{1,1:2});</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">II = ft_sourcegrandaverage([],GA{2,1:2});</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;min-height:12px"><span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(34,139,34)">% Main effect of conditions (A/B)</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">A = ft_sourcegrandaverage([],GA{1:2,1});</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">B = ft_sourcegrandaverage([],GA{1:2,2});</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;min-height:12px"><span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(34,139,34)">% Interaction effect</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg <span class="gmail-Apple-converted-space">          </span>= [];</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.operation = <span class="gmail-s1" style="color:rgb(160,32,240)">'subtract'</span>;</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.parameter = <span class="gmail-s1" style="color:rgb(160,32,240)">'pow'</span>;<span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;min-height:12px"><span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">INA = ft_math(cfg, GA{1,1}, GA{2,1}); <span class="gmail-s2" style="color:rgb(34,139,34)">% I - II (A)</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">INB = ft_math(cfg, GA{1,2}, GA{2,2}); <span class="gmail-s2" style="color:rgb(34,139,34)">% I - II (B)</span></p>
<p class="gmail-p4" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(34,139,34);min-height:12px"><span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p4" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(34,139,34);min-height:12px"><span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(34,139,34)">%% prepare the hypothesis testing</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg<span class="gmail-Apple-converted-space">                  </span>= [];</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.dim<span class="gmail-Apple-converted-space">              </span>= GA{1}.dim;</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.method <span class="gmail-Apple-converted-space">          </span>= <span class="gmail-s1" style="color:rgb(160,32,240)">'montecarlo'</span>;</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.correctm <span class="gmail-Apple-converted-space">        </span>= <span class="gmail-s1" style="color:rgb(160,32,240)">'cluster'</span>;</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.spmversion <span class="gmail-Apple-converted-space">      </span>= <span class="gmail-s1" style="color:rgb(160,32,240)">'spm12'</span>;</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.parameter<span class="gmail-Apple-converted-space">        </span>= <span class="gmail-s1" style="color:rgb(160,32,240)">'pow'</span>;</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(34,139,34)"><span class="gmail-s3" style="color:rgb(0,0,0)">cfg.numrandomization = </span><span class="gmail-s1" style="color:rgb(160,32,240)">'all'</span><span class="gmail-s3" style="color:rgb(0,0,0)">; </span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.correcttail<span class="gmail-Apple-converted-space">      </span>= <span class="gmail-s1" style="color:rgb(160,32,240)">'alpha'</span>;</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;min-height:12px"><br></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(34,139,34)"><span class="gmail-s3" style="color:rgb(0,0,0)">cfg.statistic<span class="gmail-Apple-converted-space">        </span>= </span><span class="gmail-s1" style="color:rgb(160,32,240)">'depsamplesT'</span><span class="gmail-s3" style="color:rgb(0,0,0)">;</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.alpha<span class="gmail-Apple-converted-space">            </span>= 0.05/2; <span class="gmail-s2" style="color:rgb(34,139,34)">% two tails</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.clusteralpha <span class="gmail-Apple-converted-space">    </span>= 0.01;</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(34,139,34)"><span class="gmail-s3" style="color:rgb(0,0,0)">cfg.tail <span class="gmail-Apple-converted-space">            </span>= 0; </span>% I also tried 1 for one tail</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.clustertail<span class="gmail-Apple-converted-space">      </span>= <span style="color:rgb(0,0,0)">cfg.tail</span>;</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.uvar <span class="gmail-Apple-converted-space">            </span>= 1; <span class="gmail-s2" style="color:rgb(34,139,34)">% subject</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.ivar <span class="gmail-Apple-converted-space">            </span>= 2; <span class="gmail-s2" style="color:rgb(34,139,34)">% conditions</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">cfg.design <span class="gmail-Apple-converted-space">          </span>= [repmat(1:numel(subjects),1,2); repelem([1 2],numel(subjects))];</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;min-height:12px"><span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p5" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(160,32,240)"><br></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">stat{1} <span class="gmail-Apple-converted-space">  </span>= ft_sourcestatistics(cfg,I,II); <span style="color:rgb(34,139,34)">% main effect (I/II)</span><br></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">stat{2} <span class="gmail-Apple-converted-space">  </span>= ft_sourcestatistics(cfg,A,B);  <span style="color:rgb(34,139,34)">% main effect (A/B)</span><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;min-height:12px"><span class="gmail-Apple-converted-space">stat{3} <span class="gmail-Apple-converted-space">  </span>= ft_sourcestatistics(cfg,INA,INB); </span><span style="color:rgb(34,139,34)">% Interaction</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><br></p>
<p class="gmail-p7" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px"><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">Side note: I also tried the one-tail option, but the results were not significant eighter. </span><br></p><p class="gmail-p7" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px"><span style="font-family:Arial,Helvetica,sans-serif;font-size:small"><br></span></p><p class="gmail-p7" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px"><span style="font-family:Arial,Helvetica,sans-serif;font-size:small"><br></span></p></div><div><br></div><div>I would appreciate any help!</div><div>Best,</div><div>Philip</div><div><br></div><div>  </div></div>