<div dir="ltr"><div>Dear Fieldtrippers</div><div><br></div><div>We have a 3x3 design and MEG data, say only mag channels (n102) to simplify.</div><div><br></div><div>We want to perform a cluster-based permutation approach but timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', etc) cannot deal with interactions when you have more than three levels (true?)</div>
<div><br></div><div>So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical Package- and feed 'clusterstat.m' with them</div><div><br></div><div>We have done this with one channel over time with success. However, I am clueless now about how to solve the problem when dealing with the whole channel set.</div>
<div><br></div><div>I wonder what is the nature of the cfg.dim that we need to feed 'clusterstat.m' with.</div><div><br></div><div>Up to now, we use, (cioming out of -R-):</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div>size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds</div><div>size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000)</div></blockquote><div><br></div><div>and the following presets:</div><div><br>
</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>cfg=[];</div><div>cfg.clustercritval = Fcritmain; % We genereate this before hand</div><div>cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric';</div>
<div>cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here</div><div>load('neuromag306mag_neighb.mat');</div><div>cfg.neighbours = neighbours;  </div><div>cfg.feedback = 'yes';</div>
<div>cfg.numrandomization = 1000;</div><div>cfg.clusterstatistic = 'maxsum';</div><div>cfg.layout = 'neuromag306mag.lay';</div><div><span class="" style="white-space:pre"> </span>for i = 1:length(cfg.neighbours)</div>
<div><span class="" style="white-space:pre">    </span>cfg.channel{i} = cfg.neighbours(i).label;</div><div><span class="" style="white-space:pre">  </span>end</div><div><br></div><div>stat = clusterstat(cfg,statrnd, statobs)</div>
</blockquote><div><br></div><div>Which lead us to an error within findcluster </div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>Error using findcluster (line 59)</div><div>invalid dimension of spatdimneighbstructmat</div>
<div><br></div><div>Error in clusterstat (line 197)</div><div>            posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);</div></blockquote><div><br></div><div>If anybody has got some insigth it would be greatly appreciated. Or any hints. Are the size of my statobs and starnd correct? I can share more information and firstly apologize  if I was not able to describe the problem accurately, I am confused regarding that 'reshape' and the addition of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the problem arises first when findcluster.m tries to calculate the size of spatdimneighbstructmat</div>
<div><br></div><div>First line of findcluster.m calcualtes 'spatdimlength' by : " spatdimlength = size(onoff, 1);" which in our case is "1", which is obviously wrong?.</div><div><br></div><div>
manythanks&peace2all</div><div><br></div>-- <br><div><font>Constantino Méndez-Bértolo<br></font></div><div><font>Laboratorio de Neurociencia Clínica,</font><font><span style="font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline"> Centro de Tecnología Biomédica (CTB)</span></font></div>
<p dir="ltr" style="text-align:justify;margin-top:0pt;margin-bottom:0pt"><font><span style="font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">Parque Científico y Tecnológico d</span></font><font><span style="font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">e la UPM, </span></font><font><span style="font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">Campus de Montegancedo</span></font></p>
<p dir="ltr" style="text-align:justify;margin-top:0pt;margin-bottom:0pt"><font><span style="font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">28223 Pozuelo de</span></font><font><span style="font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline"> Alarcón, Madrid, SPAIN</span></font></p>
<p dir="ltr" style="text-align:justify;margin-top:0pt;margin-bottom:0pt"><br></p><p dir="ltr" style="text-align:justify;margin-top:0pt;margin-bottom:0pt"><font><span style="font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline"><img src="https://docs.google.com/a/ctb.upm.es/uc?id=0B975KkJxc3ZdOGI2ODg4OTItYTYwNC00MDY4LTk0YzQtZDQzYzUwZjQwMWYx&export=download&hl=es" height="40" width="131"></span></font></p>

</div>