treder / MVPA-Light

Matlab toolbox for classification and regression of multi-dimensional data
MIT License
70 stars 35 forks source link

Error in mv_statistics #23

Closed Sanjeevnara closed 3 years ago

Sanjeevnara commented 3 years ago

HI Matthias, I am using permutation test with cluster correction on time-frequency data decoded using LDA classifier. Below is the code : cfg_stat = []; cfg_stat.metric = 'auc'; cfg_stat.test = 'permutation'; cfg_stat.correctm = 'cluster'; % correction method is cluster cfg_stat.n_permutations = 10000; cfg_stat.clusterstatistic = 'maxsum'; cfg_stat.alpha = 0.05; % use standard significance threshold of 5% cfg_stat.design = 'within'; cfg_stat.statistic = 'ttest'; cfg_stat.null = 0.5; cfg_stat.clustercritval = 1.65; stat_level2_Cond_1 = mv_statistics(cfg_stat, result_cond_1);

While i change only correctm parameter to 'none' or 'bonferroni', it shows up following error :

Undefined function or variable "perf".

Error in mv_statistics (line 471) counts = counts + double(permutation_perf > perf);

Also, when i change only statistics parameter from 'ttest' to 'wilcoxon', it shows this error :

Error using sort Too many input arguments.

Error in mv_stat_wilcoxon_signrank (line 51) X = sort(X, 1, 'ComparisonMethod', 'abs');

Error in mv_statistics/within_subject_statistic (line 547) case 'wilcoxon', perf_stat = mv_stat_wilcoxon_signrank(cperf);

Error in mv_statistics (line 410) perf = within_subject_statistic(cfg.statistic, perf_all_subjects);

May i request you to please have a look into the error.

Thanks

Best regards Sanjeev

treder commented 3 years ago

Hi Sanjeev, I will try to replicate the error but will require some additional information: is result_cond_1 a cell array of results? How many subjects are in it?

treder commented 3 years ago

There was a bug for Level 2 tests without cluster correction, fixed now. Can you update and confirm please?