[Eeglablist] ANOVA Calculation in Statistica vs. Matlab
Mario Maiworm
mario.maiworm at uni-hamburg.de
Wed Nov 7 08:29:13 PST 2007
hi all,
I discussed this problem in my workgroup. I learned from a collegue that
anova2.m is NOT a repeated-measure-ANOVA.
see http://www.mathworks.com/support/solutions/data/1-15PD2.html?product=ST
<http://www.mathworks.com/support/solutions/data/1-15PD2.html?product=ST&sol
ution=1-15PD2> &solution=1-15PD2
you will have to use *.m files that are not built-in like
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=687
4
<http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=68
74&objectType=File> &objectType=File
I have not done any calculations with this script on your data, but
generally this should be the problem.
Mario.
__________________________________________________________________
Mario Maiworm
Biological Psychology and Neuropsychology
University of Hamburg
Von-Melle-Park 11
D-20146 Hamburg
Tel.: +49 40 42838 3515
Fax.: +49 40 42838 6591
BPN: www.bpn.uni-hamburg.de/Maiworm_e.html
CINACS: http://cinacs.informatik.uni-hamburg.de/content/view/157/
__________________________________________________________________
_____
Von: Rael Cahn [mailto:rael at ucsd.edu]
Gesendet: Mittwoch, 7. November 2007 08:36
An: 'Arnaud Delorme'
Betreff: ANOVA Calculation in Statistica vs. Matlab
Dear List,
I have come up with an inconsistency between the repeated-measures ANOVA
output of Statistica and Matlab for a simple 2 factor analysis of a 2x3 ERP
dataset with N=16 corresponding to ERP values for two cognitive states at 3
midline electrodes.
The settings in Statisca were "Repeated Measures ANOVA" with factors State
and Channel. The statistics script in Matlab was "ANOVA2" - Two way
analysis of variance with factors State and Channel as above
(anova2(A1,16)).
The ANOVA analyses of these data in Statistica and Matlab generated the
exact same SS, MS, and dF but the F and p values were significantly
different as indicated here:
For Statistica:
Main effect of State: F- 3.69898 p- 0.073639
Main effect of Channel: F- 0.71071, p- 0.499382
State X Channel Interaction: F- 0.48295, p- 0.621676
For Matlab:
Main effect of State: F- 2.88 p- 0.0932
Main effect of Channel: F- 0.18, p- 0.8338
State X Channel Interaction: F- 0.06, p- 0.9442
Does anyone have an idea as to why the two ANOVA in Statistica and Matlab
generates such different values and, if so, which is more appropriate for
use with ERP data???
(incidentally a bootstrap/permutation analysis of the significance for state
run in Matlab generated a p-value of 0.0149 for State1 vs. State2)
Here's the data:
State1 Ch1
7.768
5.615
0.3074
0.762
5.4652
2.6145
2.5397
8.2239
8.4658
-4.9788
6.0245
4.0349
9.6742
11.5664
8.3378
6.6524
State1 Ch2
7.2829
4.9909
0.9792
2.3317
5.3813
4.608
4.5485
10.8874
10.4529
-7.5731
8.7319
4.5726
12.9894
13.372
8.6935
4.3401
State1 Ch3
5.6541
2.689
0.9022
2.4779
3.9023
6.1488
5.0258
14.2864
9.7666
-1.8947
5.7047
4.0641
13.8596
9.012
7.5569
6.0009
State2 Ch1
2.2808
2.7393
0.4708
-1.2193
9.3576
4.1422
0.5838
7.6672
1.4603
1.9716
7.359
3.5934
5.399
9.1324
6.3965
4.4362
State2 Ch2
3.6114
3.6278
3.4012
-2.3031
5.7399
3.1817
1.9795
9.106
2.1827
-0.69
4.7947
5.1603
8.158
13.6168
4.4405
2.0521
State2 Ch3
4.5252
5.7949
5.5186
-2.5002
3.0347
5.237
1.3336
11.7375
2.058
-1.094
3.0639
6.0547
10.9694
9.8537
1.5573
5.0396
Here is the data presented in tabular for for ease of manipulation in
Matlab:
(column 1 corresponds to ERP values at Ch1, column2 to ERP values at Ch2,
column3 to ERP values at Ch3; Rows 1-16 correspond to ERP values during
cognitive state 1 and Rows 17-32 correspond to ERP values during cognitive
state 2)
A1 = [ ...
7.768 7.2829 5.6541;
5.615 4.9909 2.689;
0.3074 0.9792 0.9022;
0.762 2.3317 2.4779;
5.4652 5.3813 3.9023;
2.6145 4.608 6.1488;
2.5397 4.5485 5.0258;
8.2239 10.8874 14.2864;
8.4658 10.4529 9.7666;
-4.9788 -7.5731 -1.8947;
6.0245 8.7319 5.7047;
4.0349 4.5726 4.0641;
9.6742 12.9894 13.8596;
11.5664 13.372 9.012;
8.3378 8.6935 7.5569;
6.6524 4.3401 6.0009;
...
2.2808 3.6114 4.5252;
2.7393 3.6278 5.7949;
0.4708 3.4012 5.5186;
-1.2193 -2.3031 -2.5002;
9.3576 5.7399 3.0347;
4.1422 3.1817 5.237;
0.5838 1.9795 1.3336;
7.6672 9.106 11.7375;
1.4603 2.1827 2.058;
1.9716 -0.69 -1.094;
7.359 4.7947 3.0639;
3.5934 5.1603 6.0547;
5.399 8.158 10.9694;
9.1324 13.6168 9.8537;
6.3965 4.4405 1.5573;
4.4362 2.0521 5.0396 ];
anova2(A1,16)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20071107/f4cc9644/attachment.html>
More information about the eeglablist
mailing list