View Full Version : pb using permtest
ROGER DE GARDELLE
October 12th, 2006, 06:36
Hello,
I want to use permtest to compare 2 conditions in a group of subject.
The conditions are 'P1' and 'W1', represented by 2 datas:
Subject(6) x channel(10) x time(100).
I use only a little portion of my datas to avoid memory pb.
I use the following command line:
[pv,S0,NP,PS,P] = permtest(W1,P1,'ttest',1,[2 3])
And then I get the following error:
Error using ==> ge
Matrix dimensions must agree.
Error in ==> permtest at 539
S=S+(Z>=abs(S0));
the data seems to be reshaped in a not compatible way at line 525...
Is there something I am doing wrong?
Unfortunately I am not able to upload my datafile, but these ones are equivalent for the test:
W1 = rand(6,10,100)+2;
P1 = rand(6,10,100)+1;
Thanks for help,
-Vincent
kndiaye
October 12th, 2006, 07:55
You're doing perfectly right. But not permtest. Indeed, you stumble upon a small bug in reshaping matrix. It is now corrected in permtest.m at revision: 189 of the distribution.
The patch is quite simple:
Add this line
Z=reshape(Z,[Options.Test.OuputSize]);
between lines 535 and 536 in the buggy version, right before the end of the block
if Options.Global.Apply
...
end
Let us know if you still have trouble with it!
Sylvain
October 12th, 2006, 08:21
Here is the patch. Thanks to Karim.
ROGER DE GARDELLE
October 19th, 2006, 07:28
Hi,
I am reposting on this thread to notice some minor things:
- files in the statistics directory are not rewritten in the brainstorm/toolbox directory, which seems to contain older versions of permtest.m , ...
- with 'pairedttest' option, permtest calls tvalue_paired (l.471), which seems to be missing.
-Vincent
Sylvain
October 20th, 2006, 14:02
Sorry this was missing.
Karim N'Diaye has just passed me the files. It's a C code for faster computations with a compiled version for Windows (Linux users may just compile the .c on their systems)
As for this:
- files in the statistics directory are not rewritten in the brainstorm/toolbox directory, which seems to contain older versions of permtest.m , ...
Maybe this comes from a BrainStorm update you did lately. The stats files are supposed to have moved from /Toolbox to /Toolbox/statistics. Whenever you update from an older version, please delete the Toolbox folder first.
Thanks a again for yoru careful usage of BST.
ROGER DE GARDELLE
October 23rd, 2006, 02:50
Hi!
As for this: ...
Maybe this comes from a BrainStorm update you did lately. The stats files are supposed to have moved from /Toolbox to /Toolbox/statistics. Whenever you update from an older version, please delete the Toolbox folder first.
Thanks a again for yoru careful usage of BST.
I have just downloaded bst_hot and unzipped to a new directory, and I confirm my observation : indeed the stats .m files in /toolbox/statistics are ok, but in /toolbox there are still older versions.
Sorry for insisting,
-Vincent
ROGER DE GARDELLE
October 23rd, 2006, 06:36
Hi again,
As I am doing statistics, one more thing:
In permtest_cluster, the function "prob_clusters" is called but is unknown.
Again, thanks for the work you're doing !
-Vincent
Sylvain
October 23rd, 2006, 08:41
Here is the file. Sorry for the mess but the stats toolbox is under heavy construction. We're happy though that people test it out on the fly.
As for the older files, is it only permtest.m ? If not, please send me the list of redundant files. It might be a problem with our SVN source server.
Thanks again!
ROGER DE GARDELLE
October 23rd, 2006, 09:12
here is the list:
bst_baseline_correction.m
bst_permutation_test_arrays.m
bst_permutation_test_files.m
bst_statsbox.fig
bst_statsbox.m
myttest.m
permdifftest.m
permdifftest_norm.m
permtest.m
permtest_cluster.m
permttest.m
permttest_norm.m
zscore_gui.fig
zscore_gui.m
As for the first question, I am sorry it was about "prob_cluster", which is missing. You posted permtest_cluster, but I think it was not the problem, no?
Thanks,
- Vincent
Sylvain
October 23rd, 2006, 09:34
Sorry: here it is.
As for the duplicate files, we'll work on this issue - thanks !
Sylvain.
Sylvain
October 23rd, 2006, 15:06
That's it. The archive should now be fresh from the oven every night, without duplicate files.
thanks for having pointed this out !
ROGER DE GARDELLE
October 30th, 2006, 06:56
Hi, great!
May I suggest a verbose on/off option for the permtest, I propose this file, in which I just added an input argument at the end of argument list, but maybe it will not share your programming standards, or cause side effects errors...
Bests,
-Vincent
Sylvain
October 30th, 2006, 09:18
Thanks Vincent.
Your contribution will be in next BST nightly update! Keep on permuting !!!