<div dir="ltr">Dear fellow fieldtrip users,<div>I would like to implement a clusterstatistics independentT test on a time-frequency datasets that I've acquired using the ft_freqanalysis function. When I run ft_freqstatistics on the data it would give me stats result which is based on comparing the absolute values of power spectrum instead the relative change with respect to the baseline. I have tried to perform to do my relative change power spectrum data manually but it seems that when I run the ft_freqstatistics it produces an error of which I could not figure out on why.</div><div><br></div><div>Here is my code:<span style="color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"> </span></div><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"> </p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">C_1 = {outP10{1} outP10{2} outP10{3} outP10{4} outP10{5} outP10{6} outP10{7} outP10{8} outP10{9} outP10{10} outP10{11} outP10{12} outP10{13} outP10{14} outP10{15} outP10{16} outP10{17} outP10{18}}; </p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"> </p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">C_2 = {outM10{1} outM10{2} outM10{3} outM10{4} outM10{5} outM10{6} outM10{7} outM10{8} outM10{9} outM10{10} outM10{11} outM10{12} outM10{13} outM10{14} outM10{15} outM10{16} outM10{17} outM10{18}}; </p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"> </p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">%% Performing cluster statistics for the paradigm</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg = [];</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.layout = <span class="">'EEG_KR.lay'</span>;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">lay = ft_prepare_layout(cfg);</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">% Needs to change this</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"><span class="">cfg.latency = [0 0.6]; </span>%Need to look this up according to what </p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"><span class="">cfg.frequency = [8 12];</span>% Need to do it for different frequency bands (theta, alpha, beta, gamma).</p><p class="" id="yui_3_16_0_1_1449462105095_2601" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.channel = <span class="">'all'</span>;</p><p class="" id="yui_3_16_0_1_1449462105095_2599" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.avgovertime = <span class="">'no'</span>;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.avgoverfreq = <span class="">'yes'</span>;</p><p class="" id="yui_3_16_0_1_1449462105095_2597" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.avgoverchan = <span class="">'no'</span>;</p><p class="" id="yui_3_16_0_1_1449462105095_2596" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"><span class="">cfg.statistic = </span>'ft_statfun_indepsamplesT'<span class="">;</span></p><p class="" id="yui_3_16_0_1_1449462105095_2605" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.numrandomization = 1000;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.correctm = <span class="">'cluster'</span>;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.method = <span class="">'montecarlo'</span>;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.computeprob = <span class="">'yes'</span>;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.computecritval = <span class="">'yes'</span>;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.clusteralpha = 0.05;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.clusterstatistic = <span class="">'maxsum'</span>;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.minnbchan = 3;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.tail = 0;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.clustertail = 0;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.alpha = 0.05;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg_neighb.layout = lay;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg_neighb.method = <span class="">'triangulation'</span>;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.neighbours = ft_prepare_neighbours(cfg_neighb); </p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.ivar = 1;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.design = [ones(1,18) 2*ones(1,18)];<br></p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">stat = ft_freqstatistics(cfg, C_2{:}, C_1{:});</p><p class="" id="yui_3_16_0_1_1449462105095_2616" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"> <br></p><p class="" id="yui_3_16_0_1_1449462105095_2614" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">%% Plotting significant clusters</p><p class="" id="yui_3_16_0_1_1449462105095_2613" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"> </p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg = [];</p><p class="" id="yui_3_16_0_1_1449462105095_2611" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.alpha = 0.05;</p><p class="" id="yui_3_16_0_1_1449462105095_2610" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.parameter = <span class="">'stat'</span>;</p><p class="" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">cfg.layout = lay;<br></p><p class="" id="yui_3_16_0_1_1449462105095_2621" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px">ft_clusterplot(cfg, stat);</p><div><span style="color:rgb(0,0,0);font-family:'Helvetica Neue','Segoe UI',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px"> </span> <br clear="all"><div><br></div><div>where the variable out is essentially my time-frequency data output structure. </div><div><br></div><div>I would greatly appreciate the input and assistance. Thank you.</div><div><br></div><div>Kind Regards,</div><div><br></div><div>Ronny</div><div><br></div><div class="gmail_signature"></div>
</div></div>