Multcompare on repeated measure ANOVA object performs double two way comparisons

8 次查看(过去 30 天)
Dear all,
I ran a repeated measure two way ANOVA with a 2 by 4 fully within design. Here is an example of the code I ran:
% generate random data for the example
rndData = randn(24,8);
% Create a table storing the respones
varNames = {'Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8'};
t = array2table(rndData,'VariableNames',varNames);
% Create a table reflecting the within subject factors 'TestCond', 'Attention', and 'TMS' and their levels
factorNames = {'Cate','Task'};
within = table({'A'; 'A'; 'B'; 'B'; 'C'; 'C'; 'D'; 'D'},{'I';'II';'I';'II';'I';'II';'I';'II'},'VariableNames',factorNames);
% fit the repeated measures model
rm = fitrm(t,'Y1-Y8~1','WithinDesign',within);
% run my repeated measures anova here
[ranovatbl] = ranova(rm, 'WithinModel','Cate*Task');
% make pairwise comparisons for the two-way interactions
%
% see: help RepeatedMeasuresModel/multcompare
multcompare(rm,'Task','By','Cate')
The above multcompare yields the following:
Cate Task_1 Task_2 Difference StdErr pValue Lower Upper
____ ______ ______ __________ _______ ________ _________ ________
'A' 'I' 'II' -0.030251 0.28824 0.91732 -0.62652 0.56602
'A' 'II' 'I' 0.030251 0.28824 0.91732 -0.56602 0.62652
'B' 'I' 'II' -0.09305 0.25671 0.72031 -0.62409 0.43799
'B' 'II' 'I' 0.09305 0.25671 0.72031 -0.43799 0.62409
'C' 'I' 'II' -0.33807 0.34831 0.34184 -1.0586 0.38246
'C' 'II' 'I' 0.33807 0.34831 0.34184 -0.38246 1.0586
'D' 'I' 'II' 0.44612 0.24336 0.079751 -0.057304 0.94955
'D' 'II' 'I' -0.44612 0.24336 0.079751 -0.94955 0.057304
I am a bit confused by the fact that within each 'cate', we perform the following test: I vs II and then II vs I. Both are statisticaly the same, one simply yields the negative of the other. The multcompare corrects for multiple comparison problem paused by such methods, but my worry is that if the multcompare corrects for all the tests displayed here, the correction will actually be exagerated, as only half of the tests are necessary.
Thanks in advance for your support,
Kind regards
  1 个评论
deejt
deejt 2021-6-3
I was wondering about the same.
Also I was wondering how do I know in case of a small p-value, which of the factor levels, in this case I vs II, had the positive impact on Cate since its the same comparison in both lines?
Thank you for your help!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by