<div dir="ltr"><div><div><div><div>Thank you for your quick answers!<br><br></div>This is very clear now. i'm familiar with GLM as I use it in fMRI but I did not thought my question in term of contrast.<br><br></div>So, to test for a linear ordering between cond3,cond2 and cond1, would it be reasonable to compute a regression beta for each subject and then compare it to zero with a group t-test? (as it would use the data of condition 2).<br><br></div>thanks again and best regards<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-20 13:16 GMT+02:00 Snijders, T.M. (Tineke) <span dir="ltr"><<a href="mailto:tineke.snijders@donders.ru.nl" target="_blank">tineke.snijders@donders.ru.nl</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Helvetica;color:#000000;font-size:10pt">
<div style="direction:ltr;font-family:Helvetica;color:#000000;font-size:10pt">
<div><span style="font-size:10pt">Hi Baptiste,</span></div>
<div>
<div><br>
</div>
<div>Indeed, as Jan points out, t-test and regression are all GLM.</div>
<div>You wonder what happened to the condition (cond 2) that you didn't use in the t-test:</div>
<div>In a regression with 3 conditions, the GLM 'contrasts' would be [-1 0 1] and [1 0 -1], so the 2nd condition is coded as ''0", meaning that without the 2nd condition the regression would also give exactly the same results...</div>
<div><br>
</div>
<div>Best,</div>
<div>Tineke</div>
<div><br>
</div>
<div>________________________________________</div>
<div>From: <a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a> [<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a>] on behalf of <a href="mailto:jan@brogger.no" target="_blank">jan@brogger.no</a> [<a href="mailto:jan@brogger.no" target="_blank">jan@brogger.no</a>]</div>
<div>Sent: Wednesday, July 20, 2016 12:25 PM</div>
<div>To: <a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a></div>
<div>Subject: Re: [FieldTrip] Regression test and t-test providing almost    identical results</div><span class="">
<div><br>
</div>
<div>That is because a t- test and a regression test are the same. See this link: <a href="http://stats.stackexchange.com/questions/59047/how-are-regression-the-t-test-and-the-anova-all-versions-of-the-general-linear" target="_blank">http://stats.stackexchange.com/questions/59047/how-are-regression-the-t-test-and-the-anova-all-versions-of-the-general-linear</a></div>
<div><br>
</div>
<div>Yours,</div>
<div><br>
</div>
<div>Jan Brogger</div>
<div><br>
</div>
<div>_______________________________________________</div>
<div>fieldtrip mailing list</div>
</span></div>
<div><br>
</div>
<div><br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> <a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a> [<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a>] on behalf of Baptiste Gauthier [<a href="mailto:gauthierb.ens@gmail.com" target="_blank">gauthierb.ens@gmail.com</a>]<br>
<b>Sent:</b> Wednesday, July 20, 2016 11:49 AM<br>
<b>To:</b> <a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a><br>
<b>Subject:</b> [FieldTrip] Regression test and t-test providing almost identical results<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>
<div dir="ltr">
<p class="MsoNormal"><span lang="EN-US">Dear Fieldtrippers,</span></p>
<p class="MsoNormal"><span lang="EN-US">I recently observed a strange behavior with the results provided with the regression statistics provided by “</span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">ft_statfun_depsamplesregrT”:</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">I did a regression test on 3 conditions: cond1, cond2 and cond3:</span></p>
<p class="MsoNormal"><span lang="EN-US">Here are the results:</span></p>
<p class="MsoNormal"><span lang="EN-US"><br>
</span></p>
<p class="MsoNormal"><span lang="EN-US"><img src="cid:ii_15607b35d29e022e" alt="Images intégrées 1" height="291" width="428"><br>
</span></p>
<p class="MsoNormal" style="text-align:center" align="center"><span lang="EN-US"></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><b><span lang="EN-US">Output for group-level regression test:</span></b></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">the call to "ft_timelockgrandaverage" took 36 seconds and required the additional allocation of an estimated 0 MB</span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><br>
<span>reading layout from file /neurospin/meg/meg_tmp/MTT_MEG_Baptiste/From_laptop/fieldtrip-20130901/template/layout/NM306mag.lay</span><br>
<span>the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB</span><br>
<span>the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 0 MB</span><br>
<span>using "ft_statistics_montecarlo" for the statistical testing</span><br>
<span>using "ft_statfun_depsamplesregrT" for the single-sample statistics</span><br>
<span>constructing randomized design</span><br>
<span>total number of measurements     = 57</span><br>
<span>total number of variables        = 2</span><br>
<span>number of independent variables  = 1</span><br>
<span>number of unit variables         = 1</span><br>
<span>number of within-cell variables  = 0</span><br>
<span>number of control variables      = 0</span><br>
<span>using a permutation resampling approach</span><br>
<span>repeated measurement in variable 1 over 19 levels</span><br>
<span>number of repeated measurements in each level is 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3<span> </span></span><br>
<span>computing a parametric threshold for clustering</span><br>
<span>computing statistic</span><br>
<span>estimated time per randomization is 0.26 seconds</span><br>
<span>computing statistic 1000 from 1000</span><br>
<br>
<span>Warning: adding /neurospin/meg/meg_tmp/MTT_MEG_Baptiste/fieldtrip-20160719/external/spm8 toolbox to your MATLAB path<span> </span></span><br>
<span>found 13 positive clusters in observed data</span><br>
<span>found 9 negative clusters in observed data</span><br>
<span>computing clusters in randomization</span><br>
<span>computing clusters in randomization 1000 from 1000</span><br>
<br>
<span>using a cluster-based method for multiple comparison correction</span><br>
<span>the returned probabilities and the thresholded mask are corrected for multiple comparisons</span><br>
<span>the call to "ft_timelockstatistics" took 55 seconds and required the additional allocation of an estimated 12 MB</span></span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">Afterwards, for some other reasons I performed directly a T-test between condition 1 and condition 3. Here is the result:</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><br>
</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><img src="cid:ii_15607b394ad9a5b0" alt="Images intégrées 2" height="302" width="428"><br>
</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><br>
</span></p>
<p class="MsoNormal" style="text-align:center" align="center"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif"></span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"></span></p>
<p class="MsoNormal"><b><span lang="EN-US">Output for group-level T-test:</span></b></p>
<p class="MsoNormal"><span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">the call to "ft_timelockgrandaverage" took 36 seconds and required the additional allocation of an estimated 0 MB</span></span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(80,0,80)" lang="EN-US"><br>
<span>reading layout from file /neurospin/meg/meg_tmp/MTT_MEG_Baptiste/From_laptop/fieldtrip-20130901/template/layout/NM306mag.lay</span><br>
<span>the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB</span><br>
<span>the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 0 MB</span><br>
<span>using "ft_statistics_montecarlo" for the statistical testing</span><br>
</span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"></span>using "ft_statfun_depsamplesT" for the single-sample statistics<span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><br>
<span>constructing randomized design</span><br>
<span>total number of measurements     = 38</span></span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(80,0,80)" lang="EN-US"><br>
<span>total number of variables        = 2</span><br>
<span>number of independent variables  = 1</span><br>
<span>number of unit variables         = 1</span><br>
<span>number of within-cell variables  = 0</span><br>
<span>number of control variables      = 0</span><br>
<span>using a permutation resampling approach</span><br>
<span>repeated measurement in variable 1 over 19 levels</span><br>
<span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(34,34,34)" lang="EN-US"></span>number of repeated measurements in each level is 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2<span> </span></span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><br>
</span><span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">computing a parametric threshold for clustering</span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><br>
<span>computing statistic</span><br>
</span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(34,34,34)" lang="EN-US"></span>estimated time per randomization is 0.04 seconds</span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(80,0,80)" lang="EN-US"><br>
<span>computing statistic 1000 from 1000</span><br>
<br>
<span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(34,34,34)" lang="EN-US"></span>found 9 positive clusters in observed data</span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><br>
<span>found 13 negative clusters in observed data</span></span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(80,0,80)" lang="EN-US"><br>
<span>computing clusters in randomization</span><br>
<span>computing clusters in randomization 1000 from 1000</span><br>
<br>
<span>using a cluster-based method for multiple comparison correction</span><br>
<span>the returned probabilities and the thresholded mask are corrected for multiple comparisons</span><br>
<span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(34,34,34)" lang="EN-US"></span>the call to "ft_timelockstatistics" took 46 seconds and required the additional allocation of an estimated 0 MB</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(80,0,80)" lang="EN-US"><br>
</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif;color:rgb(80,0,80)" lang="EN-US"><br>
</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">I checked that I actually provided the good data and parameters to the function, but I am puzzled by the resemblance (if you invert the sign) of
 the results. To doublecheck, I directly compared the stat.stat field from the two tests. Here are the results:</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><br>
</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><img src="cid:ii_15607b3d4a7598ae" alt="Images intégrées 3" height="338" width="428"><br>
</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"><br>
</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif"></span><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"></span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">So basically, it is the same if you round to the 3<sup>rd</sup> digits after the floating point. It sounds really weird to me.
</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">Has someone ever noticed something similar when performing regression tests? I there any simple mathematical tricks that could explain that?</span></p>
<p class="MsoNormal"><br>
</p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">Best regards,</span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;line-height:115%;font-family:Arial,sans-serif" lang="EN-US">Baptiste Gauthier, PhD</span></p>
<div><br>
</div>
-- <br>
<div>Baptiste Gauthier<br>
Postdoctoral Research Fellow<br>
<br>
INSERM-CEA Cognitive Neuroimaging unit<br>
CEA/SAC/DSV/DRM/Neurospin center<br>
Bât 145, Point Courier 156 <br>
F-91191 Gif-sur-Yvette Cedex FRANCE
<div style="display:inline"></div>
</div>
</div>
</div>
</div></div></div>
</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="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Baptiste Gauthier<br>Postdoctoral Research Fellow<br><br>
INSERM-CEA Cognitive Neuroimaging unit<br>
CEA/SAC/DSV/DRM/Neurospin center<br>
Bât 145, Point Courier 156 <br>
F-91191 Gif-sur-Yvette Cedex FRANCE
<div style="display:inline"></div></div>
</div>