[FieldTrip] ft_timelockstatistics design matrix

Julian Keil julian.keil at gmail.com
Fri Jun 24 10:10:13 CEST 2022


Dear Jaewon,

are "HH_timelock, HN_timelock, LH_timelock, LN_timelock“ your data structures containing the single participants?
Have you tried adding {:} after the structures (e.g., HH_timelock{:}, HN_timelock{:}, LH_timelock{:}, LN_timelock{:})?
Are the same numbers of participants in all structures?

Good luck,

Julian


> Am 24.06.2022 um 09:33 schrieb 오재원 via fieldtrip <fieldtrip at science.ru.nl>:
> 
> 
> Hello,
> 
> I was trying cluster-based permutation using ft_timlockstatistics, but I got an error regarding design matrix.
> The code I used is as following:
> 
> %% Permutation test
> [ftver, ftpath] = ft_version;
> cd(fullfile(ftpath, 'template', 'electrode'));
> elec = ft_read_sens('standard_1020.elc');
> % there are some of which the orientation cannot be determined (T3, T4, T5, T6)
> ft_plot_sens(elec, 'label', 'yes', 'elecshape', 'disc', 'elecsize', 10, 'facecolor', [0.8 0.8 1.0])
> % give it a stronger 3D appearance
> camlight headlight
> cfg = [];
> cfg.elec = elec;
> cfg.channel = {'Fp1', 'Fpz', 'Fp2', 'F7', 'F3', 'Fz', 'F4', 'F8', 'T7', 'C3', 'Cz', 'C4', 'T8', 'P7', 'P3', 'Pz', 'P4', 'P8', 'O1', 'Oz', 'O2'};
> cfg.method = 'distance';
> cfg.feedback = 'yes';
> cfg.neighbourdist = 100;
> neighbours = ft_prepare_neighbours(cfg);
> design = [1:nSubjs 1:nSubjs 1:nSubjs 1:nSubjs; ones(1,nSubjs) ones(1,nSubjs)*2 ones(1,nSubjs)*3 ones(1,nSubjs)*4];
> cfg         = [];
> cfg.channel = {'EEG'};
> cfg.latency = [0 0.6];
> cfg.method           = 'ft_statistics_montecarlo';
> cfg.clusterthreshold = 'nonparametric_common';
> cfg.neighbours = neighbours;
> cfg.statistic        = 'ft_statfun_depsamplesFmultivariate';
> cfg.correctm         = 'cluster';
> cfg.clusteralpha     = 0.05;
> cfg.clusterstatistic = 'maxsum';
> cfg.minnbchan        = 2;
> cfg.tail             = 0;
> cfg.clustertail      = 0;
> cfg.alpha            = 0.025;
> cfg.numrandomization = 500;
> cfg.design = design;
> cfg.uvar   = 1;
> cfg.ivar   = 2;
> 
> %% permutation test statistical analysis
> [stat] = ft_timelockstatistics(cfg, HH_timelock, HN_timelock, LH_timelock, LN_timelock);
> 
> And the error message :
> 
>  ft_timelockstatistics (172번 라인)
> the length of the design matrix (2) does not match the number of observations in the data (4)
> 
> I could not find any problem in my code and I followed the way the fieldtrip tutorial instructed. I have four conditions and I put four repetitions of 1:nSubjs in the unit variable (cfg.uvar) and nSubjs number of ones, twos, threes, and fours each in the independent variable (cfg.ivar). It would be so grateful if you can tell me how to solve this problem. Best, Jaewon
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220624/c72f7abc/attachment.htm>


More information about the fieldtrip mailing list