no between-subjects main effect for mixed within- and between-subject repeated measures ANOVA (ranova)

9 views (last 30 days)
Hi, thank in advance for any help anyone can provide. I'm working with a 2 (between) x 7 (within) factor ANOVA model. The output of ranova does not seem to provide any stats for the main effect of the between subject factor (group), which I need. See below.
t = table(grp,d(:,1),d(:,2),d(:,3),d(:,4),d(:,5),d(:,6),d(:,7),...
'VariableNames',{'group','step1','step2','step3','step4','step5','step6','step7'});
Meas = dataset([1 2 3 4 5 6 7]','VarNames',{'Measurements'});
rm = fitrm(t,'step1-step7~group','WithinDesign',Meas);
raresults = ranova(rm);
raresults =
SumSq DF MeanSq F pValue pValueGG pValueHF pValueLB
________ ___ _________ ______ ________ ________ ________ ________
(Intercept):Measurements 0.04229 6 0.0070484 2.9598 0.007825 0.01301 0.010245 0.090513
group:Measurements 0.032007 6 0.0053345 2.2401 0.038962 0.051168 0.045013 0.13971
Error(Measurements) 0.85729 360 0.0023814
Am I missing something, or shouldn't there be a third F test in there for the main effect of group? How do I specify the model to get that test?
  1 Comment
Jared Van Snellenberg
Jared Van Snellenberg on 27 Jul 2014
Seems that in this particular case I can just average over Measurements (within each subject) and run a simple between-group t to get what I'm after, but it still seems to me there should be a way to get this out of a single model run....

Sign in to comment.

Accepted Answer

Mike Seay
Mike Seay on 18 Aug 2015
As far as I know, there is no way to get the between-subjects main effect out of a single run of ranova(). However, if you want this information without too much work, just run anova() on the same model and check the row corresponding to 'group'. In other words, add something like this:
aresults = anova(rm);
aresults
The result should be the same or similar as with a single model-run from elsewhere, such as anova_rm() on the File Exchange or other statistical software.

More Answers (1)

Dario Martelli
Dario Martelli on 25 Apr 2017
Hi,
Try to use:
raresults = ranova(rm,'WithinModel','Measurements');
It should work.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!