[FieldTrip] design matrix for cluster-based permutation testing
Carolina Ogawa
carolyogawa at gmail.com
Tue Aug 4 17:44:15 CEST 2020
Dear community,
I'm having trouble defining the design matrix ("cfg.design") to perform a
cluster-based permutation testing.
There are 17 subjects (1 group only) and 5 conditions in my dataset.
My data is organized in the "DS_GA_induc_gamma" data structure, and the 5
conditions to be compared are organized within the data structure as
"DS_GA_induc_gamma.cond_A", "DS_GA_induc_gamma.cond_B",
"DS_GA_induc_gamma.cond_C", "DS_GA_induc_gamma.cond_D",
"DS_GA_induc_gamma.cond_E"
My code is as follows:
cfg = [];
cfg.statistic = 'ft_statfun_depsamplesFunivariate';
cfg.method = 'montecarlo';
cfg.correctm = 'cluster';
cfg.clusteralpha = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan = 0;
cfg.tail = 0;
cfg.clustertail = 0;
cfg.alpha = 0.025;
cfg.numrandomization = 1000;
cfg_neighb.method = 'triangulation';
cfg_neighb.layout = 'acticap-64ch-standard2.mat';
cfg.neighbours = ft_prepare_neighbours(cfg_neighb,
DS_GA_induc_gamma.cond_A);
cfg.design = *See below*
cfg.uvar = 1;
cfg.ivar = 2;
induc_gamma_diff = ft_freqstatistics(cfg, DS_GA_induc_gamma.cond_A,
DS_GA_induc_gamma.cond_B,...
DS_GA_induc_gamma.cond_C, DS_GA_induc_gamma.cond_D,
DS_GA_induc_gamma.cond_E);
So far, I've tried the following "cfg.design" definitions and have got the
following errors:
*1st try:*
cfg.design = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1;...
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2;...
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3;...
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4;...
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5];
Output:
constructing randomized design
total number of measurements = 5
total number of variables = 17
number of independent variables = 1
number of unit variables = 1
number of within-cell variables = 0
number of control variables = 0
using a permutation resampling approach
repeated measurement in variable 1 over 5 levels
number of repeated measurements in each level is 1 1 1 1 1
computing a parametric threshold for clustering
Error using ft_statfun_depsamplesFunivariate (line 94)
Invalid specification of the design array.
Error using ft_statistics_montecarlo (line 244)
could not determine the parametric critical value for clustering
Error in ft_freqstatistics (line 191)
[stat, cfg] = statmethod(cfg, dat, design);
*2nd try:*cfg.design =
Columns 1 through 22
1 2 3 4 5 6 7 8 9 10 11 12
13 14 15 16 17 1 2 3 4 5
1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 2 2 2 2 2
Columns 23 through 44
6 7 8 9 10 11 12 13 14 15 16 17
1 2 3 4 5 6 7 8 9 10
2 2 2 2 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3 3
Columns 45 through 66
11 12 13 14 15 16 17 1 2 3 4 5
6 7 8 9 10 11 12 13 14 15
3 3 3 3 3 3 3 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4
Columns 67 through 85
16 17 1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17
4 4 5 5 5 5 5 5 5 5 5 5
5 5 5 5 5 5 5
Output:
Error using ft_freqstatistics (line 178)
the length of the design matrix (2) does not match the number of
observations in the data (5)
Can anyone help me with this, please?
Also, is there any problem comparing substructures of a data structure
using "ft_freqstatistics" the way I'm doing?
Thank you,
Carolina Ogawa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200804/62ff102f/attachment.htm>
More information about the fieldtrip
mailing list