<div dir="ltr">Hi Jac,<div><br></div><div>I would start by plotting your (t)stats, and for simplicity doing that with ft_singleplotER (cfg.param = 'stat') rather than ft_clusterplot.</div><div>Then try plotting the power-difference. This should not be more than a subtraction of data_diff.powspctrm = data1.powspctrm - data2.powspctrm, . No reshaping should be needed.</div><div><div>The problem is probably a mistake somewhere keeping track of dimensions/latencies etc. which is tricky with clusters. </div><div>Also, make sure to clear your cfg before every function so you don't carry the cfg of a previous function into the next. That will also help readability and debugging.</div></div><div><br></div><div>HTH,</div><div>Stephen</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 18 Jan 2019 at 19:28, Jac Billington <<a href="mailto:J.Billington@leeds.ac.uk">J.Billington@leeds.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_1277958695393631929divtagdefaultwrapper" 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:0px;margin-bottom:0px">Dear experts,</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">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:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">An example output is located in dropbox here:
<a href="https://www.dropbox.com/sh/64m3xpgco2uavky/AADT6-rXEdylVzHN1lY-q7SNa?dl=0" class="gmail-m_1277958695393631929OWAAutoLink" id="gmail-m_1277958695393631929LPlnk961654" target="_blank">
https://www.dropbox.com/sh/64m3xpgco2uavky/AADT6-rXEdylVzHN1lY-q7SNa?dl=0</a></p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">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:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">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:0px;margin-bottom:0px"><span><br>
</span></p>
<p style="margin-top:0px;margin-bottom:0px"><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:0px;margin-bottom:0px"><span><br>
</span></p>
<p style="margin-top:0px;margin-bottom:0px"><span>Thank you in advance. Jac</span><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"></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>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>