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 Kommentare

Jeff Miller
Jeff Miller am 24 Jul. 2020
See if this previous answer helps
Shamini Warda
Shamini Warda am 25 Jul. 2020
Bearbeitet: Shamini Warda am 25 Jul. 2020
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 am 25 Jul. 2020
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 am 27 Jul. 2020
It now works. Thank you very much.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Scott MacKenzie
Scott MacKenzie am 28 Jul. 2021

1 Stimme

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

Produkte

Version

R2018b

Gefragt:

am 23 Jul. 2020

Beantwortet:

am 28 Jul. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by