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!