<div dir="ltr"><div><div>Hi Chris,<br><br></div>Quick reply:<br><br><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)"><span>-<span style="font:7pt "Times New Roman"">          </span></span></span><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">The
 new ft_statfun_intersubcorr can calculate Spearman correlation 
statistics between subjects (but not between trials), and doesn’t 
currently have a parametric (e.g., Pearson’s) option, although this 
appears to be covered by the ft_statfun_</span><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)" lang="EN-US">indepsamplesregrT function anyway. <br><br></span></div><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)" lang="EN-US">> I implemented a cfg.type, allowing the specification of the correlation statistics option (e.g. Pearson), but haven't yet tested it.<br><br></span><div><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)" lang="EN-US">By the way, in the </span><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">ft_statfun_intersubcorr
 description/instructions, some of the text appears to refer to 
ft_statfun_depsamplesT instead. Can I assume that ivar is in fact the 
behavioural variable of interest rather than “conditions that must be 
compared” as currently stated? Also, what is the reason this function 
cannot be used across trials within a subject?<br><br></span></div><div><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">> ft_statfun_intersubcorr was implemented last week on request. the documentation was taken from ft_statfun_depsamplesT and needs to be updated (thanks for reminding). The function computes a correlation across observations (subjects/trials) where one input is neural data, and the other behavior (enforce a match of dimension and size), and then transforms it to a t-value. Theoretically therefore the function could also be used to calculate a correlation statistics across trials in a subject.<br><br><br></span></div><div><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">>> Btw, I didn't see Eric's reply before. But if you get it  to work with </span><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">ft_statfun_</span><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)" lang="EN-US">indepsamplesregr, I'd go for that.<br><br></span></div><div><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)" lang="EN-US">best regards,<br>arjen<br> </span></div><div><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)"><br><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-09 12:27 GMT+01:00 Dr Christopher Brown <span dir="ltr"><<a href="mailto:cb802@cam.ac.uk" target="_blank">cb802@cam.ac.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="white" link="blue" vlink="purple" lang="EN-GB"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Dear Eric, Tom, Arjen<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thanks for the information and it’s good to know the functionality I need is already there. Just to clarify, I understand the situation as thus (please correct any errors of understanding):<u></u><u></u></span></p><p><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">          </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The ft_statfun_</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US">indepsamplesregrT function can be used to calculate parametric linear regression statistics with ivar as the independent variable of interest, e.g. a behavioural variable across trials or subjects, and uvar as units (e.g. trials or subjects).</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u><u></u></span></p><p><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">          </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The new ft_statfun_intersubcorr can calculate Spearman correlation statistics between subjects (but not between trials), and doesn’t currently have a parametric (e.g., Pearson’s) option, although this appears to be covered by the ft_statfun_</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US">indepsamplesregrT function anyway. By the way, in the </span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">ft_statfun_intersubcorr description/instructions, some of the text appears to refer to ft_statfun_depsamplesT instead. Can I assume that ivar is in fact the behavioural variable of interest rather than “conditions that must be compared” as currently stated? Also, what is the reason this function cannot be used across trials within a subject?<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Best wishes<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Chris<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><div><p class="MsoNormal" style="background:white"><b><span style="font-size:9.0pt;font-family:"Verdana",sans-serif">Dr Christopher Brown</span></b><span style="font-size:9.0pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p><p class="MsoNormal" style="background:white"><i><span style="font-size:9.0pt;font-family:"Verdana",sans-serif">Research Associate | CamPain Research Group | Department of Anaesthesia | University of Cambridge</span></i><span style="font-size:9.0pt;font-family:"Verdana",sans-serif"> <br><span class=""><br>Box 93 <br>Addenbrooke's Hospital <br>Hills Road <br>Cambridge CB2 0QQ <br><br>01223 256 995<u></u><u></u></span></span></p></div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US"> <a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a> [mailto:<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a>] <b>On Behalf Of </b>Tom Marshall<br><b>Sent:</b> 08 December 2014 15:10<br><b>To:</b> FieldTrip discussion list<br><b>Subject:</b> Re: [FieldTrip] Cluster analysis on correlation statistics<u></u><u></u></span></p></div></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">Hm... it seems that I may have reinvented the wheel (or perhaps invented a cruder wheel before Eric and co provided this more streamlined one).<br><br>Eric, can indepsamplesregrT also compute nonparametric correlation coefficients (eg Spearman)?<br><br>Best,<br>Tom<u></u><u></u></p><div><p class="MsoNormal">On 12/8/2014 3:56 PM, Maris, E.G.G. (Eric) wrote:<u></u><u></u></p></div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hi Chris,</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p></div><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"><div><div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif" lang="EN-US">Just to clarify my last email: I'm referring to correlation between either single trial data within subject, or averaged ERPs across subjects, with a behavioral variable. </span><span style="font-family:"Calibri",sans-serif">Not linear regression across conditions as is already implemented in the ft_statfun_depsamplesregrT function.</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u><u></u></span></p></div></div><div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US">For correlating/regressing single trial data of a single subject, you use the ft_statfun_indepsamplesregrT (with the units-of-observations being the trials, which each correspond to one column of your design matrix). </span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US">For correlating/regressing subject-averaged data of a group of subjects, you also use the ft_statfun_indepsamplesregrT (with the units-of-observations being the subjects, which each correspond to one column of your design matrix).  Note, in this case your behavioral data (accuracy or RT) or also subject averages.</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US">Best,</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US">Eric Maris</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p></div></div></div></div><div><div class="MsoNormal" style="text-align:center" align="center"><hr size="2" width="100%" align="center"></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Van:</span></b><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> Dr C A Brown [</span><a href="mailto:cb802@cam.ac.uk" target="_blank"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">cb802@cam.ac.uk</span></a><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">]<br><b>Verzonden:</b> zaterdag 6 december 2014 12:33<br><b>Aan:</b> </span><a href="mailto:fieldtrip@science.ru.nl" target="_blank"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">fieldtrip@science.ru.nl</span></a><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><br><b>Onderwerp:</b> Re: [FieldTrip] Cluster analysis on correlation statistics</span><u></u><u></u></p></div><div><div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Hello again,<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Just to clarify my last email: I'm referring to correlation between either single trial data within subject, or averaged ERPs across subjects, with a behavioral variable. Not linear regression across conditions as is already implemented in the ft_statfun_depsamplesregrT function.<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Many thanks<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Chris <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Dr Christopher Brown<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Research Associate<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Sent from a mobile device, please excuse my brevity.<u></u><u></u></span></p></div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><div><p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">----- Reply message -----<br>From: "Christopher Brown" </span><a href="mailto:cb802@cam.ac.uk" target="_blank"><span style="font-family:"Calibri",sans-serif"><cb802@cam.ac.uk></span></a><span style="font-family:"Calibri",sans-serif"><br>To: </span><a href="mailto:fieldtrip@science.ru.nl" target="_blank"><span style="font-family:"Calibri",sans-serif"><fieldtrip@science.ru.nl></span></a><span style="font-family:"Calibri",sans-serif"><br>Subject: Cluster analysis on correlation statistics<br>Date: Sat, Dec 6, 2014 07:49<u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></p><p>Dear all<u></u><u></u></p><p>I would like to use the cluster analysis functions in Fieldtrip on correlation statistics. I note there has been some discussion about this on this list in the past but I haven't come across the necessary ft_statfun_corr function to allow this analysis. It would be great if somebody has this code and could share it with me; otherwise, I will embark on writing it myself and sharing my results with everyone for feedback. Being new to Fieldtrip I would greatly appreciate any collaborative help with this. May I check my understanding on something before getting started: To allow for multiple comparisons correction using monte carlo for example, as part of a cluster analysis, I presume the output of the function must be t values rather than correlation coefficients? Any other hints as to how to write this are most welcome.<u></u><u></u></p><p>Kind regards<u></u><u></u></p><p>Chris<u></u><u></u></p><div><p class="MsoNormal">-- <u></u><u></u></p><pre><strong><span style="font-family:"Courier New"">Dr Christopher Brown</span></strong> <u></u><u></u></pre><pre><em><span style="font-family:"Courier New"">Research Associate | CamPain Group | Division of Anaesthesia | School of Clinical Medicine | University of Cambridge</span></em> <u></u><u></u></pre><pre><u></u> <u></u></pre><pre>Box 93 <u></u><u></u></pre><pre>Addenbrooke's Hospital <u></u><u></u></pre><pre>Hills Road <u></u><u></u></pre><pre>Cambridge CB2 0QQ <u></u><u></u></pre><pre><u></u> <u></u></pre><pre>01223 256 995<u></u><u></u></pre></div></div></div></div><p class="MsoNormal"><br><br><br><u></u><u></u></p><pre>_______________________________________________<u></u><u></u></pre><pre>fieldtrip mailing list<u></u><u></u></pre><pre><a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><u></u><u></u></pre><pre><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><u></u><u></u></pre></blockquote><p class="MsoNormal"><u></u> <u></u></p></div></div></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></div>