Within- & between-subjects in 'anovan'
조회 수: 27 (최근 30일)
이전 댓글 표시
In the anovan function, there seems to be no way of specifying whether the data is dependent across one of the factors, i.e. whether each of these factors is a within- or a between-subjects factor. It is of course essential to know whether different levels of a factor implies values obtained from the same subject ("within-subjects" factor), or from different subjects ("between subjects factor"). The lack of even the terms within- & between-subjects in the entire documentation of this function seems very strange, since this distinction is made in most stats textbooks.
Also, if a significant interaction is reported by this analysis, how does one then use the same anovan function (or a different one in Matlab) to decompose the interaction and make comparisons, for each level of one factor, between the levels of the remaining factor?
Finally, how can I obtain measures of effect size corresponding to a certain comparison, such as omnibus contrast between all levels of a factor, or a pairwise contrast between two specific levels?
Thanks for any help!
댓글 수: 0
채택된 답변
Jeff Miller
2019년 11월 17일
I also found the lack of between/within terminology a bit daunting. With respect to your first question, here is an example that might help with the mapping between the between/within format and the anovan format:
%A: Between-subjects factor 'Age' with 2 levels
%B: Within-subjects factor 'Drug' with 2 levels
% Here are the data in the four conditions,
% with three Ss tested in each condition.
A1B1=[73 81 86];
A1B2=[59 67 60];
A2B1=[61 60 59];
A2B2=[63 50 61];
Y=[A1B1 A1B2 A2B1 A2B2];
B=[1 1 1 ...
2 2 2 ...
1 1 1 ...
2 2 2];
A=[1 1 1 ...
1 1 1 ...
2 2 2 ...
2 2 2];
S=[1 2 3 ...
1 2 3 ...
4 5 6 ...
4 5 6];
nesting=[0 0 0; ... % This line indicates that factor A is not nested in any other factor.
0 0 0; ... % This line indicates that factor B is not nested in any other factor.
1 0 0]; % This line indicates that S (the third factor) is nested under A
% (the 1 in position 1 on the line indicates nesting under the first factor).
[p table stats]=anovan(Y,{A B S},...
'model',2,...
'random',3,...
'nested',nesting,...
'varnames',{'Age', 'Drug', 'Subj'});
Don't know the answers to the rest of your questions--sorry--but I hope this helps you get started.
댓글 수: 3
Raymond MacNeil
2020년 4월 14일
This is a fantastic example on how to perform a mixed–design ANOVA. Also, a good demo on using terms matrices to sepcify the model. Thanks!
Eric T
2022년 8월 18일
This may be the most helpful example I have seen, inside or outside the documentation, on handling anovan with a complex dataset. Thanks a lot!
추가 답변 (1개)
the cyclist
2019년 11월 15일
This documentation page seems to be a pretty exhaustive description of how one can specify the test.
댓글 수: 2
Raymond MacNeil
2020년 4월 14일
Agreed. Jeff's example, nevertheless, is an excellent supplement to the documentation.
참고 항목
카테고리
Help Center 및 File Exchange에서 ANOVA에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!