Back to the main page.

Bug 625 - cfg.statistic='ttest' not exist in prepare_design.m

Status ASSIGNED
Reported 2011-04-30 22:45:00 +0200
Modified 2012-03-07 15:13:12 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P1 normal
Assigned to: Roemer van der Meij
URL:
Tags:
Depends on:
Blocks:
See also:

Johanna - 2011-04-30 22:45:10 +0200

When calling ft_freqstatistics using: cfg=[]; cfg.method='stats'; cfg.statistic='ttest'; cfg.alpha=0.001; [stat] = ft_freqstatistics(cfg, grandavg); % grandavg is output from ft_freqgrandaverage with keeptrials='yes' it crashes: ??? Error using ==> statistics_stats at 68 design matrix should only contain one factor (i.e. one row) (instead it contains 3 rows) Is it required to also include cfg.design in the call to ft_freqstatistics with the other cfg options listed? If yes, this is not clear from help functions of statistics_stats.m or statistics_wrapper.m If no, then it is not correctly created by prepare_design.m since cfg.method='stats' asks for 'ttest' rather than 'indepsamplesT'. (note: if I add 'ttest' to the list on line 67 of prepare_design.m, then it does create a 1-row design matrix). Is it possible that, rather than change prepare_design, instead statistics_stats should ask for 'indepsamplesT' rather than 'ttest'?


Robert Oostenveld - 2011-05-02 10:03:52 +0200

Hi Johanna I think that statistics_stats (underlying cfg.method=stats) is so old that it is not worth to try to fix the problem. Mpst, if not all methods are available under cfg.method=analytic). I suggest removing statistics_stats from fieldtrip and the documentation. If any, I think it makes more sense to provide the small snippets of code that it contains as example scripts. Robert


Johanna - 2011-05-02 10:56:48 +0200

Yes, I half-suspected statistics_stats was meant to be deprecated. I did also run a for-loop calling ttest in my own scripts, over the channel and frequency dimension, but leaving the time (largest) dimension, then the output of [h,p,ci]=ttest() are vectors of length time, which in my particular case made it run in 11seconds versus 3hours using FT code! But that is only possible if considering these dimensions separately.


Johanna - 2011-05-04 15:14:15 +0200

Hi Robert, You asked me to remind you of our conversation in which we said statistics_stats would be deprecated, but the knowledge would get transferred to a new page within http://fieldtrip.fcdonders.nl/example#statistics You said you'd start the wiki page to create an outline and then I will do the work of moving the info from the code to wiki. We also discussed vectorisation of the input into each matlab stats function to speed computation rather than for-loops.


Robert Oostenveld - 2011-05-04 21:47:22 +0200

thanks, much appreciated :-) I have made a start at http://fieldtrip.fcdonders.nl/example/statistics_toolbox, and will continue (hopefully tomorrow) to fill the page.