Code covered by the BSD License  

Highlights from
RMAOV33

4.18182

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

RMAOV33

by

 

14 Jan 2006 (Updated )

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

| Watch this File

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)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (16)
30 Nov 2012 Christian

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 Gert Faber

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

16 May 2012 Gert Faber

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

09 Aug 2011 Olaf Dimigen

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 Sauro Salomoni

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

09 Mar 2010 Alan Fermin

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 Pichon Swann

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 Andreia Miana

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 Michael Hamman

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 Ji Cling

Shame on you.
Self downloading 1000ths of times to get to the top of the rank.

17 Apr 2007 Clayton Hickey

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 Alexander Kraskov

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 P Diddy

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 Marianne Maertens

The code works excellent and the documentation is extremely straightforward.

Thanks!

03 Feb 2006 G. B.

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

16 Jan 2006 C. P.

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

Updates
17 Jan 2006

It was added an appropriate format to cite this file.

Contact us