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.

カテゴリ

製品

リリース

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