Within- & between-subjects in 'anovan'

39 ビュー (過去 30 日間)
z8080
z8080 2019 年 11 月 15 日
コメント済み: Eric T 2022 年 8 月 18 日
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!

採用された回答

Jeff Miller
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
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
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
the cyclist 2019 年 11 月 15 日
This documentation page seems to be a pretty exhaustive description of how one can specify the test.
  2 件のコメント
z8080
z8080 2019 年 11 月 16 日
Thanks, there is indeed a lot of information – as well as a lot of overlap – across those pages. However, my specific questions are still not addressed in there..
Raymond MacNeil
Raymond MacNeil 2020 年 4 月 14 日
Agreed. Jeff's example, nevertheless, is an excellent supplement to the documentation.

サインインしてコメントする。

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by