[FieldTrip] ft_freqstatistics on grandaveraged TFR data

Murphy, Kelly (Research Student) murphyk5 at aston.ac.uk
Mon Jan 9 22:44:18 CET 2017

Hello Fieldtrippers,

I am trying to use a monte carlo permutation test using ft_freqstatistics on grandaveraged data over 8 participants for two independent conditions but I am struggling to create the correct design matrix using the following code:

cfg = [];   cfg.method = 'montecarlo';    cfg.computestat = 'yes';  cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 500;   cfg.correctm = 'fdr';  cfg.computecritval = 'yes'; cfg.alpha = 0.025; cfg.tail = 0; cfg.clustertail = 0;   cfg.clusterstatistic = 'maxsum';    cfg.minnbchan = 2;
design = zeros(1,size(T_LLL.powspctrm,1) + size(T_LLH.powspctrm,1));
design(1,1:size(T_LLL.powspctrm,1)) = 1;
design(1,(size(T_LLL.powspctrm,1)+1):(size(T_LLL.powspctrm,1)+size(T_LLH.powspctrm,1))) = 2;
cfg.design           = design;
cfg.ivar             = 1;
[stat] = ft_freqstatistics(cfg, T_LLL, T_LLH);

I am left with the following error message:
"Error using ft_freqstatistics (line 174)
the length of the design matrix (1) does not match the number of observations
in the data (2)"

I am struggling to see what errors I am making and I have tried my best to adhere to the guidelines outlined on the Fieldtrip tutorials, so if anyone with a keen eye can offer any help it would be most appreciated!

Many thanks


PhD candidate
Department of Psychology
Aston University
Birmingham B4 7ET
United Kingdom

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170109/9abc41e2/attachment-0001.html>

More information about the fieldtrip mailing list