File Exchange

image thumbnail


version 1.0 (4.59 KB) by

Repeated measures single-factor analysis of variance test.

7 Ratings



View License

One-way repeated measures ANOVA is used to analyze the relationship between the independent variable and dependent variable. It is an extension of the correlated-groups t test, where the main advantage is controlling the disturbance variables or individual differences that could influence the dependent variable.

In contrast to the independent groups ANOVA (between-subjects), the repeated measures procedure is generally more powerful (ie. leads to a greater likelihood of rejecting a false null by hypothesis). Statistically, this is the case because unwanted variability (error) due to individual differences among participants can be quantified and removed from the denominator of the F-ratio. This procedure requires fewer participants, but it can give rise to research confounds such as order or practice effects and participant bias.

Total variability broken down into two components:
-Between subjects. Variability in scores due to individual differences among participants.
-Within subjects.
The within subjects variability is subdivided into the following components:
-Treatment. Variance among the treatment means (same as MS between in the independent groups ANOVA).
-Residual. Leftover or unwanted error variability (can be thought of an inconsistencies in the effects of the treatments across the participants).

It needs to input the X-data matrix (Size of matrix must be n-by-3;dependent variable=column 1, independent variable=column 2;subject=column 3) and the alpha- significance level (default = 0.05).

The output is a complete Analysis of Variance table and the strength of the relationship.

Comments and Ratings (13)

Hi Faith,
No. It does not support missing values.


Faith (view profile)

Hi, does this function support missing values in the data?


Dario (view profile)

Thanks for the effort!


rui (view profile)

Hi guys, I posted a question of how to use this function (
Hope some one can help me with this problem.

I appreciate your help!



Sadaf (view profile)

Thank you for the code!
Any recommendation on how to do a pair wise comparison (multcompare) after doing this repeated measure 1 way anova?

David Allsop

Hi, I haven't yet tried using your function, I will rate it after I have used it. However I was wondering if somebody could explain to me whether it is possible for me to perform the following analyses with this function: (1) a priori contrasts (2 tailed) comparing mean scores between phase 1 vs phase 2 of experiment, then if that contrast comes out significant (2) examine the day X phase interaction term (each "Phase" has 7 days in it)...Just not sure this function will allow me to look at interactions like this.

Thanks in advance, Dave

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.


Ji Cling

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

Mimi Szeto

Is matlab supposed to have an fcdf function?

This isn't working for me because of that line on the code.
Any thoughts?

Søren Andersen

Being able to directly perform RM-ANOVAs in Matlab, instead of having to export data to a commerical statistics program greatly facilitates data analysis. A very useful function !

Hao Qin

Very inspiring code!
The code could be made less complicated and faster by substituting the multiple eval commands with appropriate simpler commands.

MATLAB Release
MATLAB 5.3 (R11)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today