[FieldTrip] Quick question about STAT (error and weird output)

Davide Rivolta drivolta81 at gmail.com
Mon Mar 9 18:28:29 CET 2015


Dear all,

I am trying to look at ERPs stats with my EGI cap (I have 16 subjects - within subjects design).
According to the code I use, I get in the order, an ERROR or I see something weird and I wish to have an opinion.
See the script below:

Here is my script:
% ERPs grandaverage calculation for 4 conditions
cfg = [];
cfg.keepindividual = 'yes';
ERPs_FP_grandavg = ft_timelockgrandaverage(cfg, FP_block{:});
ERPs_FS_grandavg = ft_timelockgrandaverage(cfg, FS_block{:});
ERPs_HP_grandavg = ft_timelockgrandaverage(cfg, HP_block{:});
ERPs_HS_grandavg = ft_timelockgrandaverage(cfg, HS_block{:});

% t-tests
cfg            = [];
cfg.method     = 'triangulation';
cfg.layout   = 'GSN-HydroCel-128.sfp';
cfg.neighbourdist  = 2;
cfg.senstype   = 'EEG';
neighbours_EEG = ft_prepare_neighbours(cfg, ERPs_FP_grandavg);

cfg = [];
cfg.channel     = 'EEG';
cfg.minnbchan   = 2;
cfg.neighbours  = neighbours_EEG;
cfg.latency     = [1.17 1.25];
cfg.avgovertime = 'no';
cfg.parameter   = 'avg';
cfg.method      = 'montecarlo';
cfg.statistic   = 'ft_statfun_depsamplesT';
cfg.alpha       = 0.05;
cfg.clusteralpha = 0.05;
cfg.correctm    = 'cluster';
cfg.correcttail = 'prob';
cfg.numrandomization = 1000;
cfg.tail = 0;
cfg.clustertail = 0;

Nsub = length(names);
cfg.design(1,1:2*Nsub)  = [ones(1,Nsub) 2*ones(1,Nsub)];
cfg.design(2,1:2*Nsub)  = [1:Nsub 1:Nsub];
cfg.ivar                = 1; % the 1st row in cfg.design contains the independent variable
cfg.uvar                = 2; % the 2nd row in cfg.design contains the subject number

IF I USE THIS CODE:
stat = ft_timelockstatistics(cfg,ERPs_FP_grandavg,ERPs_FS_grandavg);

I GET TE ERROR:
Reference to non-existent field 'dat'.

Error in prepare_timefreq_data>forcedimord (line 531)
  Nrepl = size(output.dat, repldim);

Error in prepare_timefreq_data (line 87)
  [remember{c}, hascrsspctrm] = forcedimord(varargin{c});

Error in statistics_wrapper (line 235)
  [cfg, data] = prepare_timefreq_data(cfg, varargin{:});

Error in ft_timelockstatistics (line 113)
[stat, cfg] = statistics_wrapper(cfg, varargin{:});


- Note that this worked in very earlier versions of FT



IF I USE THIS CODE
stat = ft_timelockstatistics(cfg,FP_block{:},FS_block{:});

IT RUNS, BUT I GET SOMETHING WEIRD WITH T-VALUES BELOW 1 and 4 clusters (see attched figure).


What I am doing wrong? Any advice would be great.


Many thanks,
Davide



--
Davide Rivolta, PhD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150309/2834a4b0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stat_plot.tif
Type: image/tiff
Size: 199807 bytes
Desc: stat_plot.tif
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150309/2834a4b0/attachment-0001.tif>


More information about the fieldtrip mailing list