<div dir="ltr"><div><div><div>Hi Anne,<br><br></div>It looks like you're running stats on grand-average structures created with cfg.keepindividual='no' (because your Correct and Incorrect structures have an .avg field). I always do stats on a grand-average structure created with cfg.keepindividual='yes' (which will yield a structure with no .avg field, and instead an .individual field, which in your case will be 24x34x600, since you have participants). Do things work out better if you try it that way?<br><br></div>Best,<br></div>Steve<br><div><div><div><div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><div><br><br>---<br></div>Stephen Politzer-Ahles<br>University of Oxford<br>Language and Brain Lab<br>Faculty of Linguistics, Phonetics & Philology<br><a href="http://users.ox.ac.uk/~cpgl0080/" target="_blank">http://users.ox.ac.uk/~cpgl0080/</a></span></div></div></div></div></div></div></div>
<div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Message: 1<br>
Date: Thu, 10 Dec 2015 18:14:10 +0100<br>
From: Anne Mickan <<a href="mailto:amickan1990@gmail.com">amickan1990@gmail.com</a>><br>
To: <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
Subject: [FieldTrip] Stats matrix incomplete - cluster-based<br>
permutation test<br>
Message-ID:<br>
<<a href="mailto:CANX43OJN4h_1jEuDKMNwQC4sHeW%2BE2_StnS3WLkEbOkVpMerQA@mail.gmail.com">CANX43OJN4h_1jEuDKMNwQC4sHeW+E2_StnS3WLkEbOkVpMerQA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Dear all,<br>
<br>
I'm just starting to work on a cluster-based permutation test script based<br>
on the tutorial for within-subject designs on the fieldtrip website. I ran<br>
into an issue when computing the [stat] matrix. I used the code as it was<br>
on the website:<br>
<br>
[stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:});<br>
<br>
with the Correct and Incorrect matrices looking as follows:<br>
<br>
Correct{1}<br>
<br>
avg: [34x600 double]<br>
time: [1x600 double]<br>
fsample: '500'<br>
label: {34x1 cell}<br>
dimord: 'chan_time'<br>
dof: [34x600 double]<br>
var: [34x600 double]<br>
<br>
The function runs without problems, i.e I don't get any error messages.<br>
However, the result seems incomplete.<br>
<br>
stat =<br>
prob: [25x1 double]<br>
posclusters: []<br>
posclusterslabelmat: [25x1 double]<br>
posdistribution: [1x500 double]<br>
negclusters: [1x1 struct]<br>
negclusterslabelmat: [25x1 double]<br>
negdistribution: [1x500 double]<br>
cirange: [25x1 double]<br>
mask: [25x1 logical]<br>
stat: [25x1 double]<br>
ref: [25x1 double]<br>
dimord: 'chan_time'<br>
label: {25x1 cell}<br>
time: 0<br>
cfg: [1x1 struct]<br>
<br>
Specifically, I later run into trouble with the stat.posclusterslabelmat<br>
and stat.negclusterslabelmat matrices which should apparantly contain far<br>
more values something more like 25x500 instead of 25x1. When calling<br>
neg_int = all(neg(:, m(k):m(k+1)), 2)<br>
I get the "Index exceeds matrix dimensions" error message which I assume<br>
has to do with the fact that "neg" does not have the appropriate matrix<br>
dimensions<br>
(neg = ismember(stat.negclusterslabelmat, neg_signif_clust); )<br>
<br>
Where is the error / where should I look for the error?<br>
<br>
Some further design details:<br>
Nsubj = 24<br>
2 conditions = Correct, Incorrect<br>
Within-subject design<br>
sampling rate = 500<br>
34 channels<br>
<br>
I hope I gave enough / the necessary information for someone to help me<br>
out.<br>
<br>
Thanks in advance!<br>
<br>
Best,<br>
Anne<br>
<br><br></blockquote></div><br></div></div></div></div></div></div>