<div dir="ltr">Hi Xiaoming,<div><br></div><div>Sounds like you're using an older version of the function. Did you try updating fieldtrip?</div><div><br></div><div>Yours,</div><div>Arjen</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-12 7:42 GMT-08:00 Stephen Whitmarsh <span dir="ltr"><<a href="mailto:stephen.whitmarsh@ki.se" target="_blank">stephen.whitmarsh@ki.se</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<u></u><u></u>

<div lang="EN-GB" link="blue" vlink="purple" style="margin-left:3.0pt;margin-top:3.0pt;margin-right:3.0pt;margin-bottom:.75pt">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Dear Xiaoming,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">It is working for me, using it in sourcestatistics. Have you checked your design is really only one row? I can’t think of anything
 else…<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">S<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><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>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <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>Xiaoming Du<br>
<b>Sent:</b> 12 November 2015 16:25<br>
<b>To:</b> FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>><br>
<b>Subject:</b> Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Dear Arjen,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Thanks for the updates.
<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">I was trying to run the following code on Fieldtrip website (<a href="http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables" target="_blank">http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables</a>)<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">% compute statistics with correlationT<br>
cfg = [];<br>
cfg.statistic        = 'ft_statfun_correlationT';<br>
cfg.method           = 'montecarlo';<br>
cfg.numrandomization = 1000;<br>
<br>
n1 = 3;    % n1 is the number of subjects<br>
design(1,1:n1)       = [0.6 0.9 0.1]; %here we insert our independent variable (behavioral data) in the cfg.design matrix, in this case reaction times of 3 subjects.<br>
<br>
cfg.design           = design;<br>
cfg.ivar             = 1; <br>
<br>
stat = ft_freqstatistics(cfg, data_brain{:});<u></u><u></u></span></p>
</div>
<div>
<div>
<pre> <u></u><u></u></pre>
<pre> <u></u><u></u></pre>
<pre>However, it gives me this error: <u></u><u></u></pre>
</div>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:red">Error using ft_statfun_correlationT (line 81)<br>
uvar must be specified for dependent samples statistics</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:red">Error in ft_statistics_montecarlo (line 276)<br>
  [statobs, cfg] = statfun(cfg, dat, design);</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:red">Error in ft_freqstatistics (line 190)<br>
    [stat, cfg] = statmethod(cfg, dat, design);</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Could you provide a sample data_brain, so I can organize my data into same format? Thanks!<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">-Xiaoming<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><br>
<br>
</span><span lang="SV" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">>>> Arjen Stolk <</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><a href="mailto:a.stolk8@gmail.com" target="_blank"><span lang="SV">a.stolk8@gmail.com</span></a></span><span lang="SV" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">>
 11/7/2015 11:21 PM >>><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Dear participants in the discussion on behavioural-power correlation, and interested folks,
<u></u><u></u></span></p>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Following recent discussion on this mailing list (thanks to Xiaoming Du and Martin Krebber), we have updated ft_statfun_correlationT,
 a function that can be used for correlating neural and behavioral variables. <u></u>
<u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Following the update, the correlation values calculated on genuine data have not changed. However, the permutation procedure for calculating
 the randomization distribution has. Namely, prior to the update the permutation procedure would randomly permute across both the independent (e.g., behavior) and dependent variables (e.g., neural data). This procedure is prone to systematic bias across the
 data belonging to these variables. And conceptually, as outlined in a new wiki page (see below), the independent and dependent variables should be statistically independent, meaning that any association between these variables should be broken by randomly
 permuting the values of the independent variable.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><a href="http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables" target="_blank">http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables</a>?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Those that have been using ft_statfun_correlationT for calculating a randomization distribution using the permutation procedure are
 advised to update to the latest fieldtrip version and re-calculate those distributions. We are sorry for any inconvenience this may cause.
<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">On a related note, the functionality of ft_statfun_correlationT (under Pearson) is highly similar to that of ft_statfun_indepsamplesregrT.
 To make the latter function, and others in the statfun suite, more accessible, we would like to forward those interested to the above wiki page where an overview is provided of the different approaches to correlating neural and behavioral variables, with some
 example fieldtrip code.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Yours, Arjen<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">on behalf of Eric Maris and Egbert Hartstra<u></u><u></u></span></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">2015-10-22 2:53 GMT-07:00 Maris, E.G.G. (Eric) <<a href="mailto:e.maris@donders.ru.nl" target="_blank">e.maris@donders.ru.nl</a>>:<u></u><u></u></span></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Dear participants in the discussion on behavioural-power correlation,<br>
<br>
My name is Eric Maris and have contributed most of the older statfuns (but not ft_statfun_correlationT). Together with Arjen, I will try to resolve some of the issues that have been discussed. Give us some time, and we will return to you via the Discussion
 List.<br>
<br>
best,<br>
Eric<u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">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><u></u><u></u></span></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>