Code covered by the BSD License  

Highlights from
RMAOV2

4.33333

4.3 | 6 ratings Rate this file 21 Downloads (last 30 days) File Size: 4.27 KB File ID: #5578

RMAOV2

by Antonio Trujillo-Ortiz

 

28 Jul 2004 (Updated 03 Aug 2004)

Repeated measures two-way analysis of variance test.

| Watch this File

File Information
Description

ANOVA with two within-subject variables is used to analyze the relationship between two independent variables and the dependent variable. This procedure requires fewer participants but can give rise to research confounds such as order or practice effects and participant bias.

For a more detailed explanation on repeated measures designs, we suggest you read the help section of the RMAOV1 file you can find on this MATLAB File Exchange site.

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

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

MATLAB release MATLAB 5.3 (R11)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (10)
18 Nov 2004 L. G.

My friends think this is great and told me to download it.

18 Jan 2005 J. D.

Good code.

28 Feb 2005 Richard Born

Works for me. However, unlike the toolbox function, anovan, the grouping variables must be consecutive integers, 1:n. This will be fixed by:

function [Gred] = facred(G)

% G is the orginal matrix of grouping variables:
% each row for is an observation; each column is a different grouping variable.
Gred = G;
for k = 1:size(G,2)
    groups = sort(unique(G(:,k)));
    
    for m = 1:length(groups)
        t = find(G(:,k) == groups(m));
        Gred(t,k) = m;
    end
end

20 Mar 2006 Patrick Craston

Thanks for great code!

24 Mar 2006 Arturo Ramírez  
01 Nov 2007 Ji Cling

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

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

20 Aug 2009 Dominik Bach

- I encountered negative SS values, and consequently negative Fs
- the output differed from SPSS output both with SS model II and III, and from rm_anova2.m that uses SS model III and gives the same results as SPSS

09 Aug 2011 Olaf Dimigen  
09 Aug 2011 Olaf Dimigen

Warning. This function (and apparently all other ANOVA functions by this author) produces a 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, "factorlevel 1" and "subject 11" and "factorlevel 11" and "subject 1" are written into the same storage variable with the concatenated name "x111", that is, the value of this variable is accidentally overwritten. This produces wrong results and also explains the negative F-values reported above.

Please login to add a comment or rating.
Updates
03 Aug 2004

It was added an appropriate format to cite this file.

03 Aug 2004

It was added an appropriate format to cite this file.

03 Aug 2004

It was added an appropriate format to cite this file.

03 Aug 2004

It was added an appropriate format to cite this file.

Tag Activity for this File
Tag Applied By Date/Time
statistics Antonio Trujillo-Ortiz 22 Oct 2008 07:28:39
probability Antonio Trujillo-Ortiz 22 Oct 2008 07:28:39
repeated measures Antonio Trujillo-Ortiz 22 Oct 2008 07:28:39
two withinsubjects variables Antonio Trujillo-Ortiz 22 Oct 2008 07:28:39
twoway anova Antonio Trujillo-Ortiz 22 Oct 2008 07:28:39
rm_anova2 Jamie 03 May 2010 18:44:53
repeated measures FL 07 Oct 2011 13:19:15
twoway anova FL 07 Oct 2011 13:19:18

Contact us at files@mathworks.com