File Comment by Comment
19 Jun 2014 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Lisa

### Lisa (view profile)

Solved it!

Comment only
23 Apr 2014 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Chloe

### Chloe (view profile)

Is the result of p-value from first line indicating the result of within subject?

Comment only
21 Nov 2013 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Aaron Schurger

### Aaron Schurger (view profile)

Hi, Marc,
This procedure is strictly for situations where you have exactly two within-subjects factors. To my knowledge there exists no n-factor repeated measures ANOVA algorithm. Just going from two-factor to three-factor you have a huge jump in complexity of the algorithm, and when you have different numbers of between-subjects and within-subjects factors things get really scary really fast. But there are functions on the File Exchange for more than two factors.

Comment only
25 May 2013 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Marc

### Marc (view profile)

Will this file work for a multi-factor (more than two factors) ANOVA?

Will it also work on a One-Way ANOVA?

Comment only
10 Dec 2011 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Jordan

### Jordan (view profile)

This seems very promising, but I can't figure out what kind of input is needed. For instance, what is d in the function definitions, and are Y and grouping vectors meant to comprise one column or multiple columns? It would be very helpful if the author could include with his download a small .mat file with sample inputs for Y, F1, F2 etc.

Comment only
11 Oct 2011 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Marieke

### Marieke (view profile)

the script works now - I appear to have had an old version of the script.

Comment only
06 Jul 2011 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Erin

### Erin (view profile)

Good submission. I found this script gives the same results as anovan. To do repeated measures with anovan, its necessary to make another factor for subjects, and specify that factor as 'random'.

4
06 May 2011 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Marieke Rohde

### Marieke Rohde (view profile)

for the data that made me spot the bug the script displays the following first three lines of the ANOVA tables.

If you take the average from multiple cells by hand:

'Source'SS df MS F p
'cond' 1.0413 1 1.0413 1.8483 0.1971
'hand' 0.2325 1 0.2325 1.7135 0.2132
'cxh' 0.1184 1 0.1184 2.7210 0.1230

if you enter several values for multiple cells, according to documentation, it should do the same thing automatically, but doesn't:

Source SS df MS F p
'cond' 1.0413 1 1.0413 1.8483 0.1971
'hand' 0.2325 1 0.2325 1.7135 0.2132
cdxhd 0.1184 1 0.1184 1.4417e-05 0.9970

which is jsut plainly wrong (note that first 3 columns are identical). i would be surprised if Statistica did the same. i did the calculations by hand at the time to figure out what exactly went wrong but cannot remember - if you're interested in the data please be in touch.

Comment only
27 Apr 2011 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. titou

### titou (view profile)

Thanks a lot.

I precise I just needed to change :

F1==F1_lvls(i)

in

strcmp(F1,F1_lvls(i))==1

and it works great ! (same results as Statistica)

5
18 Dec 2010 confplot_t Plots a graded error boundary which varies in color or shades of gray according to a t distribution. Nathan Orloff

### Nathan Orloff (view profile)

I can see how this would be useful. Part of the beauty of confplot is it is so ridiculously intuitive. If you could modify your code to handle some of the issues with confplot and make all this other stuff optional, I think that would make a lot of people happy.

4
29 Apr 2010 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Jamie

### Jamie (view profile)

I agree this is a very well written script. However, I am somewhat confused about the Y input variable. In the comments above it says that 'Y' should be a column vector (I assume this means (:, 1)). My confusion comes from the following lines:

for i=1:a % F1
for j=1:b % F2
for k=1:n % Subjs
INDS{i,j,k} = ...
CELLS{i,j,k} = Y(INDS{i,j,k});
MEANS(i,j,k) = mean(CELLS{i,j,k});
end
end
end

The '...' was placed instead of the code to create the indices. The line CELLS{i,j,k} = Y(INDS{i,j,k}); generates a 3D cell from Y, which makes sense to have the data in three dimensions, however Y is a 1D column and creates a large number of NaNs.

Also, Matlab produces the following error:

??? Error using ==> horzcat
CAT arguments dimensions are not consistent.

Error in ==> rm_anova2 at 138
stats = {'Source','SS','df','MS','F','p';...

Comment only
22 Apr 2010 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Marieke Rohde

### Marieke Rohde (view profile)

There's a mistake in this script: if several measurements are provided for one cell, it gives wrong values for the interaction. help says it would take the average in that case, which it does for the most part, but at some point it gets confused with the number of measurements taken and F and p are then really wrong (only concerns interaction with several values per cell).

By the way, RMAOV2 --> same functionality, even though a bit bulky, takes the variance across repeated measurements for the same cell into consideration.

Comment only
23 Feb 2010 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Alberich Qi

### Alberich Qi (view profile)

I think it should be written as :

FACTNAMES = {F1name, F2name};
F1name = {'abc' , ..., 'xyz'};
F2name = {'xx', ..., 'yy'};

It can work well in my script.

5
31 Dec 2009 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Robert

### Robert (view profile)

I would also appreciate a one line example of how to enter FACTNAMES. I'm getting an error. Thanks!

Comment only
19 Nov 2009 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Negar

### Negar (view profile)

Hi,

Can someone give me a one line example of how to enter FACTNAMES? I'd appreciate it.

Comment only
17 Jul 2009 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Aaron Schurger

### Aaron Schurger (view profile)

Hi, Zachary,
Good question. No, it was not designed to deal with a different number of subjects on each factor. Sorry about that. It might not be too complicated to code, but I imagine that there are some statistical issues to be mindful of, and I would want to look into that before changing the code. In the meantime, you might be able to insert a dummy value, which is just the mean of the other values, just to make the program work. One thing that I can do is to make the program generate an error instead of just giving back nan's. It would help to see the data, just as you passed them to the program. -Aaron

Comment only
17 Jun 2009 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Zachary Danziger

### Zachary Danziger (view profile)

The stats output is a cell array of NaNs. Is this software capable of dealing with unequally distributed data? I.e., 7 subjects are evaluated on factor 1, but only 6 are evaluated on factor 2.

Comment only
31 Mar 2009 confplot_t Plots a graded error boundary which varies in color or shades of gray according to a t distribution. Aaron Schurger

### Aaron Schurger (view profile)

Thanks!
Aaron Schurger

4
24 Jul 2008 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. piyush singhal

1
07 Apr 2008 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. terence hill

2
23 Mar 2008 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. keidit chankhachon

4
16 Mar 2008 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Perspicacity Slim

It would make my day if you could add Greenhouse-Geiser correction for violating the sphericity assumption of repeated measures ANVOA.

4
18 Feb 2008 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Ashwin Sundar

4
28 Jun 2007 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. malia mason

This worked well for me.

4
13 Dec 2006 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. adam mcnamara

Examples with data are always very helpful.. this is what this lacks

4
27 Feb 2006 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Teck Por Lim

The author had corrected the code after Ted Zanto's comment in 2005.

5
02 Feb 2006 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. dojoon yi

It is great. Thank you!!!

5
22 Jul 2005 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Ted Zanto

Excellent program...does exactly what it's designed for. Easy to implement and coded in a very straightforward manner. Results were confirmed in SPSS...right on the mark.

One tiny error on line 133: FACTNAMES{1} should be FACTNAMES{2}...but this merely a labeling issue.

Nonetheless, it's a great program, thanks Aaron!

5
29 Apr 2005 Two-way repeated measures ANOVA Two-way repeated measures ANOVA, for designs with two within-subjects variables. Aaron Schurger

A very well-written program (of course, I wrote it myself). One or two additional features are of interest, so I would not yet call it excellent.

4