Hi Marco,<div><br></div><div>Oh right, there are some idiosyncrasies that I've found.<div><br></div><div>When you have a field called 'cohspctrm' then any statistics analysis (cluster, t-test, etc.) wants a labelcmb field like is originally output from ft_connectivityanalysis, not a hacked label field. This is because ft_freqstatistics creates the {'E1 - E2'} label field on its own in the for loop at line 108, but this is ONLY in the case of cohspctrm (see the if statement at line 102). Therefore it seems that you need to specify cfg.channel={'E1 - E2'} because this is the channel match that it's going to look for. I don't know what happens in a cluster analysis if you don't specify cfg.channel with coherence data—there can be a lot of channel combinations if you've got a full set (e.g., 129 channels is 8256 pairwise combinations). I also don't know what is technically happening if you've only computed coherence between a few channels.<div>

<div><br></div><div>If you're didn't output 'coh' from ft_connectivityanalysis and you kept the field name (e.g., output 'plv' and therefore you have 'plvspctrm'), then the statistics function will take the hacked label field (e.g., {'E1 - E2'}) because it falls down to the elseif statement at line 116.<div>

<br></div><div>And of course, if you want the grand average (e.g., for looking at a grand average plot) then you need to have the hacked label field.</div><div><br></div><div>This is all quite confusing. Would really appreciate some insight from someone who has been successful at doing coherence/plv analyses...</div>

<div><br></div><div>Matt<br><br><div class="gmail_quote">On Fri, Mar 25, 2011 at 11:10 AM, Marco Rotonda <span dir="ltr"><<a href="mailto:marco.rotonda@gmail.com">marco.rotonda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Thanks Matt<br>
<div class="im"><br>
> Could it be that you didn't define cfg.channel, cfg.latency, and cfg.frequency?<br>
<br>
</div>but that options shouldn't take the default (all) value if aren't specified?<br>
<div class="im"><br>
<br>
> (and cfg.avgoverfreq—unless, is there a way to run a cluster analysis across multiple frequencies?)<br>
<br>
> It seems to me that for a cluster analysis on plv data you need to rename the 'plvspctrm' field to 'cohspctrm' and define cfg.channel with the format {'channel - cohrefchannel'}<br>
<br>
</div>that's almost the trick I did following Jan suggestion:<br>
<div class="im"><br>
rename plvspctrm into powspctrm and create a label-field, e.g. by   for i =1:size(data_conn.labelcmb,1) data_conn.label{k} = [data_conn.labelcmb{i,1},'_',data_conn.labelcmb{i,2}]; end (and remove the labelcmb field)<br>


<br>
<br>
</div>btw I added all the cfg you suggested and the cfg.avgoverfreq but I'm getting the same error...<br>
<div><div></div><div class="h5"><br>
Marco<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
</div></div></blockquote></div><br></div></div></div></div></div>