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

Robert Oostenveld r.oostenveld at donders.ru.nl
Mon Mar 9 19:52:21 CET 2015


Hi Davide

The details of the error messages reveal that you are using an old version of FieldTrip. Some of the low level functions it shows do not exist any more.

Please update to the latest version and try again. 

Robert


> On 9 mrt. 2015, at 18:28, Davide Rivolta <drivolta81 at gmail.com> wrote:
> 
> 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
> <stat_plot.tif>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




More information about the fieldtrip mailing list