<div dir="ltr"><div dir="ltr">Dear FieldTrip community,<div><br></div><div>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><br></div><div>For thoroughness, below is my call to freqanalysis for one participant's data:</div><div><br></div><div>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space"> </span>cfg <span class="gmail-Apple-converted-space"> </span>= [];<span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space"> </span>cfg.output<span class="gmail-Apple-converted-space"> </span>= <span class="gmail-s1" style="color:rgb(178,69,243)">'powandcsd'</span>;</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space"> </span>cfg.method<span class="gmail-Apple-converted-space"> </span>= <span class="gmail-s1" style="color:rgb(178,69,243)">'mtmconvol'</span>;</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space"> </span>cfg.foi <span class="gmail-Apple-converted-space"> </span>= 2:1:40;</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space"> </span>cfg.t_ftimwin <span class="gmail-Apple-converted-space"> </span>=<span class="gmail-Apple-converted-space"> </span>2 ./ cfg.foi; </p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;color:rgb(37,153,45)"><span class="gmail-s3" style="color:rgb(0,0,0)"><span class="gmail-Apple-converted-space"> </span>cfg.tapsmofrq <span class="gmail-Apple-converted-space"> </span>= 0.4 *cfg.foi; </span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space"> </span>cfg.toi <span class="gmail-Apple-converted-space"> </span>= -0.4:0.01:0.4;</p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier;min-height:12px"><span class="gmail-Apple-converted-space"> </span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space"> </span>dataSPfreq_coh = ft_freqanalysis(cfg, dataSPfreq_coh);<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2">and then for my call to connectivity analysis:</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span style="font-family:Courier;font-size:10px"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span style="font-family:Courier;font-size:10px">cfg</span><span class="gmail-Apple-converted-space" style="font-family:Courier;font-size:10px"> </span><span style="font-family:Courier;font-size:10px">= [] ;</span><br></p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.method = <span class="gmail-s1" style="color:rgb(178,69,243)">'coh'</span>;</p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.complex = <span class="gmail-s1" style="color:rgb(178,69,243)">'absimag'</span>;<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal">
</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier">mycoh = ft_connectivityanalysis(cfg, dataSPfreq_coh)</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2">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></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2">I then attempted to apply freqstatistics, by first defining my neighbours which seems fine, and then creating the follow cfg:</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2"><br></font></p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg <span class="gmail-Apple-converted-space"> </span>= [];</p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.neighbours<span class="gmail-Apple-converted-space"> </span>= neighbours; <span class="gmail-s1" style="color:rgb(37,153,45)">% defined as above</span></p><p class="gmail-p1" style="margin:0px;font:10px Courier">%<font color="#6aa84f">cfg.channelcmb = {<span class="gmail-s2">'F3'</span>, <span class="gmail-s2">'FCZ'</span>}<span class="gmail-Apple-converted-space"> </span></font><span style="color:rgb(37,153,45)"> </span></p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.parameter <span class="gmail-Apple-converted-space"> </span>= <span class="gmail-s2" style="color:rgb(178,69,243)">'cohspctrm'</span>;</p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.method<span class="gmail-Apple-converted-space"> </span>= <span class="gmail-s2" style="color:rgb(178,69,243)">'montecarlo'</span>;</p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.statistic <span class="gmail-Apple-converted-space"> </span>= <span class="gmail-s2" style="color:rgb(178,69,243)">'ft_statfun_indepsamplesT'</span>;</p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.correcttail <span class="gmail-Apple-converted-space"> </span>= <span class="gmail-s2" style="color:rgb(178,69,243)">'alpha'</span>;<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.correctm<span class="gmail-Apple-converted-space"> </span>= <span class="gmail-s2" style="color:rgb(178,69,243)">'cluster'</span>;</p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.numrandomization<span class="gmail-Apple-converted-space"> </span>= 100; <font color="#6aa84f">% just for testing purposes</font></p><p class="gmail-p2" style="margin:0px;font:10px Courier"><font color="#000000">cfg.minnbchan <span class="gmail-Apple-converted-space"> </span>= 2;</font></p><p class="gmail-p2" style="margin:0px;font:10px Courier;color:rgb(37,153,45)">%cfg.latency <span class="gmail-Apple-converted-space"> </span>= mylatency; % latency of interest</p><p class="gmail-p1" style="margin:0px;font:10px Courier">cfg.spmversion<span class="gmail-Apple-converted-space"> </span>= <span class="gmail-s2" style="color:rgb(178,69,243)">'spm12'</span>;<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p1" style="margin:0px;font:10px Courier"><br></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2">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></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2">However, I then into in errors:</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000">Error using findcluster (line 50)</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000">invalid dimension of spatdimneighbstructmat</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000">Error in clusterstat (line 201)</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000"> posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000">Error in ft_statistics_montecarlo (line 352)</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000"> [stat, cfg] = clusterstat(cfg, statrand, statobs);</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000">Error in ft_freqstatistics (line 190)</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000"></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000"> [stat, cfg] = statmethod(cfg, dat, design);</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font size="1" face="monospace, monospace" color="#cc0000"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2">I had primarily two questions:</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2">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></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2">2) Is the overall pipeline even correct for attempting to do a between groups coherence values analysis?</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2">Any help would be greatly appreciated.</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2">Best,</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font color="#000000" face="arial, helvetica, sans-serif" size="2">Paul</font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" size="2"><br></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:10px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space"><br></span></p></div></div></div>