<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi Tahereh,</div><div>Re: first- this shouldn’t happen unless you have really only freqs 1-10Hz</div><div>Re: second- since you have only one channel you shouldn’t specify ‘neighbourdist’, but cfg.neighbours = []. In that way clustering is done along the freq and time dimensions the adjacency of which is defined by the time freq resolution.</div><div><br></div><div>best</div><div>tzvetan</div><div><br><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi fieldtripers,<div><br></div><div>I am trying to do a cluster permutation on Time-frequency data of a single channel (of 64 channel EEG) in a between subject design based on the example provided <a href="http://www.fieldtriptoolbox.org/example/apply_clusterrandanalysis_on_tfrs_of_power_that_were_computed_with_besa">here</a>. Two weird things happen. </div><div>First, although I set cfg.frequency = 'all' for stats, but it always returns results for only ~1-10Hz instead of 1:15 Hz I have in my freq data (to be precise : stat.cfg.frequency =[0.9995 9.9951]).</div><div>Second, based on the explanation in <a href="http://www.sciencedirect.com/science/article/pii/S0165027007001707">this paper</a>, I assume cfg.neighbourdist in single-sensor test somehow shows the number of adjacent points, but when I change this number the clusters don't change at all. </div><div>Here is my code, I would appreciate if anyone could tell me what is happening.</div><div><br></div><div>Thanks,</div><div>Tahereh </div><div><br></div><div>% Time frequency analysis</div><div><div>cfg = [];</div><div>cfg.output = 'pow';</div><div>cfg.method = 'mtmconvol';</div><div>cfg.taper = 'hanning';</div><div>f1 = 1;f2 = 15; fstep = 0.1;</div><div>cfg.foi =f1:fstep:f2;</div><div>t1 = -1; t2 = 1;</div><div>cfg.toi = t1:0.02:t2;</div><div>n_cycles = 5;</div><div>cfg.t_ftimwin = n_cycles ./cfg.foi; </div><div>cfg.keeptrials ='no';</div></div><div><br></div><div>[freqdata] = ft_freqanalysis(cfg, data);<br></div><div><br></div><div>%store freq data for each condition/subject</div><div> TFDesc(Condition,subject) = {ft_freqdescriptives(cfg,freqdata)}<br></div><div><br></div><div>%Comparing Condition1 and Condition2</div><div><div>cfg = [];</div><div>Condition1_avg= ft_freqgrandaverage(cfg, TFDesc{cond1,: });</div><div>Condition2_avg = ft_freqgrandaverage(cfg, TFDesc{cond2,: });</div></div><div><br></div><div>% make a dummy structure with the difference between Condition 1 & 2<br></div><div>avgDiff = Condition1_avg;<br></div><div>avgDiff.powspctrm = Condition1_avg.powspctrm-Condition2_avg.powspctrm;</div><div><br></div><div><div>cfg = [];</div><div>cfg.channel = 'FP2'<br></div><div>cfg.frequency = 'all'</div><div>cfg.neighbourdist = 4;</div><div>cfg.latency = 'all'</div><div>cfg.avgovertime = 'no';</div><div>cfg.avgoverfreq ='no';</div><div>cfg.avgoverchan = 'no';</div><div><br></div><div>cfg.clusteralpha = 0.05;</div><div>cfg.statistic = 'ft_statfun_depsamplesT';</div><div>cfg.numrandomization = 500;</div><div>cfg.correctm = 'cluster';</div><div>cfg.method = 'montecarlo';</div><div>cfg.design = [</div><div> 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 % subject number</div><div> 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 ]; % condition number</div><div>cfg.uvar = 1; % "subject" is unit of observation</div><div>cfg.ivar = 2; % "condition" is the independent variable</div><div>cfg</div><div>stat = ft_freqstatistics(cfg, TFDesc{cond1,selectedSubj}, TFDesc{cond2,selectedSubj});</div></div><div><br></div><div><br></div></div>
_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br></body></html>