<div dir="ltr">Dear community,<div><br></div><div>I'm having trouble defining the design matrix ("cfg.design") to perform a cluster-based permutation testing.</div><div><br></div><div>There are 17 subjects (1 group only) and 5 conditions in my dataset.</div><div>My data is organized in the "DS_GA_induc_gamma" data structure, and the 5 conditions to be compared are organized within the data structure as 

"DS_GA_induc_gamma.cond_A", 

"DS_GA_induc_gamma.cond_B", 

"DS_GA_induc_gamma.cond_C", 

"DS_GA_induc_gamma.cond_D", 

"DS_GA_induc_gamma.cond_E"      </div><div><br></div><div>My code is as follows:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">cfg                  = [];</font></div><div><font face="monospace">cfg.statistic        = 'ft_statfun_depsamplesFunivariate'; </font></div><div><font face="monospace">cfg.method           = 'montecarlo';       </font></div><div><font face="monospace">cfg.correctm         = 'cluster';           </font></div><div><font face="monospace">cfg.clusteralpha     = 0.05;                </font></div><div><font face="monospace">cfg.clusterstatistic = 'maxsum';            </font></div><div><font face="monospace">cfg.minnbchan        = 0;                   </font></div><div><font face="monospace">cfg.tail             = 0;                   </font></div><div><font face="monospace">cfg.clustertail      = 0;</font></div><div><font face="monospace">cfg.alpha            = 0.025;               </font></div><div><font face="monospace">cfg.numrandomization = 1000;                </font></div><div><font face="monospace">cfg_neighb.method    = 'triangulation';     </font></div><div><font face="monospace">cfg_neighb.layout    = 'acticap-64ch-standard2.mat';</font></div><div><font face="monospace">cfg.neighbours       = ft_prepare_neighbours(cfg_neighb, DS_GA_induc_gamma.cond_A);</font></div><div><font face="monospace">cfg.design   = <i>See below</i></font></div><div><font face="monospace">cfg.uvar     = 1;</font></div><div><font face="monospace">cfg.ivar     = 2;</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">induc_gamma_diff  = ft_freqstatistics(cfg, DS_GA_induc_gamma.cond_A, DS_GA_induc_gamma.cond_B,...</font></div><div><font face="monospace">    DS_GA_induc_gamma.cond_C, DS_GA_induc_gamma.cond_D, DS_GA_induc_gamma.cond_E);</font></div><div><font face="monospace"><br></font></div></blockquote>So far, I've tried the following "cfg.design" definitions and have got the following errors:<div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><b>1st try:</b></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">cfg.design = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1;... </font></div></blockquote></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font face="monospace">        2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2;...</font></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font face="monospace">        3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3;...<br>        4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4;...<br>        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5];<br><br></font></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>Output:<br></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font face="monospace">constructing randomized design<br>total number of measurements     = 5<br>total number of variables        = 17<br>number of independent variables  = 1<br>number of unit variables         = 1<br>number of within-cell variables  = 0<br>number of control variables      = 0<br>using a permutation resampling approach<br>repeated measurement in variable 1 over 5 levels<br>number of repeated measurements in each level is 1 1 1 1 1 <br>computing a parametric threshold for clustering<br>Error using ft_statfun_depsamplesFunivariate (line 94)<br>Invalid specification of the design array.<br><font color="#ff0000">Error using ft_statistics_montecarlo (line 244)<br>could not determine the parametric critical value for clustering<br><br>Error in ft_freqstatistics (line 191)<br>  [stat, cfg] = statmethod(cfg, dat, design);</font><br></font></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><br></blockquote></div></blockquote><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><b>2nd try:<br></b><font face="monospace">cfg.design =<br><br>  Columns 1 through 22<br>     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16    17     1     2     3     4     5<br>     1     1     1     1     1     1     1     1     1     1     1     1     1     1     1     1     1     2     2     2     2     2<br><br>  Columns 23 through 44<br>     6     7     8     9    10    11    12    13    14    15    16    17     1     2     3     4     5     6     7     8     9    10<br>     2     2     2     2     2     2     2     2     2     2     2     2     3     3     3     3     3     3     3     3     3     3<br><br>  Columns 45 through 66<br>    11    12    13    14    15    16    17     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15<br>     3     3     3     3     3     3     3     4     4     4     4     4     4     4     4     4     4     4     4     4     4     4<br><br>  Columns 67 through 85<br>    16    17     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16    17<br>     4     4     5     5     5     5     5     5     5     5     5     5     5     5     5     5     5     5     5<br></font></blockquote></div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>Output:</div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace" color="#ff0000">Error using ft_freqstatistics (line 178)<br>the length of the design matrix (2) does not match the number of observations in the data (5)</font><br> <br></div></blockquote></blockquote><div><br></div><div>Can anyone help me with this, please? </div><div><br></div><div>Also, is there any problem comparing substructures of a data structure using "ft_freqstatistics" the way I'm doing?</div><div><br></div><div><br></div><div>Thank you,</div><div>Carolina Ogawa</div></div>