<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p></p>
<p style="">Dear FieldTrip Community,</p>
<p style=""><br style="">
</p>
<p style="">My name is Nova and I am new to FieldTrip. I am currently working on the parametric statistics of the ERP data (obtained from 32 electrodes) but I face some problems. I have tried googling and reading the tutorials and posts on mailing lists, but
I still can't solve the problems. Could you please assist me in finding the solutions?</p>
<p style=""><br style="">
</p>
<p style="">Here are the problems:</p>
<p style="">I would like to perform the parametric statistics on the ERP data, I have 2 sets of data called <i style="">dataresponse</i> and <i style="">databaseline</i> (each has 270 trials, with dimensions 270x32x584 double). I calculated the ERPs of each
dataset by averaging the signals over the number of trials. I would like to compare both data of one subject on the channel level. On the tutorial website, it was on the group level. I tried to adjust my codes for the <i style="">cfg.design</i>, but I still
can't find the solutions.</p>
<p style=""><br style="">
</p>
<p style="">In order to calculate the statistics on channel electrode 10, I used the ttest2 function on MATLAB with this script:<br style="">
<span style=""><i style="">[h,p] = ttest2(avgdataresponse.avg(10,<wbr style="">:), avgdatabaseline.avg(10,:),'<wbr style="">alpha',0.05);</i></span></p>
<p style=""><span style=""><i style=""><span style="">%avgdataresponse and avgdatabaseline are the average over trials,</span><br style="">
</i></span></p>
<p style=""><span style=""><br style="">
</span></p>
<p style=""><span style="">then I obtained the h=1, p= <span style="">1.323e-04.</span></span></p>
<p style=""><span style=""><br style="">
</span></p>
<p style="">However, when I tried with Fieldtrip function, I obtained different numbers.</p>
<p style=""></p>
<div style="">1) When using the "<span style="">ft_statfun_indepsamplesT" function with this script, I obtained <b style="">NaN</b> for <b style="">stat, critval,</b> and <b style="">prob</b>. Does it have to do with the <i style="">cfg.design</i>? What is
the correct <i style="">cfg.design</i> for the parametric T-test on a channel level for a single subject?</span></div>
<div style="">cfg = [];</div>
<div style="">cfg.channel = 'Audio10';</div>
<div style="">cfg.latency = [0.017 0.6];</div>
<div style="">cfg.avgovertime = 'yes';</div>
<div style="">cfg.parameter = 'avg';</div>
<div style="">cfg.method = 'analytic';</div>
<div style="">cfg.statistic = 'ft_statfun_indepsamplesT';</div>
<div style="">cfg.alpha = 0.05;</div>
<div style="">cfg.correctm = 'no';</div>
<div style=""><br style="">
</div>
<div style="">n_dataresponse = size(dataresponse.trial, 1); <span style="">%number of trials in data response (since the number of trials is the same as that of databaseline, I use one of them)</span></div>
<div style=""><br style="">
</div>
<div style="">cfg.design(1,1:2*n_<wbr style="">dataresponse) = [ones(1,n_databaseline), ones(1,n_dataresponse)*2];</div>
<div style="">cfg.design(2,1:2*n_<wbr style="">dataresponse) = [1:n_dataresponse 1:n_dataresponse];</div>
<div style="">cfg.ivar = 1;</div>
<div style=""><br style="">
</div>
<span style="">stat = ft_timelockstatistics(cfg, avgdataresponse, avgdatabaseline); </span><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px"></span>
<p style=""></p>
<p style=""><span style=""> </span></p>
<p style=""><span style=""><br style="">
</span></p>
<p style=""><span style="">2. When I change the parameter: <span style="">cfg.parameter = 'trial' and <span style="">stat = ft_timelockstatistics(cfg, dataresponse, databaseline);<br style="">
I obtained the p-value =</span></span> <span style="">0.040. Is this p-value correct? or is it still wrong because of my cfg.design?</span></span></p>
<p style=""><span style=""><br style="">
</span></p>
<p style=""><span style=""><span style="">3. I tried also with <span style="">"</span><span style="">ft_statfun_<wbr style="">depsamplesT" with the same configuration as no.1 and added the cfg.uvar =2, I obtained errors:<br style="">
</span></span></span></p>
<div style=""><i style="">Error using ft_statfun_depsamplesT (line 78)</i></div>
<div style=""><i style="">Invalid specification of the design array.</i></div>
<div style=""><i style=""><br style="">
</i></div>
<div style=""><i style="">Error in ft_statistics_analytic (line 94)</i></div>
<div style=""><i style=""> [stat, cfg] = statfun(cfg, dat, design);</i></div>
<div style=""><i style=""><br style="">
</i></div>
<div style=""><i style="">Error in ft_timelockstatistics (line 185)</i></div>
<div style=""><i style=""> [stat, cfg] = statmethod(cfg, dat, design);</i></div>
<p style=""></p>
<p style=""><span style=""><br style="">
</span></p>
<p style=""><span style="">Is there a significant design array for a particular parametric T-test? What is the specification of the design array for independent and dependent T-test? (I tried searching about it but I couldn't find the answers.)</span></p>
<p style=""><br style="">
</p>
<p style="">4. When I still use "<span style="">ft_statfun_depsamplesT" but changing cfg.parameter = 'trial' and <span style="">stat = ft_timelockstatistics(cfg, dataresponse, databaseline); I acquired the p value = 0.0989.</span></span></p>
<p style=""><span style=""><br style="">
</span></p>
<p style=""><span style="">Why is the p-value still different than the one obtained from the ttest2 function? What should I change in order to obtain a similar value as what is acquired on the ttest2 Matlab function? Based on the tutorial, the p-value should
be the same.</span></p>
<p style=""><span style=""><br style="">
</span></p>
<p style=""><span style="">I would really appreciate any help and advice on these problems.</span></p>
<p style=""><span style="">Thank you very much and have a great day.</span></p>
<p style=""><span style=""><br style="">
</span></p>
<p style=""><span style="">Best regards,</span></p>
<p style=""><span style="">Nova Resfita</span></p>
<br>
<p></p>
<p><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-family:Cambria,Georgia,serif; font-size:10pt">Nova Resfita, M.Sc.</span></p>
<span style="font-family:Cambria,Georgia,serif; font-size:10pt"></span>
<p><span style="font-family:Cambria,Georgia,serif; font-size:10pt">PhD student</span></p>
<span style="font-family:Cambria,Georgia,serif; font-size:10pt"></span>
<p><span style="font-family:Cambria,Georgia,serif; font-size:10pt">Medizinische Hochschule Hannover</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"><br style="">
</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt">Institut für AudioNeuroTechnologie (VIANNA)</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"><br style="">
</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt">OE 8891, M20, Ebene 01, Raum 2220</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"><br style="">
</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt">Stadtfelddamm 34</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"><br style="">
</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt">30625 Hannover</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"><br style="">
</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"> </span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"><br style="">
</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt">Tel.: +49 511 532-7270</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"><br style="">
</span><span style=""><span style="font-family:Cambria,Georgia,serif; font-size:10pt">Email:</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"> </span><span style=""><a href="mailto:Sollmann.Lea@mh-hannover.de" target="_blank" id="LPNoLP" style=""><span style=""><span style="font-family:Cambria,Georgia,serif; font-size:10pt">Resfita.Nova@mh-</span><wbr style=""><span style="font-family:Cambria,Georgia,serif; font-size:10pt">hannover.de</span></span></a></span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"> </span></span><span style="font-family:Cambria,Georgia,serif; font-size:10pt"><br style="">
</span><span style="font-family:Cambria,Georgia,serif; font-size:10pt">Web: </span><a href="https://urldefense.com/v3/__http://www.neuroprostheses.com/__;!!HJOPV4FYYWzcc1jazlU!6NmIRxmwMH2BGQeJpQjL_UdFTljNLDILpnfphX9NMxnYsEwmHbU4FgErbLsshcSwuH4GBACoOhorFap0BMLtlrKc0IF8auc4Tw$" title="http://www.neuroprostheses.com/ Strg+Klicken oder tippen Sie, um dem Link zu folgen." target="_blank" id="LPNoLP" style="font-size:12pt"><span style=""></span></a><a href="https://urldefense.com/v3/__https://www.neuroprostheses.com/AK/Main.html__;!!HJOPV4FYYWzcc1jazlU!6NmIRxmwMH2BGQeJpQjL_UdFTljNLDILpnfphX9NMxnYsEwmHbU4FgErbLsshcSwuH4GBACoOhorFap0BMLtlrKc0IHCWoKhaQ$" class="OWAAutoLink" id="LPNoLP"><span style="font-family:Cambria,Georgia,serif; font-size:10pt">www.neuroprostheses.com</span></a><span style=""></span></p>
<span style="font-family:Cambria,Georgia,serif; font-size:10pt"></span>
<p class="MsoNormal" style=""><u style=""></u><span style="font-family:Cambria,Georgia,serif; font-size:10pt"> </span></p>
<span style="font-family:Cambria,Georgia,serif; font-size:10pt"></span><br>
<p></p>
</div>
</div>
</div>
</body>
</html>