<div>Dear Roemer and Anna,</div>
<div> </div>
<div>Thank you for your help. After setting the path the error disappears.</div>
<div> </div>
<div>However I know have an error saying that is "could not determine the parametric critical value for clustering".</div>
<div> </div>
<div>However, in the configuration, I put all the values that are in the tutorial.</div>
<div> </div>
<div>May it be a problem with my design?</div>
<div> </div>
<div> </div>
<div>Thanks a lot,</div>
<div> </div>
<div>Davide<br><br></div>
<div class="gmail_quote">On Tue, Sep 13, 2011 at 11:00 AM, Roemer van der Meij <span dir="ltr"><<a href="mailto:r.vandermeij@donders.ru.nl">r.vandermeij@donders.ru.nl</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div text="#000000" bgcolor="#FFFFFF">Hi Davide,<br><br>It sounds like you are missing the <a href="http://www.mathworks.nl/products/statistics/index.html" target="_blank">Statistics Toolbo</a>x for matlab. I remember some internal discussions in the team about writing an internal version of randperm.m with similar functions, but we haven't done so far if I recall correctly. Installing the toolbox, or checking whether you have it on your path should solve your problem. <br>
<br>Hope it helps,<br>Roemer
<div>
<div></div>
<div class="h5"><br><br><br><br>On 13-09-11 9:38, Davide Rivolta wrote: </div></div>
<blockquote type="cite">
<div>
<div></div>
<div class="h5">
<div>Dear fieldtrippers,</div>
<div> </div>
<div>I wish to calculate the stat difference between stimulus and baseline in a group of subjects. I use ft_freqgrandaverage to average across subjects and then ft_freqstatistics (cluster statistic) to compare the 2 conditions (baseline & stimuli).</div>
<div> </div>
<div>I get this error: ??? Undefined function or method 'randperm' for input arguments of type 'double'.</div>
<div> </div>
<div>I tried even with the newest version (20110911) but the problem persists. I am not sure what I have to do.</div>
<div> </div>
<div>Any advice would be super. The script is below.</div>
<div> </div>
<div>Thanks a lot,</div>
<div> </div>
<div>Davide</div>
<div> </div>
<div> </div>
<div> </div>
<div>datainpath = '/data/home1/drivolta/Out4VG/DATA/';<br>dataoutpath = '/data/home1/drivolta/Out4VG/DATA/';</div>
<div><br>% Controls<br>Controls = { <br> 'ASS31_TFR_high.mat';<br> 'CSA07_TFR_high.mat';<br> 'BMR08_TFR_high.mat'; <br> 'NPD18_TFR_high.mat';<br> %'BSA08_TFR_high.mat'; <br>
%'ABE08_TFR_high.mat';<br> %'EES05_TFR_high.mat';<br> %'GPS10_TFR_high.mat'; <br> %'SDA01_TFR_high.mat';<br> %'CSA17_TFR_high.mat';<br> %'KBZ16_TFR_high.mat';<br>
<br>};</div>
<div> </div>
<div>%--------------------------------------------------------------------------</div>
<div>NControls = length(Controls);</div>
<div> </div>
<div>%% CONCATENATE DATA</div>
<div>for i = 1:length(Controls)<br> fullname = strcat(datainpath, Controls{i,1});<br> load(fullname); <br> <br> % Activation time window<br> TFR2 = power_continue_high; %Rename to change (select time window)<br>
idx = find((TFR2.time >= 0.5) &(TFR2.time <= 1.5));<br> TFR2.powspctrm = power_continue_high.powspctrm(:, :,idx);<br> TFR2.time = power_continue_high.time(idx);<br> Stimuli{i} = TFR2;<br> <br> % Baseline time window<br>
TFR3 = power_continue_high;<br> idx = find((TFR3.time >= -1) &(TFR3.time < 0));<br> TFR3.powspctrm = power_continue_high.powspctrm(:,:, idx);<br> TFR3.time = TFR2.time;<br> Baseline{i} = TFR3;<br>
<br> clear power_continue_high<br> clear TFR2<br> clear TFR3<br>end;<br></div>
<div>save Controls2Statistics Stimuli Baseline;</div>
<div> </div>
<div> </div>
<div><br>cfg = [];<br>cfg.channel = {'MEG', '-MRO31', '-MRO21'}; <br>cfg.keepindividual = 'yes';</div>
<div> </div>
<div>BaselineAll = ft_freqgrandaverage(cfg, Baseline{:});<br>StimuliAll = ft_freqgrandaverage(cfg, Stimuli{:});</div>
<div> </div>
<div> </div>
<div> </div>
<div>load /data/home1/drivolta/Out4VG/DATA/GRAD % File with a structure containing grad field</div>
<div> </div>
<div>cfg = [];<br>cfg.method = 'triangulation';<br>cfg.neighbourdist = 5;<br>cfg.grad = TFR.grad;<br>cfg.layout = 'CTF275.lay';<br>neighbour = ft_neighbourselection(cfg, Baseline{1});<br>
</div>
<div>cfg = [];<br>cfg.grad = TFR.grad; <br>cfg.channel = {'MEG', '-MRO31', '-MRO21'}; <br>cfg.neighbourdist = 4; </div>
<div>cfg.minnbchan = 1; </div>
<div>cfg.clusteralpha = 0.05; % control admission to a cluster<br>cfg.alpha = 0.05; % control the false alarm rate of the permutation test<br>cfg.latency = [0.5 1.5]; % time interval over which the experimental conditions are compared (in sec)<br>
cfg.frequency = [50 70];<br>cfg.avgovertime = 'no';<br>cfg.avgoverfreq = 'no';<br>cfg.avgoverchan = 'no';<br>cfg.clusterstatistics = 'maxsum';<br>cfg.statistic = 'actvsblT';<br>
cfg.numrandomization = 1000; </div>
<div>cfg.correctm = 'cluster';<br>cfg.method = 'montecarlo';<br>cfg.approach = 'montecarlo';<br>cfg.dimord = 'chan_freq_time';<br>cfg.dim = 'chan_freq_time';<br>
cfg.neighbours = neighbour;<br>cfg.tail = 0;<br>cfg.clustertail = 0;</div>
<div> </div>
<div>nSubjects = 2*length(Controls);</div>
<div> </div>
<div>a = [1:nSubjects];<br>b = ones(1,length(Controls));<br>c = 2*(ones(1,length(Controls)));</div>
<div> </div>
<div>cfg.design = [a; b c];<br>cfg.uvar = 1; % "subject" is unit of observation<br>cfg.ivar = 2; % row of the design matrix that contains the independent variable</div>
<div> </div>
<div>stat = ft_freqstatistics(cfg, BaselineAll, StimuliAll);</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div><br>
<fieldset></fieldset> <br></div></div><pre>_______________________________________________
fieldtrip mailing list
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></pre></blockquote><br>
<div>-- <br><font size="2"><font color="darkblue"><font face="calibri">Roemer van der Meij M.Sc.<br>PhD student<br>Donders Institute for Brain, Cognition and Behaviour<br>Centre for Cognition<br>P.O. Box 9104<br>6500 HE Nijmegen<br>
The Netherlands<br>Tel: <a href="tel:%2B31%280%2924%203655932" target="_blank" value="+31243655932">+31(0)24 3655932</a><br>E-mail: <a href="mailto:r.vandermeij@donders.ru.nl" target="_blank">r.vandermeij@donders.ru.nl</a><br>
</font></font></font></div></div><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>
</blockquote></div><br><br clear="all"><br>-- <br>Davide Rivolta, PhD<br><br>