Within- & between-subjects in 'anovan'

24 次查看(过去 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!

采纳的回答

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