Set up Repeated Measures Anova function MATLAB
显示 更早的评论
Hello Everyone,
I want to run an ANOVA comparing 3 treatments (labeled as 1, 2, and 3) and then run a post-hoc comparison between treatments if the ANOVA shows a difference. I have 16 individual patients who all receive 3 different treatments and each treatment has 3 independent measurements taken at the same time. Here is the code I have so far:
data = readtable('Data.xlsx') ;
% Removing the 'Patients' column
t = data(:,2:end) ;
% Within design
WithinDesign = table((1:3)','VariableNames',{'Measurements'}) ;
% Repeated measures model
rm = fitrm(t,'AA-FE~Treatment','WithinDesign',WithinDesign) ;
% Sphericity test
rm.mauchly
% Anova
ranova(rm)
I understand that the data does not pass the sphericity test caclulated by rm.mauchly, but I would still like to know whether or not my ANOVA set-up represents what I wanted to acquire from ANOVA since I would like to do this in the future.
3 个评论
Scott MacKenzie
2022-7-22
编辑:Scott MacKenzie
2022-7-24
@Jacob Jacobo I can help with the ANOVA and post hoc comparisons, but first I'd like to verify that I understand your design. Are AA, IE, and FE measurements taken for each treatment? You refer to them as "independent measurements", but they sound like dependent variables to me. That is, AA is a measurement that depends on the treatment (1, 2, or 3). The same can be said for IE and FE, if I understand correctly. Just a terminology thing, perhaps. Seems to me your independent variable is treatment, with levels 1, 2, and 3. So, I would characterize your design as a single-factor design with one within-subjects independent variable (treatment with levels 1, 2, and 3) and three dependent variables (AA, IE, and FE). Is this correct?
Jacob Jacobo
2022-7-25
Scott MacKenzie
2022-7-25
@Jacob Jacobo, thanks for the clarification. I just posted an answer. Good luck.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Repeated Measures and MANOVA 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!