[FieldTrip] cfgs for paired t-test and monte carlo testing

Julian Wang julian.wang at ucl.ac.uk
Thu Oct 27 16:34:23 CEST 2011


Hi all,

 

I'm trying to run a paired t-test on a set of data that have been converted
from SPM format using the function fttimelock, but I'm not sure if I've got
the settings correct for it. The data consists of 16 subjects in a
within-subject design with 2 conditions, from the help manual, I assumed
that cfg.design should be:

[ones(1,16),ones(1,16)*2; 1:16, 1:16]

 

With the rest of the code being:

cfg.method = 'stats';

cfg.alpha     = 0.05;

cfg.tail      = 0;

cfg.feedback  = 'gui';

cfg.statistic = 'ttest2';

cfg.ivar = 1;

cfg.uvar = 2;

 

stats = ft_timelockstatistics(cfg,Subjects(1).timelockIllusory,
Subjects(2).timelockIllusory,...

    Subjects(3).timelockIllusory, Subjects(4).timelockIllusory,...

    Subjects(5).timelockIllusory, Subjects(6).timelockIllusory,...

    Subjects(7).timelockIllusory, Subjects(8).timelockIllusory,...

    Subjects(9).timelockIllusory, Subjects(10).timelockIllusory,...

    Subjects(11).timelockIllusory, Subjects(12).timelockIllusory,...

    Subjects(13).timelockIllusory, Subjects(14).timelockIllusory,...

    Subjects(15).timelockIllusory, Subjects(16).timelockIllusory,...

    Subjects(1).timelockControl, Subjects(2).timelockControl,...

    Subjects(3).timelockControl, Subjects(4).timelockControl,...

    Subjects(5).timelockControl, Subjects(6).timelockControl,...

    Subjects(7).timelockControl, Subjects(8).timelockControl,...

    Subjects(9).timelockControl, Subjects(10).timelockControl,...

    Subjects(11).timelockControl, Subjects(12).timelockControl,...

    Subjects(13).timelockControl, Subjects(14).timelockControl,...

    Subjects(15).timelockControl, Subjects(16).timelockControl);

 

 

But if I run it, it comes up with an error saying that it's only expecting
one row in the design matrix. If it's run with the design matrix just being
[ones(1,16),ones(1,16)*2]

Then it runs fine and the result does look correct, but I'm not sure if it
is. Is what I've done a paired t-test? Or is it running an unpaired t-test?

 

Also when running it through using the monte carlo method, I'm uncertain as
to what values cfg.ivar, cfg.uvar, cfg.wvar and cfg.cvar should be, at the
moment I'm using:

cfg.method = 'montecarlo';

cfg.design = [ones(1,16),ones(1,16)*2];

cfg.alpha     = 0.05;

cfg.tail      = 0;

cfg.feedback  = 'gui';

cfg.statistic = 'depsamplesT';

cfg.ivar = 1;

cfg.uvar = 2;

cfg.wvar = 2;

cfg.numrandomization = 'all';

 

 

but it keeps coming up with the following error:

??? Index exceeds matrix dimensions.

 

Error in ==> resampledesign at 103

  blkmeas = unique(design(cfg.wvar,:)', 'rows')';

 

Error in ==> statistics_montecarlo at 187

resample = resampledesign(cfg, design);

 

Error in ==> statistics_wrapper at 290

    [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource);

 

Error in ==> ft_timelockstatistics at 124

[stat, cfg] = statistics_wrapper(cfg, varargin{:});

 

What am I doing wrong here?

 

Any help would be greatly appreciated.

 

Kind regards,

 

Julian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20111027/85c9655e/attachment.html>


More information about the fieldtrip mailing list