Hi there,<div>I'm trying to perform the same analysis and the trick Jan give to tranform the pvlspctrm to powerspctrm and labels give me the ability to compute the grandaverage.</div><div>But now I'm trying to do a cluster analysis and if I give this simple script:</div>
<div><br></div><div><div>load GApun;</div><div>load GArew;</div><div><br></div><div>cfg = [];</div><div>cfg.method           = 'montecarlo';</div><div>cfg.statistic        = 'depsamplesT';</div><div>cfg.correctm         = 'cluster';</div>
<div>cfg.clusteralpha     = 0.05;</div><div>cfg.clusterstatistic = 'maxsum';</div><div>cfg.minnbchan        = 2;</div><div>cfg.tail             = 0;</div><div>cfg.clustertail      = 0;</div><div>cfg.alpha            = 0.025;</div>
<div>cfg.numrandomization = 500;</div><div><br></div><div>subj = 40;</div><div>design = zeros(2,2*subj);</div><div>for i = 1:subj</div><div>  design(1,i) = i;</div><div>end</div><div>for i = 1:subj</div><div>  design(1,subj+i) = i;</div>
<div>end</div><div>design(2,1:subj)        = 1;</div><div>design(2,subj+1:2*subj) = 2;</div><div><br></div><div>cfg.design   = design;</div><div>cfg.uvar     = 1;</div><div>cfg.ivar     = 2;</div><div><br></div><div>[stat] = ft_freqstatistics(cfg, GApun, GArew);</div>
</div><div><br></div><div><br></div><div><br></div><div>I have this error:</div><div><div>??? Undefined function or variable "sens".</div><div><br></div><div>Error in ==> ft_neighbourselection at 95</div><div>
if ~isstruct(sens)</div><div><br></div><div>Error in ==> statistics_wrapper at 241</div><div>    cfg.neighbours = ft_neighbourselection(cfg,varargin{1});</div><div><br></div><div>Error in ==> ft_freqstatistics at 127</div>
<div>[stat, cfg] = statistics_wrapper(cfg, varargin{:});</div><div><br></div><div>Error in ==> calcoloStudent at 31</div><div>[stat] = ft_freqstatistics(cfg, GApun, GArew); </div></div><div><br></div><div><br></div><div>
<br></div><div>Following the errors I've found that the problem is in:</div><div>cfg.correctm         = 'cluster';</div><div><br></div><div>If I comment it some analysis are done, but I think that clusters are skipped (here are some comments):</div>
<div><br></div><div><div>Warning: The field cfg.clusterstatistic is unused, it will be removed from your</div><div>configuration</div><div>The field cfg.clusteralpha is unused, it will be removed from your configuration</div>
<div>The field cfg.clustertail is unused, it will be removed from your configuration</div></div><div><br></div><div>and at the end of randomization:</div><div>not performing a correction for multiple comparisons</div><div>
<br></div><div><br></div><div>Any idea?</div><div><br></div><div>Marco</div><div><br></div>