<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">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;">
<p style="margin-top:0; margin-bottom:0">Dear experts,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I've recently begun  using fieldtrip and have been following tutorials well. however, I have perhaps run into a problem with ft_clusterplot.
<br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">An example output is located in dropbox here:
<a href="https://www.dropbox.com/sh/64m3xpgco2uavky/AADT6-rXEdylVzHN1lY-q7SNa?dl=0" class="OWAAutoLink" id="LPlnk961654" previewremoved="true">
https://www.dropbox.com/sh/64m3xpgco2uavky/AADT6-rXEdylVzHN1lY-q7SNa?dl=0</a></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">My negative cluster labels don't seem to be located in a cluster per se, or in regions with a greater raw effect. This seems at odds with tutorial examples and papers. Apologies if I'm missing something, but can this
 be correct? <br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I did have earlier errors ('<span>  ft_error('unsupported dimord %s', dimord);</span>') but I realised this was because dimensions of my
<span>stat.raweffect (64 5 200) were in conflict with collapsing time and frequency when running
<span>ft_freqstatistics</span>. Reducing stat.raweefect to 64 1 solved this error, but I'm wondering if I have done something wrong.
<br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>My code is posted below and I'd happily be poited to some papers if I'm misunderstanding this. </span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Thank you in advance. Jac</span><br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div>  % load data  (from ft_freqanalysis) <br>
        load(filename1);<br>
        con1= freqScaling<br>
        load(filename2);<br>
        con2=freqScaling;<br>
       <br>
        %%%% run the stats: <br>
        cfg = [];<br>
        cfg.channel          =  'all';<br>
        cfg.latency          = [4 6];<br>
        cfg.frequency        = [8 12];<br>
        cfg.method           = 'montecarlo';<br>
        cfg.statistic        = 'ft_statfun_indepsamplesT';<br>
        cfg.correctm         = 'cluster';<br>
        cfg.clusteralpha     = 0.05;<br>
        cfg.clusterstatistic = 'maxsum';<br>
        cfg.minnbchan        = 2;<br>
        cfg.tail             = 0;<br>
        cfg.clustertail      = 0;<br>
        cfg.alpha            = 0.025;<br>
        cfg.numrandomization = 500; <br>
        cfg.avgoverchan = 'no'                <br>
        cfg.avgovertime = 'yes'                 <br>
        cfg.avgoverfreq = 'yes' <br>
        % prepare_neighbours determines what sensors may form clusters<br>
        cfg_neighb.method    = 'distance';<br>
        cfg.neighbours       = ft_prepare_neighbours(cfg_neighb, elec);</div>
<div><br>
        design = zeros(1,size(con1.powspctrm,1) + size(con2.powspctrm,1));<br>
        design(1,1:size(con1.powspctrm,1)) = 1;<br>
        design(1,(size(con1.powspctrm,1)+1):(size(con1.powspctrm,1)+ size(con2.powspctrm,1))) = 2;<br>
        cfg.design           = design;<br>
        cfg.ivar             = 1;<br>
<br>
<br>
        [stat] = ft_freqstatistics(cfg, con1, con2);<br>
    <br>
    <br>
  <br>
       cfg=[]<br>
       cfg.keeptrials    = 'no'<br>
       cfg.latency          = [4 6];<br>
       cfg.frequency        = [8 12];<br>
       con1 = ft_freqdescriptives(cfg, con1);<br>
       con2  = ft_freqdescriptives(cfg, con2);<br>
        <br>
       %%%% resize powerspec to avoid dimord error. Collapse freq/ time<br>
       con1rs=mean(con1.powspctrm,3)   %%% collapse time dim<br>
       con2rs=mean(con2.powspctrm,3)   %%% collapse time dim<br>
       con1rs=mean(con1rs,2)   %%% collapse freq<br>
       con2rs=mean(con2rs,2) <br>
       stat.raweffect = con1rs-con2rs<br>
<br>
       cfg.alpha  = 0.025;<br>
       cfg.zparam = 'raweffect';<br>
       cfg.zlim   = [-1 3];<br>
        cfg.layout = 'biosemi64.lay';<br>
       cfg.subplotsize = ([1 1]);<br>
        ft_clusterplot(cfg, stat);</div>
<br>
<p></p>
<br>
</div>
</body>
</html>