Hello MATLAB experts,
Recently, I am trying to conduct two-way mixed ANOVA using MATLAB2020a. Before using the code, I would like to confirm with you whether my code is correct. Also, I have several questions.
Two groups ('A', 'B') and each (independent) subject of each group conducted twice experiment repeatedly with a week interval. So, I denoted as the Pre and Post ("sessions").
dataTable =[];
dataX = [rand(14,2) [zeros(7,1); ones(7,1)]];
dataTable = array2table(dataX);
dataTable.Properties.VariableNames = {'Pre','Post','Group'};
dataTable.Group = categorical(dataTable.Group);
wsVariable = table([0 1]','VariableNames',{'Session'});
rm = fitrm(dataTable,'Pre,Post~Group','WithinDesign',wsVariable);
ranovatbl = ranova(rm);
multcompare(rm,'Session')
anovatbl = anova(rm);
multcompare(rm,'Group')
I would like to conduct the multiple comparison (1) between pre and post in each group, (2) between groups given each session, and (3) of interaction.
For instance, groupA: pre vs. post, groupB: pre vs. post, Pre: groupA vs. groupB, Post: groupA vs. groupB and so on.
However, this code doesn't work what I wanted.
In addition, there are any ways to conduct non-parametric 2 x 2 mixed ANOVA using the dataset??
It would be very appreciated if you let me know how to fix this.
Many thanks