[FieldTrip] one-dimensional cluster stats
Roy Cox
roycox.roycox at gmail.com
Tue Nov 3 21:21:51 CET 2015
hi all,
I'm trying to trick Fieldtrip into doing cluster stats on "one-dimensional"
EEG data. What I mean by that is that for every subject, and every
electrode, I have only one value (average density of sleep spindles). So no
time dimension, just a spatial one.
I assumed (but I'm not sure) that Fieldtrip always requires a time
dimension, so I'm essentially copying the data over to a second sample, and
set 'avgovertime' to yes.
I have a simple between-subjects design (at least for a first pass) with 16
and 20 subjects respectively.
my code:
cfg=[];
*%I get my chanlocs from eeglab*
cfg=eeglab2fieldtrip(myeeg,'chanloc');
cfg.rotate=90; %because eeglab and fieldtrip have different orientations
cfg.layout=ft_prepare_layout(cfg);
cfg.label=cfg.elec.label;
cfg_neighb.method = 'distance';
cfg.neighbours = ft_prepare_neighbours(cfg_neighb,cfg.elec);
cfg.channel = {'EEG'};
cfg.latency = 'all';
cfg.method = 'montecarlo';
cfg.statistic = 'ft_statfun_indepsamplesT';
cfg.correctm = 'cluster';
cfg.clusteralpha = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan = 2;
cfg.alpha = 0.05;
cfg.tail = 2;
cfg.numrandomization = 1000;
cfg.avgovertime = 'yes';
cfg.design: [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 2 2 2]
cfg.ivar: 1
*%data to compare*
spindledata.dimord='subj_chan_time'; %
spindledata.time=[0 1]; %pretend I have two timepoints
spindledata.label=cfg.label;
%*paste data (and use repmat to make a copy for the second timepoint)*
spindledata1=spindledata; spindledata2=spindledata;
spindledata1.avg=repmat(allData(allLabels==1,:),[1 1 2]);
spindledata2.avg=repmat(allData(allLabels==2,:),[1 1 2]);
[statT] = ft_timelockstatistics(cfg,spindledata1,spindledata2);
Matlab's output:
total number of measurements = 36
total number of variables = 1
number of independent variables = 1
number of unit variables = 0
number of within-cell variables = 0
number of control variables = 0
using a permutation resampling approach
computing a parametric threshold for clustering
Reference to non-existent field 'critval'.
Error using ft_statistics_montecarlo (line 250)
could not determine the parametric critical value for clustering
Error in ft_timelockstatistics (line 181)
[stat, cfg] = statmethod(cfg, dat, design);
Error in spindlestats (line 149)
[statT] = ft_timelockstatistics(cfg,spindledata1,spindledata2);
When I step into the ft_timelockstatistics to figure out what's happening,
I notice that the cfg.channel field holds only 32 channels (while I have
58). Similarly, right before it crashes the "dat" variable is also a 32x36
matrix while I'd expect a 58x36.
All my data are free of Nans, so that's not it.
It's a great mystery to me so any suggestions are welcome.
Roy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151103/31d49649/attachment-0001.html>
More information about the fieldtrip
mailing list