5.0

5.0 | 4 ratings Rate this file 102 Downloads (last 30 days) File Size: 2.77 KB File ID: #22088

Repeated Measures ANOVA

by Arash Salarian

 

13 Nov 2008

Single factor repeated measures ANOVA for one or more samples.

| Watch this File

File Information
Description

[p, table] = anova_rm(X, displayopt) performs a repeated measures ANOVA for comparing the means of two or more columns (time) in one or more samples(groups). Unbalanced samples (i.e. different number of subjects per group) is supported though the number of columns (followups) should be the same.

Acknowledgements

This file inspired Intraclass Correlation Coefficient (Icc).

Required Products Statistics Toolbox
MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
anova(5), statistics(3), unbalanced samples(3)
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
22 May 2013 Marc

Hi,

I keep getting an errors when I run your file.

??? patients =
|
Error: Expression or statement is incomplete or incorrect.

Any suggestions on troubleshooting?

03 Dec 2012 ted teng  
30 Sep 2012 Andrew

Does anyone know what the subjects matching output is? I'm assuming it shows the probably that subjects are the same, but just want to make sure

04 Sep 2012 Arash Salarian

@Justin: I'm struggling with the comment editor. A previous comment was magically deleted and the other one does not make much sense now. In short, I verified the code and I think it is fine. Also, I run the same data through R and got identical results. You can see the R output here: http://imgur.com/FHJc4.png

04 Sep 2012 Arash Salarian

Ah, I messed up the R output in my comment. Here is a link to a picture of the R output: http://imgur.com/FHJc4

16 Mar 2012 Justin

thanks,
One problem that I noticed is that in your example, you show that time is the within subjects factor, but in your reality you seem to treat the group as the within subjects factor.

the f-value that you get for time seems to come from dividing MStime by MSerror. This should really be MStime / MSsubjects if this is the variable with repeated measures. You also get the f value for group by MSgroup / MSsubjects. The group variable should not have repeated measures, so basically, the two should be reversed. I'm not sure, but I think that the error is consistent with itself int he rest of your code, so In order to get the correct results from this function you need to switch the organize your two factors opposite of the way that the you did it in the example.

statizticz is 3vil

11 Jul 2011 Ali Ali

Thanks a lot

16 May 2011 Chris Allen

Nice clear function, be even better if it could handel more factors (like anovan)

20 Jan 2011 Sophie

Dear Arash, First thank you for this really useful function. Please, would you mind telling us, what does this "Subject matching" correspond to exactly (in the resulting table)?
Thanks a lot.

Contact us