@Dan I cannot help you much with that in MATLAB. These days I mostly use R for anything beyond basic statistics. For your reference, here is a Q/A about something what I believe is exactly similar to your situation:
That's very good but I'd like to run a post-hoc analysis after the rm-anova. I'm currently running a two-way rm anova and I'd like to know the differences between all combinations. Is their a way to do so with multcompare?
@Patrizia your problem with NaN and in general, missing data is beyond the scope of this code. Generally this is handled separately through what we call imputation methods. They range from very basic (and unsatisfactory) approaches like removing incomplete cases to more advanced approaches like multiple imputations. However, the point is that there is no single, universally best approach for the missing data problem.
@J The main difference between repeated measures and the n-way ANOVA is that the former can model within subject variations while the latter can only model between subject variations. Essentially repeated measures ANOVA is a small subset of linear mixed models. In general you cannot model mixed models with simple, n-way ANOVA. In SPSS as well as the newest version of MATLAB linear mixed modeling is supported.
I'm trying to understand something related to a one-way repeated measures ANOVA.
I have one group and two scores over time. In SPSS (and this code) you input every subject's score on one row with each column being the next measurement in time. If I use anovan (built in RM analysis within Matlab) I can do the same thing but have to instead put all data sequentially in a line (row or column does not matter as long as every subject's score follows each other) and create a file the same length as my data file with the condition order.
This doesn't actually change anything a part from the df (which are doubled in anovan since I spread the data in 1 line rather than 2 equal columns) however it also gives different results in the p value (nothing drastic but still different).
Any ideas why anovan and this code producing different results while this code and SPSS produce the same results? THANKS!