<DIV>Dear <FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Jan-Mathijs,</SPAN></FONT></DIV>  <DIV><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </DIV>  <DIV><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Thank you for the detailed help in your previous message. </SPAN></FONT></DIV>  <DIV><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">>For the time being, I assume that you have your data imported into a
 fieldtrip-like >format, using besa2fieldtrip. I am not familiar with this function, but when I read the >help of besa2fieldtrip I guess that your besa file was a .tfc file. So probably your >data-object looks like what fieldtrip considers to be a frequency-structure, containing >a TFR for each ROI. I guess you have two data-objects for each subject. </SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">One clarification: yes, i do have two data-object (or .tfc files) for each subject, one for each condition, but there are two types of .tfc files that I could use: either the raw time-frequency data for each condition, or the statistically analysed time-frequency data for that condition. BESA saves both of these as .tfc
 files. At the moment I am using the raw TFR data. </SPAN></FONT></DIV></SPAN></FONT></DIV>  <DIV><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </DIV>  <DIV><FONT face=Arial color=#000080 size=2>I tried to run the script as you suggested but it did not work. The error message I get is to do with </FONT></DIV>  <DIV><FONT face=Arial color=#000080 size=2>[stat] = statistics_wrapper(cfg, varargin{:}). It just gives me an error message pointing to this line,saying: error using fieldtrip-20061003/private/statistics_wrapper, could not determine the type of input data. </FONT></DIV>  <DIV><FONT face=Arial color=#000080 size=2></FONT> </DIV>  <DIV><FONT face=Arial color=#000080 size=2>Also, the function 'cfg.numrandomization' requires a number, but I am not sure what the choice of the number depends on? I've inputed 500 as in the documentation example.</FONT></DIV>
 <DIV><FONT color=#000080></FONT> </DIV>  <DIV><FONT face=Arial color=#000080 size=2>Finally, at risk making my ignorance of how Fieldtrip works entirely transparent, I am not quite sure how the function you send me 'statfun_diff.m' links with the 'freqstatistics.m,' and whether I do need to use it?</FONT></DIV>  <DIV><FONT face=Arial color=#000080 size=2></FONT> </DIV>  <DIV><FONT face=Arial color=#000080 size=2>I would greatly appreciate any help with this,</FONT></DIV>  <DIV> </DIV>  <DIV><FONT face=Arial color=#000080 size=2>Many thanks,</FONT></DIV>  <DIV><FONT face=Arial color=#000080 size=2>Lorina</FONT></DIV>  <DIV><FONT face=Arial color=#000080 size=2></FONT> </DIV><FONT face=Arial color=#000080 size=2>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT></DIV></FONT><FONT face=Arial color=#000080 size=2>  <DIV class=MsoNormal><FONT face=Arial color=navy
 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT></DIV></FONT>  <DIV><FONT face=Arial color=#000080 size=2></FONT> </DIV>  <DIV><FONT face=Arial color=#000080 size=2></FONT><BR><BR><B><I>Jan Mathijs Schoffelen <Jan.Schoffelen@FCDONDERS.RU.NL></I></B> wrote:</DIV>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">  <META content="Microsoft Word 11 (filtered medium)" name=Generator>  <STYLE>  v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  w\:* {behavior:url(#default#VML);}  .shape {behavior:url(#default#VML);}  </STYLE>  <o:SmartTagType name="PersonName" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType>  <STYLE>  st1\:*{behavior:url(#default#ieooui) }  </STYLE>    <STYLE>  <!--   /* Font Definitions */   @font-face   {font-family:Tahoma;   panose-1:2 11 6 4 3 5 4 4 2 4;}   /* Style Definitions */   p.MsoNormal, li.MsoNormal,
 div.MsoNormal   {margin:0in;   margin-bottom:.0001pt;   font-size:12.0pt;   font-family:"Times New Roman";}  h1   {margin-top:12.0pt;   margin-right:0in;   margin-bottom:3.0pt;   margin-left:0in;   page-break-after:avoid;   font-size:12.0pt;   font-family:"Times New Roman";   font-weight:bold;}  h2   {margin-top:12.0pt;   margin-right:0in;   margin-bottom:3.0pt;   margin-left:0in;   page-break-after:avoid;   font-size:12.0pt;   font-family:"Times New Roman";   font-weight:bold;   font-style:italic;}  p.MsoBodyText, li.MsoBodyText, div.MsoBodyText   {margin-top:0in;   margin-right:0in;   margin-bottom:6.0pt;   margin-left:0in;   font-size:12.0pt;   font-family:"Times New Roman";}  a:link, span.MsoHyperlink   {color:blue;   text-decoration:underline;}  a:visited, span.MsoHyperlinkFollowed   {color:purple;   text-decoration:underline;}  p   {mso-margin-top-alt:auto;   margin-right:0in;   mso-margin-bottom-alt:auto;   margin-left:0in;   font-size:12.0pt;   font-family:"Times
 New Roman";}  p.JMsstyle01, li.JMsstyle01, div.JMsstyle01   {margin:0in;   margin-bottom:.0001pt;   line-height:200%;   font-size:12.0pt;   font-family:"Times New Roman";   font-weight:bold;}  p.JMsstyle02, li.JMsstyle02, div.JMsstyle02   {margin:0in;   margin-bottom:.0001pt;   line-height:200%;   font-size:12.0pt;   font-family:"Times New Roman";   font-style:italic;}  span.EmailStyle21   {mso-style-type:personal-reply;   font-family:Arial;   color:navy;}  @page Section1   {size:8.5in 11.0in;   margin:1.0in 1.25in 1.0in 1.25in;}  div.Section1   {page:Section1;}  -->  </STYLE>    <DIV class=Section1>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Dear Lorina,<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy
 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">For the time being, I assume that you have your data imported into a fieldtrip-like format, using besa2fieldtrip. I am not familiar with this function, but when I read the help of besa2fieldtrip I guess that your besa file was a .tfc file. So probably your data-object looks like what fieldtrip considers to be a frequency-structure, containing a TFR for each ROI. I guess you have two data-objects for each subject. <o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">What you would like to do is possible within fieldtrip, but I would advise you not to use clusterrandanalysis to get there. Quite some correspondence has been devoted to the new statistical interface, you can read about it on the discussion list’s website (follow the appropriate links on the fieldtrip website), concerning <A
 href="https://listserv.surfnet.nl/scripts/wa.exe?A2=ind0610&L=fieldtrip&P=4074">Re: clusterrandanalysis on scalar values + problem with topoplotER</A> during the past month, but which started in August.<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">In a nutshell: instead of using clusterrandanalysis you could use freqstatistics (under the above assumption that your data resembles a fieldtrip-frequency structure) with the appropriate settings to get your statistics done. Freqstatistics relies on statistics_montecarlo, when you specify cfg.method = ‘montecarlo’.<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Please have a try following the thread on the discussion list, and the following configuration settings, as well as the information in statistics_montecarlo
 and other dependent functions. You’ll probably need the attached function as well, which computes your statistic of interest.<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg = [];<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.method = ‘montecarlo’;<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.statistic = ‘diff’;<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.parameter = ‘cohspctrm’; %This is
 at least what I expect your data objects to contain!<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.numrandomization = a number;<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.design = [1 1 2 2 3 3 with all the numbers in between 14 14; …<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">                     1 2 1 2 1 2 with all the numbers in between 1 2]; %this specifies how the data has to be interpreted<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.ivar
 = 2; %row-index of independent variable, which is the condition in your case<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.uvar = 1; %row-index of the ‘unit’-variable, your unit of observation, which are your individual subjects.<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">   %the design-matrix will be shuffled, by swapping the 1 and 2’s in the ivar-row, while keeping the uvar-doublets together.<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.correctm = ‘yes’; %keep it at this for the time being, we have to develop a cunning strategy to incorporate something about the neighbourhood structure of your ROIs<o:p></o:p></SPAN></FONT></DIV>  <DIV
 class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">  %as soon as you get your script running, you can try to incorporate fancy multiple-comparison correction strategies, such as clustering in time and frequency.<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Stat = freqstatistics(cfg, subj1cond1, subj1cond2, subj2cond1, subj2cond2 ….); %take care that this corresponds with how you specified your design.<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy
 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Subjxconx should then be the data-structure containing your TFRs in a field called cohspctrm.<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I hope this puts you on track,<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Yours,<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY:
 Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Jan-Mathijs<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV>  <DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">  <HR tabIndex=-1 align=center width="100%" SIZE=2>  </SPAN></FONT></DIV>  <DIV class=MsoNormal><B><FONT face=Tahoma size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName w:st="on">FieldTrip discussion list</st1:PersonName> [mailto:FIELDTRIP@NIC.SURFNET.NL] <B><SPAN
 style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Lorina Naci<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, October 23, 2006 7:18 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> FIELDTRIP@NIC.SURFNET.NL<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [FIELDTRIP] Within-subject coherence statististics for virtual sources</SPAN></FONT><o:p></o:p></DIV></DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">Dear FIELDTRIP members,</SPAN></FONT><o:p></o:p></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier
 New'"><o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">I have used BESA to perform source coherence <o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">calculations for a multiple-subject/multiple-condition experiment. I have 14 subjects, and 2 conditions for which I’d like to compare coherence values. I have calculated coherence values in the Time-Frequency domain for each person.</SPAN></FONT><o:p></o:p></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV
 class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">Given that BESA cannot calculate statistics in a multiple-subject study, their support personnel directed me towards FieldTrip.</SPAN></FONT><o:p></o:p></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> <o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">I would like to use your existing script ‘</SPAN></FONT><FONT face="Courier New" color=black size=2><SPAN lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">clusterrandanalysis on TFRs of power that were computed with BESA,’ but I cannot relate this to my data as <U>the coherence values have been calculated for ROI
 sources, (8 per hemisphere - 16 sources total), and not for electrodes (I had 128).<o:p></o:p></U></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">Do you have any advice regarding how I may adopt the script to for source coherence as opposed to electrode coherence? How do I import the source locations?<o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN lang=EN style="FONT-SIZE: 10pt; COLOR:
 black; FONT-FAMILY: 'Courier New'">Many thanks is advance for your help,<o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">Lorina</SPAN></FONT><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> Send instant messages to your online friends http://uk.messenger.yahoo.com <o:p></o:p></SPAN></FONT></DIV></DIV></BLOCKQUOTE><BR><p>
                <hr size=1>
The <a href="http://us.rd.yahoo.com/mail/uk/taglines/default/nowyoucan/free_from_isp/*http://us.rd.yahoo.com/evt=40565/*http://uk.docs.yahoo.com/nowyoucan.html">all-new Yahoo! Mail</a> goes wherever you go - free your email address from your Internet provider.