17.4.2.4 Algorithms (Repeated Measures ANOVA)RMANOVAAlgorithm
Oneway/Twoway Repeated Measures
For the details of the algorithms for the oneway and two way balanced repeated measure design, please see Repeated Measures ANOVA.pdf
Twoway MixedDesign
Multivariate Tests
Considering the model: TwoWay Mixed Design RM ANOVA with one between subject factor A and another within subject factor B.
Let be the number of levels for factor A, be the number of levels for factor B, be the number of subjects with ith level of factor A, be observations with respect to jth subject and ith level of factor A.
Define Error matrix as:
and Hypothesis matrix as:
and Hypothesis matrix with intercept as:
where
and
And the degree of freedom can be obtained by and , respectively.
Suppose the mean vectors of factor A's levels are , and we let
Main effect of within factor B
Let the contrast matrix be
In order to test , we can compute the values of Wilks' Lambda, HotellingLawley Trace, Pillai's Trace and Roy's Largest Root. The SS&CPs are:
Notes: All sum of squares are calculated based on type III.
Interaction effect of B*A
The null hypothesis is The SS&CPs are:
Mauchly's Test of Sphericity
Let design matrix be
The residual matrix is obtained by
Let be the orthogonal matrix which can be set like
Let
Let Here
Then Mauchly's W Statistic is
The Chisquare test value is with freedom degree
Within and Between Test
Some basic calculations:
with degree freedom
 Sum Square of Between Factor A:
with degree freedom
 Sum Square of Within Factor B:
with degree freedom
Where
Tests of WithinSubjects Effects
 Sum Square of factor B for Within test
with degree freedom
 Sum Square of interaction A*B for Within test
with degree freedom
 Sum Square of error(factor B) for Within test
with degree freedom
Tests of BetweenSubjects Effects
 Sum Square of intercept for Between test
with degree freedom
 Sum Square of intercept for Between test(when set intercept = 0)
with degree freedom Here is the design matrix associated to effect A, while is a matrix representing the indexed data.
 Sum Square of between factor A for Between test
with degree freedom
 Sum Square of error(factor A) for Between test
with degree freedom
Multiple Means Comparisons
There are various methods for multiple means comparison in Origin, and we use the ocstat_dlsm_mean_comparison() function to perform means comparisons.
Two types of multiple means comparison methods:
Singlestep method. It creates simultaneous confidence intervals to show how the means differ, including TukeyKramer, Bonferroni, DunnSidak, Fisher’s LSD and Scheffé mothods.
Stepwise method. Sequentially perform the hypothesis tests, including HolmBonferroni and HolmSidak tests
