[FieldTrip] Repeated measure ANCOVA

Zito Giuseppe Angelo giuseppeangelo.zito at hest.ethz.ch
Tue Mar 29 16:28:07 CEST 2022


Dear Fieldtrip experts,

I would like to ask a question on the implementation of an EEG analysis.
I would like to implement a model where 20 subjects perform a task with 9 conditions, each of them contains a certain number of trials (10 or 5).
My datafile contains the power spectrum from 10(repetitions)x118(electrodes)x32(frequencyBins).

I am interested in the main effects of condition, but I would like to regress out the performance on each single trial.
I implemented a model, where I use the average across trials, and I attach here the code. Basically the code uses:

  *   cfg.method      = 'montecarlo'
  *   cfg.statistic   = 'depsamplesFmultivariate'
  *   cfg.correctm    = 'cluster'

I now have two questions:

  1.  Is it correct that the variable to regress out (the performance in my case) is identified as the cfg.cvar?
  2.  Could you please advice on how to implement the overall model, where each single repetition is included?

Here is my code so far:

cfg = [];
cfg.neighbours = myClusters;
cfg.channel     = 'all';
cfg.parameter   = 'powspctrm';
cfg.method      = 'montecarlo';
cfg.statistic   = 'depsamplesFmultivariate';
cfg.alpha       = 0.05;
cfg.tail        = 1;
cfg.correctm    = 'cluster';
cfg.correcttail = 'alpha';
cfg.numrandomization = 10000;%'all';

nSub = length(freq);
% Specify design matrix
cfg.design(1,1:9*nSub) = [1:nSub 1:nSub 1:nSub 1:nSub 1:nSub 1:nSub 1:nSub 1:nSub 1:nSub];
cfg.design(2,1:9*nSub) = [ones(1,nSub) 2*ones(1,nSub) 3*ones(1,nSub) 4*ones(1,nSub) 5*ones(1,nSub) ...
    6*ones(1,nSub) 7*ones(1,nSub) 8*ones(1,nSub) 9*ones(1,nSub)];
cfg.design(3,1:9*nSub) = [meanJoA(:,9)' meanJoA(:,8)' meanJoA(:,7)' meanJoA(:,6)' meanJoA(:,5)' ...
    meanJoA(:,4)' meanJoA(:,3)' meanJoA(:,2)' meanJoA(:,1)'];
cfg.uvar = 1;
cfg.ivar = 2; % the independent variable
cfg.cvar = 3;
cond1 = freq(:,1)'; % this is my 100% of control
cond2 = freq(:,2)';
cond3 = freq(:,3)';
cond4 = freq(:,4)';
cond5 = freq(:,5)';
cond6 = freq(:,6)';
cond7 = freq(:,7)';
cond8 = freq(:,8)';
cond9 = freq(:,9)';
stat = ft_freqstatistics(cfg, cond9{:},cond8{:},cond7{:},cond6{:},cond5{:},cond4{:},cond3{:},cond2{:},cond1{:});

Thank you very much,
Giuseppe

________________________________
Dr. Giuseppe Angelo Zito
Principal Investigator, Swiss National Science Foundation

Decision Neuroscience Lab
Department of Health Sciences and Technology (D-HEST)
ETH – Swiss Federal Institute of Technology Zurich

Winterthurerstrasse 190
8057 Zürich
Switzerland

Tel: +41 44 633 05 17
mailto: giuseppeangelo.zito at hest.ethz.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220329/596169e2/attachment.htm>


More information about the fieldtrip mailing list