Repeated Measures ANOVA

AIM: To compare more than two related sample means


Repeated Measures ANOVA is applied to compare more than two dependent (related) sample means. For example, a test is applied on 20 individuals for three different times, one: before a training session; two immediately after the training session and three: one month after the training. The mean scores of 20 participants at these different times are to be compared to test whether there is any significant change in the test score. If there were only two means (pre and post), then paired t test would have been the appropriate test. But here we have to compare three means with each other. In this situation, "Repeated Measures ANOVA" is the appropriate test of significance.
In this example, the dependent variable is the test score and independent variable is the time having three different levels or categories (pre, post and one month).

Assumptions
1. Dependent variable is continuous and normally distributed at all levels (times / conditions).
2. Samples are drawn using random sampling technique.
3. The observations are dependent and recorded from the same subject at different times / under different conditions.
4. The variance across different levels of independent group is same. It is referred as "sphericity". It can be tested by Mauchly's test of sphericity.
5. There are no outliers.
6. There is one independent variable, which is usually time or a condition, with more than two possible levels / categories.

Steps:

1. Null hypothesis and Alternate Hypothesis

Null Hypothesis

A. All the sample means, at different times / conditions, are equal. (μi = μj)

 Alternate Hypothesis

A. There are at least two means (at least a pair of means), which are different than each other. (μi ≠ μj)

Where μi and μj can be any two sample means.

2. Calculate Sum of Squares for Time   (SS Between)

ANOVA SS Treatment

where n is the sample size (Number of participants)
x̄ = Grand mean (Mean of all the observations)
i = Mean of observations at time / condition i.

3. Calculate Sum of Squares Subjects (SS Subjects)

ANOVA SS Within

x̄ = Grand mean (Mean of all the observations)
xj = Mean of all observations for subject j

4. Calculate Sum of Squares Total(SS total)

ANOVA total

x̄ = Grand mean (Mean of all the observations)
xij = Observation at time i for subject j

5. Calculate Sum of Squares Error (SS Error)

SSError = SSTotal - SSBetween - SSSubjects

4. Calculate Mean Sum of Squares Between (SS Time)

MSSBetween = SSBetween / df_N

5. Calculate Mean Sum of Squares for Error (SS Error)

MSSError = SSError / df_D

df_N = Degrees of freedom for Numerator = k - 1
df_D = Degrees of freedom for Denominator = (k-1)*(n-1)
n = Sample Size, k = Number of times / Conditions

5. Calculate F value

F ANOVA

6. Calculate p value, using F table

7. Interpret

If, p < = alpha, then reject the Null hypothesis
If, p > alpha, then accept null hypthesis

8. Post hoc tests

If, p < = alpha, alternate hypothesis is accepted (at least two means are significantly different)
Which pair (or pairs) of means are significantly different is now identified by post hoc tests.
There are multiple post hoc tests available, out of which Benferroni is most commonly used.

8. A. Benferroni

Multiple tests can increase the type I error rate. For example if n simulteneous t tests are used for an alpha of 0.05 for each test, then total alpha will be 1 - (1 - alpha)n.
So, if there are three means to be compared in ANOVA, we need to apply three different t tests. So total resultant alpha will be 1 -(1-0.05)3 = 0.142625, much more than intended 0.05.
Hence, an adjustment is done by applying t test for each pair with adjusted alpha of alpha / (total no. of tests applied).
{Alternately, the p value can be adjusted (Bonferroni adjusted p) by multiplying the p value got during each t test with total no. of tests to be applied.}
In Benferroni post hoc test, for each pair of means t statistics is calculated as follows.

Bonferroni ANOVA

The resultant p value is to be multiplied by no. of tests (No. of pairs), to get Bonferroni adjusted p value. If Bonferroni adjusted p value is less than the intended alpha, then the means in the pairs are significantly different.

Where, dj = difference between observations in the pair for subject j
ƌ = mean difference

If there are n groups, then total no. of tests (No. of pairs) will be n * (n - 1) / 2.

Confidence intervals for Bonferroni post hoc test

Critical t value is calculated using df = n-1 and adjusted alpha (original alpha / no. of tests)

LB of CI = ƌ - (critical t) * SE

UB of CI = ƌ + (critical t) * SE

 


 


@ Sachin Mumbare