View License

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

» Watch video

Highlights from

3.7 | 7 ratings Rate this file 29 Downloads (last 30 days) File Size: 4.59 KB File ID: #5576 Version: 1.0




28 Jul 2004 (Updated )

Repeated measures single-factor analysis of variance test.

| Watch this File

File Information

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.

MATLAB release MATLAB 5.3 (R11)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (13)
21 Jan 2014 Antonio Trujillo-Ortiz

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

Comment only
14 Jan 2014 Faith

Faith (view profile)

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

Comment only
23 Nov 2012 Dario

Dario (view profile)

28 Sep 2011 Tobias Piechowiak

Thanks for the effort!

22 Aug 2011 rui

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!

Comment only
31 Mar 2011 Sauro Salomoni


08 Jun 2010 Sadaf

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?

Comment only
29 Nov 2009 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

Comment only
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.


Comment only
01 Nov 2007 Ji Cling

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

29 Apr 2007 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?

03 Nov 2006 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 !

30 Dec 2004 Hao Qin

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

Contact us