Code covered by the BSD License

### Highlights from RMAOV33

4.18182

4.2 | 11 ratings Rate this file 17 Downloads (last 30 days) File Size: 5.69 KB File ID: #9638

# RMAOV33

14 Jan 2006 (Updated )

Three-way Analysis of Variance With Repeated Measures on Three Factors Test.

File Information
Description

This is a three-factor analysis of variance design in which all factors are within-subjects variables. In repeated measures designs, the same participants are used in all conditions. This is like an extreme matching. This allows for reduction of error variance due to subject factors. Fewer participants can be used in an repeated measures design. Repeated measures designs make it easier to see an effect of the independent variable on the dependent variable (if there is such an effect).

Due that there is no way to obtain an independent estimate of error component, for we have only one score per cell, and therefore no within-cell variance. However, each of the interactions with subjects can be shown to serve as a denominator for an F ratio. So, each effect to be tested has its own error term. Thus every effect is tested by the interaction of that effect with the Subject effect.

Inputs:
X - data matrix (Size of matrix must be n-by-5;dependent variable=column 1; independent variable 1 (within subjects)=column 2;independent variable 2 (within subjects)=column 3; independent variable 3 (within subjects)=column 4; subject=column 5).
alpha - significance level (default = 0.05).
Outputs:
- Complete Analysis of Variance Table.

MATLAB release MATLAB 7 (R14)
30 Nov 2012

I usually enjoy your RM anova extensions to MATLAB and make use of them quite often. However, I have encountered a small glitch in this function:
When you calculate the within-subject sum of squares by summing up all the SS the SSAC term is added twice (see line 461).

16 May 2012

Oops, I made a mistake, I get the same results now

16 May 2012

And looking at my plots, results of SPSS seem to make more sense.

09 Aug 2011

Function produces wrong output if (A) one of the factors has more than 10 levels and more than 10 subjects are used or (B) both factors have more than 10 levels.
The reason is that the "eval()" function is used to create temporary storage variables. Unfortunately, the result of "factorlevel 1" and "subject 11" is written into the the same variable "x111" as the result of "factorlevel 11" and "subject 1" (because both numbers are simply concatenated to produce the storage variable name), that is, the value of this variable is accidentally overwritten on subsequent iterations. This produces wrong results and also explains the negative F-values reported above.

30 Nov 2010

Works great. Values are consistent with Statistica results. Thank you.

09 Mar 2010

the code is excellent, easy to understand and to perform a test.
it accounts for within subject variance, but results are not much different from anovan. how to perform a post-hoc analysis, as the multicomparion in anovan?

04 Nov 2009

Function Bugged ?
It returns negative SS values on some analyses and SS/F/p results differ significantly from RM ANOVA calculated using SPSS or Statistica.

23 Jan 2008

This function is exactly what I was looking for, considering that this m-file is not available in matlab. In addition, the table and the explanation are very helpful. Thanks to the authors.

01 Nov 2007

My Dear Ji Cling,

Regularly I visit this FEX site in which excellent contributions for the fast solution of diverse types of problems in several disciplines have been given. The accusation that you are causing is very delicate. I do not know you. Neither the authors. We known them only by the references given in their author page. Only what I believe is in the quality of ethics of each one of them and ours. We are serious people dedicated to our work in the most diverse specialties. To be certain what you say. Then not alone this author does cheating but also all the others. Even you, that in principle, I think you are not signing with your true name. Finally, or really the community are honestly dawnloaded the m-files or finally someone are doing a very bad play. This because there exists a lack of control on this.

Best Wishes.

Mike

01 Nov 2007

Shame on you.

17 Apr 2007

Excellent tool, interpretable code. Thanks very much to the author. To comment on a comment, p.diddy is confused; anovan.m has no repeated measures functionality.

11 Oct 2006

there is a bug in it
line 427:
is MSABC = SSABC/v10;
should be MSABC = SSABC/v13;

minor thing is that comment for lines 426,427 and 444, 445 are wrong, just copy/paste from lines 316,317, 332, 333

17 Jul 2006

already available in matlab as function "anovan". anovan is much more intuitive than this m file, with respect to the data format that is fed into the function.

11 Jun 2006

The code works excellent and the documentation is extremely straightforward.

Thanks!

03 Feb 2006

Many thanks to the authors for this very useful and much-needed code! Works perfectly.

16 Jan 2006

I am a neurophysiologist and this m-file its just what I was needing. Thanks to the authors for their contribution.