<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=DE link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal><span lang=EN-US>Dear fieldtrip users!<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>May I ask for your support because of a
problem concerning my within-subject permutation test (EEG-Data)?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>The goal is to compare  two grandaverages
with two different conditions, each grandaverage consisting of 4 datasets from
4 subjects, each dataset about 40-50 single trials.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I did the preprocessing, timelock and
grandaverage: 4 datasets (called x1, … x4) for the first condition with the
following command:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>…<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>cfg = [];</span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>cfg.keeptrials = </span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#A020F0'>'yes'</span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>;</span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>timelock1 =
timelockanalysis(cfg, x1);</span><span lang=EN-US style='font-size:8.0pt;
font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>timelock2 =
timelockanalysis(cfg, x2);</span><span lang=EN-US style='font-size:8.0pt;
font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>timelock3 =
timelockanalysis(cfg, x3);</span><span lang=EN-US style='font-size:8.0pt;
font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>timelock4 =
timelockanalysis(cfg, x4);</span><span lang=EN-US style='font-size:8.0pt;
font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>cfg.channel = </span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#A020F0'>'all'</span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>cfg.latency = </span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#A020F0'>'all'</span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>cfg.keepindividual
= </span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";
color:#A020F0'>'yes'</span><span lang=EN-US style='font-size:8.0pt;font-family:
"Courier New";color:black'>  </span><span lang=EN-US style='font-size:
8.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>cfg.normalizevar
= </span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";
color:#A020F0'>'N-1'</span><span lang=EN-US style='font-size:8.0pt;font-family:
"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:#A020F0'> </span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>da_test1=
timelockgrandaverage (cfg, timelock1, timelock2, timelock3, timelock4) </span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:black'>save </span><span
lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#A020F0'>da_test1<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#A020F0'><o:p> </o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:12.0pt'>Same way for the second condition: da_test2<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:12.0pt'>Now I start the permutation test (file attached). As result
there are no significant clusters highlighted (although there are  quite
large differences in the ERP-plot). I think because there is a mistake
concerning the number of single-trials which fieldtrip takes as the basis for
the statistic test.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:12.0pt'><o:p> </o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:12.0pt'>Because the output in the command window shows:<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:12.0pt'><o:p> </o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>…<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>selected 30 channels<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>selected 2501 time bins<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>selected 1 frequency bins<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>…<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>total number of
measurements     = 8<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>total number of
variables        = 2<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>number of independent
variables  = 1<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>number of unit
variables         = 1<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>number of within-cell
variables = 0<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>number of control
variables      = 0<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>using a permutation
resampling approach<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>repeated measurement in
variable 1 over 4 levels<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>number of repeated
measurements in each level is 2 2 2 2 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>computing a parmetric threshold
for clustering<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>computing statistic<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>estimated time per
randomization is 0 seconds<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>computing statistic 1 from
100<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>…<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>found 7 positive clusters in
observed data<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>found 11 negative clusters in
observed data<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>…<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>stat = <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'><o:p> </o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>                  
prob: [30x2501 double]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>           
posclusters: [1x7 struct]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>   
posclusterslabelmat: [30x2501 double]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>       
posdistribution: [1x100 double]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>           
negclusters: [1x11 struct]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>   
negclusterslabelmat: [30x2501 double]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>       
negdistribution: [1x100 double]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>                  
mask: [30x2501 logical]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>                  
stat: [30x2501 double]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>                   
ref: [30x2501 double]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>                
dimord: 'chan_time'<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>                 
label: {30x1 cell}<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>                  
time: [1x2501 double]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>                   
cfg: [1x1 struct]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'><o:p> </o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'><o:p> </o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>cfg = <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'><o:p> </o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>    xlim: [0
0.1000]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>    zlim:
'maxmin'<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'><o:p> </o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>the input is timelock data
with 30 channels and 4000 timebins<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>applying preprocessing
options<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>averaging trials<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:red'>averaging trial 1
of 4<o:p></o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:red'>averaging trial 2
of 4<o:p></o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:red'>averaging trial 3
of 4<o:p></o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New";color:red'>averaging trial 4
of 4<o:p></o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:8.0pt;font-family:"Courier New"'>reading layout from file
easycap32ch-avg.lay<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:12.0pt;font-family:"Courier New"'><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>So, could this be the mistake that
fieldtrip guesses “4” to be the number of all trials (perhaps
because 4  datasets in each grandaverage??) And how can I solve this problem?
Is there a way to account for the single-trial number when using the
permutation test?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Thank you very much for your help!!<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Kind regards <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Thomas Sauvigny<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Tübingen University<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

</div>

</body>

</html>
<p>----------------------------------</p>
<p>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</p>
<p>  http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p>  http://www.ru.nl/fcdonders/fieldtrip/</p>