<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Loes,<div><br></div><div>The statistical test you are trying to do, is a dependent samples T test. This can only be applied if you have a repeated measures design with 2 conditions. You have 6 conditions, and this causes the error I presume.</div><div>I guess what you need is probably a depsamplesF or so.</div><div><br></div><div>Best wishes,</div><div><br></div><div>Jan-Mathijs</div><div><br><div><div>On Mar 30, 2011, at 8:21 AM, Loes Koelewijn wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Hi all,</span></span></div> <div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></span></div> I have a question about group analysis statistics of my</span><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "> MEG study. I've made virtual sensors from group average images of an independent localiser run, created at several time windows, based on the group inversion. I then extracted dipole waveforms for all other conditions (6), for each subject (10), based on those virtual sensors (the study has a repeated measures design). I would now like to analyse group significance of any differences between these 6 time courses, over all time samples, corrected for multiple comparisons. I have tried to do this using FieldTrip's cluster based permutation test (Monte Carlo), independently for each virtual channel, by setting the neighbouring channels to 0. However, I get an error about the design matrix when running ft_timelockstatistics.</span></span><div> <font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Matlab's output is the following:</span></font></div> <div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; ">selected 1 channels</span></div> <div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><div>selected 251 time bins</div><div>selected 1 frequency bins</div><div>Using the gradiometer configuration from the dataset.</div> <div>there are on average 0.0 neighbours per channel</div><div>using "statistics_montecarlo" for the statistical testing</div><div>using "statfun_depsamplesT" for the single-sample statistics</div><div> constructing randomized design</div><div>total number of measurements = 60</div><div>total number of variables = 2</div><div>number of independent variables = 1</div><div>number of unit variables = 1</div> <div>number of within-cell variables = 0</div><div>number of control variables = 0</div><div>using a permutation resampling approach</div><div>repeated measurement in variable 2 over 6 levels</div><div>number of repeated measurements in each level is 10 10 10 10 10 10 </div> <div>computing a parmetric threshold for clustering</div><div>Error using ==> statfun_depsamplesT at 78</div><div>Invalid specification of the design array.</div><div>??? Error using ==> statistics_montecarlo at 217</div> <div>could not determine the parametric critical value for clustering</div><div><br></div><div>Error in ==> statistics_wrapper at 285</div><div> [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource);</div> <div><br></div><div>Error in ==> ft_timelockstatistics at 117</div><div>[stat, cfg] = statistics_wrapper(cfg, varargin{:});</div></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; "><br> </span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Could anybody help me in the direction of what is going wrong here? I wondered earlier if my data structures were incorrect, but these were created with ft_timelockgrandaverage, keeping the individual data. This is what I ran:</span></font></div> <div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">[stat]=ft_timelockstatistics(cfg,cond1,cond2,cond3,cond4,cond5,cond6);</span></font></div> <div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><div><span class="Apple-style-span" style="border-collapse: collapse;">cfg = </span></div> <div><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"> channel: 'Occipital_Inf_RR_X'</span></div> <div><span class="Apple-style-span" style="border-collapse: collapse;"> latency: [-0.2000 0.8000]</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"> method: 'montecarlo'</span></div> <div><span class="Apple-style-span" style="border-collapse: collapse;"> statistic: 'depsamplesT'</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"> correctm: 'cluster'</span></div> <div><span class="Apple-style-span" style="border-collapse: collapse;"> clusteralpha: 0.0500</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"> clusterstatistic: 'maxsum'</span></div> <div><span class="Apple-style-span" style="border-collapse: collapse;"> tail: 0</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"> clustertail: 0</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"> alpha: 0.0250</span></div> <div><span class="Apple-style-span" style="border-collapse: collapse;"> numrandomization: 500</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"> design: [2x60 double]</span></div> <div><span class="Apple-style-span" style="border-collapse: collapse;"> uvar: 2</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"> ivar: 1</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br> </span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">cfg.design is 2*60, with the first row (ivar) [1:10,1:10,1:10 etc], </span><span class="Apple-style-span" style="border-collapse: collapse; ">second row (uvar) [ones(1,10),ones(1,10)*2, etc].</span></div> <div><span class="Apple-style-span" style="border-collapse: collapse; ">I initially had ivar and uvar reversed, but I got the same error.</span></div></font><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br> </span></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">And this is the format of each data structure:</span></span></div> <div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></span></div> <div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><div> label: {'Occipital_Inf_RR_X'}</div> <div> fsample: 250</div><div> avg: [1x826 double]</div><div> var: [1x826 double]</div><div> time: [1x826 double]</div><div> individual: [10x1x826 double]</div><div> dimord: 'subj_chan_time'</div> <div> cfg: [1x1 struct]</div><div> grad: [1x1 struct]</div></span></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br> </span></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Apologies for the massive email, but I was hoping this is enough info for someone to have more of a clue than I do?</span></span></div> <div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></span></div> <div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Kind regards,</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br> </span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Loes</span></font></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br> </span></span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">PS <span class="Apple-style-span" style="font-family: arial; border-collapse: separate; "><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Do let me know if you think this approach is wrong in the first place. I was trying to avoid pre-setting time windows for image-based statistics, as we do not really have strong a priori expectations for times.</span></span></span></span></font></div> <div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br clear="all"></span></font>-- <br><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse">Loes Koelewijn<br> PhD Candidate<br>Macquarie Centre for Cognitive Science (MACCS)<br>Macquarie University<br>Sydney NSW 2109<br>Australia<br><br>Ph: +61 2 9850 4135<br>Fax: +61 2 9850 6059<br>email: <a href="mailto:loes.koelewijn@mq.edu.au" style="color:rgb(148, 46, 6)" target="_blank">loes.koelewijn@mq.edu.au</a></span><br> </div></div> _______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Dr. J.M. (Jan-Mathijs) Schoffelen </div><div>Donders Institute for Brain, Cognition and Behaviour, <br>Centre for Cognitive Neuroimaging,<br>Radboud University Nijmegen, The Netherlands</div><div><a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a></div><div>Telephone: 0031-24-3614793</div></div></span></div></span> </div><br></div></body></html>