Problem when using fitrm() function for ANOVA and getting an incomplete output

조회 수: 1 (최근 30일)
lil brain
lil brain 2022년 5월 9일
답변: Jeff Miller 2022년 5월 9일
Hi,
for clarity, I have a data set with 36 participants in two conditions called "high and low (18 per condition).
In each condition the participants repeated the task in 5 different scenarios called "phases" ('pre','balls','btw','basket','post').
Hence, there are two factors, namely, 1) the 2 conditions high and low, which are independent, and 2) the 5 phases which are dependent.
I would like to run a mixed factorial RM ANOVA on this data set using the following code:
high = importdata('comptable_high.mat'); % this is the data for the high condition
low = importdata('comptable_low.mat'); % this is the data for the low condition
comptable_high_low = [high;low]; % table including both conditions
condition = ... % specifying the group membership of each participant
['H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' ...
'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' ]';
between = table...
(condition, comptable_high_low(:,1),...
comptable_high_low(:,2),comptable_high_low(:,3),...
comptable_high_low(:,4),comptable_high_low(:,5),...
'VariableNames',{'condition','pre','balls','btw','basket','post'});
within = table...
([1 2 3 4 5]','VariableNames',{'Phases'});
rm = fitrm(between,'pre-post ~ condition','WithinDesign',within);
ranovatbl = ranova(rm);
My issue is that when I run the code I get a ranova table that only includes the within group effect for the 5 phases as well the interaction effect between phases and the 2 conditons, but not the effect of the conditons alone.
I thought that this was guaranteed by specifying the between and the within table when calling:
rm = fitrm(between,'pre-post ~ condition','WithinDesign',within);
But it seems like this doesnt produce the full ranova table.
Could anyone explain to me how I can get the between group effect?
Thanks!

답변 (1개)

Jeff Miller
Jeff Miller 2022년 5월 9일
I can't check it at the moment, but I think maybe your last line should be
ranovatbl = ranova(rm,'WithinModel','Phases')

카테고리

Help CenterFile Exchange에서 Repeated Measures and MANOVA에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by