How to perform 1way-ANOVA with matrices

14 次查看(过去 30 天)
Hello,
I would like to perform a 1-way ANOVA test to compare 3 groups such as I get group1 VS group2, group1 VS group3, group2 VS group3.
My "groups" are 100x3 matrices in which each column conrespond to a coordinates (x,y,z).
My question is, should I perform the ANOVA for each coordinate such as I get a comparison between the x axis of each group, then the y and so on?
Or do you have any other suggestion?
Thanks!

采纳的回答

Jeff Miller
Jeff Miller 2021-3-3
manova might be a better approach, since it allows you to combine information from all three variables (x,y,z) into a single test of group equality.
  2 个评论
Elisa Iovene
Elisa Iovene 2021-3-4
So, let's say that I have 2 group to compare: TR1 and TR2. Both of them are 100x3 matrices where the first column contains x data, the second column contains y data and the third contains z data.
To perform a manova as you suggested, I should first fit a repeated mesures model:
% 1way ANOVA test set-up1 VS set-up2 on TR
t = table(TR1(:,1),TR1(:,2),TR1(:,3),TR2(:,1),TR2(:,2),TR2(:,3),...
'VariableNames',{'TR1_X','TR1_Y','TR1_Z','TR2_X','TR2_Y','TR2_Z'});
TR = table([1 2 3 4 5 6]','VariableNames',{'Measurements'});
and then:
rm = fitrm(t,'TR1_X-TR2_Z~1','WithinDesign',TR);
manovatbl = manova(rm);
But doing so I think all the variables are analysed together instead of x data of TR1 with x data of TR2. Am I right?
Jeff Miller
Jeff Miller 2021-3-5
No, that doesn't really look right to me. At least as I understand your design, you want something like this:
X = [tr1; tr2];
Group = [ones(size(tr1,1),1); 2*ones(size(tr2,1),1)];
[d,p,stats] = manova1(X,Group)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by