two way repeated measures anova

how to do a 2 way repeated measures anova with MATLAB? I need to perform a 2 way anova for a repeated measures data, each having 2 levels. I see anova2 is to be used for between subject designs and anovan when the design is unbalanced. Any advice would be of great help.

댓글 수: 4

Jeff Miller
Jeff Miller 2020년 7월 24일
See if this previous answer helps
Shamini Warda
Shamini Warda 2020년 7월 25일
편집: Shamini Warda 2020년 7월 25일
Hi. Many thanks for this. this code works fine, but it gives different results. here is how i used it. I have 2 within subject factors, each having two levels.
levels were arranged column wise with 29 observations row wise for each levels
data = [li_l(:,1), li_s(:,1), si_l(:,1), si_s(:,1)];
datatable = array2table(data);
datatable.Properties.VariableNames = {'li_lr','li_sr','si_lr','si_sr'};
WithinFactors = table([1 1 2 2]',[1 2 1 2]','VariableNames',{'Interval','Response'});
rm = fitrm(datatable,'li_lr,li_sr,si_lr,si_sr~1','WithinDesign',WithinFactors);
ranovatable = ranova(rm,'WithinModel','Interval*Response');
any suggestions would be of immense help.
Thank you.
Jeff Miller
Jeff Miller 2020년 7월 25일
Different results than what?
You probably want to use the 'categorical' command to tell ranova that the numbers in WithinFactors represent arbitrary category labels rather than numerical values of some predictor.
Shamini Warda
Shamini Warda 2020년 7월 27일
It now works. Thank you very much.

댓글을 달려면 로그인하십시오.

답변 (1개)

Scott MacKenzie
Scott MacKenzie 2021년 7월 28일

1 개 추천

Visit this question for a simple approach to doing a two-way repeated measures (aka within-subjects) anova using the ranova function.

카테고리

도움말 센터File Exchange에서 Repeated Measures and MANOVA에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2020년 7월 23일

답변:

2021년 7월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by