<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Paul,
<div class=""><br class="">
</div>
<div class="">Currently, it’s not possible to use ft_freqstatistics for statistical inference of coherence in an all-by-all channel pair fashion.</div>
<div class="">The reason is that clustering in 4D space is not implemented.</div>
<div class="">What is possible, though, is to compare coherence across conditions between all channels, and a separate reference channel (e.g. EMG). This will probably require some tweaks to the input data (e.g. replace ‘labelcmb’, with ‘label’, and replace
‘dimord’ with ‘chan_freq’). Using one of the EEG channels as a ‘reference’ should be in principle possible as well (at least in terms of algorithm, whether interpretations based on inferential decisions make sense in this case, that’s up to the user).</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 7 Oct 2018, at 13:52, Paul Dhami <<a href="mailto:pdhami06@gmail.com" class="">pdhami06@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Dear FieldTrip community,
<div class=""><br class="">
</div>
<div class="">sorry for sending another email out, but I am still having trouble with this issue. I am attempting to do a between group comparison of coherency values from one reference channel to all other remaining 59 EEG channels.</div>
<div class=""><br class="">
</div>
<div class="">For thoroughness, below is my call to freqanalysis for one participant's data:</div>
<div class=""><br class="">
</div>
<div class="">
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>cfg <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= [];<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>cfg.output<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= <span class="gmail-m_-6350960945969056462gmail-s1" style="color:rgb(178,69,243)">'powandcsd'</span>;</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>cfg.method<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= <span class="gmail-m_-6350960945969056462gmail-s1" style="color:rgb(178,69,243)">'mtmconvol'</span>;</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>cfg.foi <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= 2:1:40;</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>cfg.t_ftimwin <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>=<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>2
./ cfg.foi; </div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px; color: rgb(37, 153, 45);" class="">
<span class="gmail-m_-6350960945969056462gmail-s3" style=""><span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>cfg.tapsmofrq <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= 0.4 *cfg.foi; </span></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>cfg.toi <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= -0.4:0.01:0.4;</div>
<p class="gmail-m_-6350960945969056462gmail-p3" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;margin:0px;min-height:12px">
<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span><br class="webkit-block-placeholder">
</p>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>dataSPfreq_coh = ft_freqanalysis(cfg, dataSPfreq_coh);<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"><br class="">
</span></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">and then for my call to connectivity analysis:</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<span style="font-family:Courier;font-size:10px" class=""><br class="">
</span></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<span style="font-family:Courier;font-size:10px" class="">cfg</span><span class="gmail-m_-6350960945969056462gmail-Apple-converted-space" style="font-family:Courier;font-size:10px"> </span><span style="font-family:Courier;font-size:10px" class="">= [] ;</span><br class="">
</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.method = <span class="gmail-m_-6350960945969056462gmail-s1" style="color:rgb(178,69,243)">'coh'</span>;</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.complex = <span class="gmail-m_-6350960945969056462gmail-s1" style="color:rgb(178,69,243)">'absimag'</span>;<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span></div>
<p class="gmail-m_-6350960945969056462gmail-p1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:small;line-height:normal;margin:0px">
</p>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
mycoh = ft_connectivityanalysis(cfg, dataSPfreq_coh)</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<br class="">
</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<br class="">
</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">In an attempt to reduce the pairs in 'labelcmb', I then replaced it with only those pairs of electrodes I was interested in (e.g. F3 and its 59 available pairings with all other electrodes), as well
as changed the first dimension of cohspctrm (electrode pairs) to include only those of interest (thus reducing it to 59 x 39 x 81 chncmb_freq_time dimord).</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">I then attempted to apply freqstatistics, by first defining my neighbours which seems fine, and then creating the follow cfg:</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= [];</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.neighbours<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= neighbours; <span class="gmail-m_-6350960945969056462gmail-s1" style="color:rgb(37,153,45)">% defined as above</span></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
%<font color="#6aa84f" class="">cfg.channelcmb = {<span class="gmail-m_-6350960945969056462gmail-s2">'F3'</span>, <span class="gmail-m_-6350960945969056462gmail-s2">'FCZ'</span>}<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span></font><span style="color:rgb(37,153,45)" class="">
</span></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.parameter <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= <span class="gmail-m_-6350960945969056462gmail-s2" style="color:rgb(178,69,243)">'cohspctrm'</span>;</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.method<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= <span class="gmail-m_-6350960945969056462gmail-s2" style="color:rgb(178,69,243)">'montecarlo'</span>;</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.statistic <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= <span class="gmail-m_-6350960945969056462gmail-s2" style="color:rgb(178,69,243)">'ft_statfun_indepsamplesT'</span>;</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.correcttail <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= <span class="gmail-m_-6350960945969056462gmail-s2" style="color:rgb(178,69,243)">'alpha'</span>;<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.correctm<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= <span class="gmail-m_-6350960945969056462gmail-s2" style="color:rgb(178,69,243)">'cluster'</span>;</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.numrandomization<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= 100; <font color="#6aa84f" class="">% just for testing purposes</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<font class="">cfg.minnbchan <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= 2;</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px; color: rgb(37, 153, 45);" class="">
%cfg.latency <span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= mylatency; % latency of interest</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
cfg.spmversion<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span>= <span class="gmail-m_-6350960945969056462gmail-s2" style="color:rgb(178,69,243)">'spm12'</span>;<span class="gmail-m_-6350960945969056462gmail-Apple-converted-space"> </span></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;" class="">
<br class="">
</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; margin: 0px; min-height: 14px;" class="">
<br class="">
</div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">I then ran into the error of a 'Reference to non-existent field 'label', an error that no longer appeared once I specified the neighbours information.</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">However, I then into in errors:</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class="">Error using findcluster (line 50)</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class="">invalid dimension of spatdimneighbstructmat</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class="">Error in clusterstat (line 201)</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class=""> posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class="">Error in ft_statistics_montecarlo (line 352)</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class=""> [stat, cfg] = clusterstat(cfg, statrand, statobs);</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class="">Error in ft_freqstatistics (line 190)</font></div>
<p class="gmail-m_-6350960945969056462gmail-p1" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:small;line-height:normal;margin:0px">
<font size="1" face="monospace, monospace" color="#cc0000" class=""></font></p>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class=""> [stat, cfg] = statmethod(cfg, dat, design);</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font size="1" face="monospace, monospace" color="#cc0000" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">I had primarily two questions:</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">1) Going through the findcluster document, is it right to say that this error is related to my editing the chncmbs and the cohspctrm which conflicts with the neighbour I specified.</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">2) Is the overall pipeline even correct for attempting to do a between groups coherence values analysis?</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">Any help would be greatly appreciated.</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class=""><br class="">
</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">Best,</font></div>
<div style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: small; line-height: normal; margin: 0px;" class="">
<font face="arial, helvetica, sans-serif" size="2" class="">Paul</font></div>
<br class="gmail-Apple-interchange-newline">
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>