Chapter 14
Repeated Measures ANOVA
All the ANOVA stuff we have done so far has had different subjects in the various cells of the experimental design
That kind of experiment is called a between-subjects design
Sometimes, however, we run the same subjects in some or all cells of the design
Such a within-subjects (or repeated measures) design has two advantages:
Memories of the ANOVA logic
Recall that the purpose of doing an ANOVA is to see if some difference between treatment means is sufficiently large is to be unlikely to occur by chance (less than 5% chance)
When we test that … we get an estimate of the difference we are interested in, and divide it by an estimate of variation due to chance
Specifically:
![]()
Notice that this F value will increase if the difference between the means is large OR if the measurement of error is small
As you will see, repeated-measures designs allow us to reduce the error term, thereby resulting in larger Fs (more power)
An example: Within versus Between
This experiment will show the importance of the "articulatory loop" for retaining information in short-term memory
Between-Subjects Version
|
Subject |
bla-bla |
Subject |
no bla-bla |
1 2 3 4 5 |
X X2 5 25 4 16 6 36 4 16 7 49 |
1 2 3 4 5 |
X X2 7 49 6 36 5 25 6 36 6 36 |
Within-Subject Version
|
Subject |
bla-bla |
no bla-bla |
1 2 3 4 5 |
X X2 5 25 3 9 7 49 2 4 3 9 |
X X2 7 49 4 16 7 49 4 16 5 25 |
Computations for Between-Subject
![]()
![]()
![]()
![]()
![]()
How is the within-subjects version different from the between-subjects version?
An assumption of the between-subjects ANOVA is that the observations in one level of the treatment are independent of those in the other level(s)
Hopefully you will notice that this assumption does not hold in our within-subjects version of the experiment
The use of the same subject in more than one level of the treatment almost always builds in a dependency because subjects who do well in one level tend to also do well in the other(s)
Can we remove this dependency? In fact we can, and when we do, there is a bonus! (the kind of thing that makes statistics geeks real happy J )
Getting Rid of the Variability Due to Subjects
The "dependency in observations" is due to some subjects doing better than others
What we are going to do to deal with this is to literally remove the variation due to subjects from the error term
For demonstration purposes only .. you can think of this as subtracting each subjects mean from all the scores they contribute
Using the data from out class:
|
Subject |
bla-bla |
no bla-bla |
1 2 3 4 5 |
X X¢ 5 -1 3 -.5 7 0 2 -1 3 -1 |
X X¢ 7 +1 4 +.5 7 0 4 +1 5 +1 |
Where ![]()
Within-Subjects Computations
Another way of doing what is essentially the same thing is to remove the sum of squares due to subjects from the error term.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Source Tables
Between-Subjects
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Within-Subjects
|
|
|
|
|
|
|
|
|
|||
|
|
|
|||
|
|
|
|
|
|
|
|
|
The Advantage of Within-Subject Designs
Remember, F values are increased if the difference of interest in larger OR if the measure of variance (MSerror) gets smaller
While removing the sum of squares due to subjects does make the observations independent across levels of the treatment variable, it OFTEN reduces the MSerror, thereby resulting in increased power (larger F values)
This only occurs though if the reduction in MSerror is more than compensates for the loss in dferror .. so it is not always true
Note that you cannot remove the variance (sum of squares) due to subjects when using a between subjects design because you only have one observation per subject … thus the variance due to subjects must remain as part of the error term
Moral: Usually, it is better to use within-subject (repeated measures) designs … not only do they let you use less subjects, but they are also more powerful, statistically speaking
Assumption of Compound Symmetry
Remember when we did between-subject ANOVAs, one of the assumptions was that the variance in our various treatment groups were homogenous (i.e., roughly equivelant)
A similar but slightly more complex assumption underlies repeated measures designs
Specifically, we need to satisfy the "compound symmetry" assumption which is that in addition to the variances being equal, the covariances between pairs of variables are also equal
For this to make sense, I think we may have to do a B07 time travel to re-introduce the notion of covariance ….
Imagine any two variables such as …
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sum (XY) = 99064
The covariance of these variables is computed as:

But what does it mean?
The covariance formula should look familiar to you. If all the Ys were exchanged for Xs, the covariance formula would be the variance formula
Note what this formula is doing, however, it is capturing the degree to which pairs of points systematically vary around their respective means
If paired X and Y values tend to both be above or below their means at the same time, this will lead to a high positive covariance
However, if the paired X and Y values tend to be on opposite sides of their respective means, this will lead to a high negative covariance
If there is no systematic tendencies of the sort mentioned above, the covariance will tend towards zero
The Computational Formula for Cov
Given its similarity to the variance formula, it shouldn’t surprise you that there is also a computationally more workable version of the covariance formula:

For our height versus weight example then:

Back to Compound Symmetry
OK, now let’s assume we ran a repeated measures study in which we were looking at practice effects on some task over 3 days
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

The Covariance (Variance/Covariance) Matrix
These variances and covariances are often presented in a matrix such as the following:


So, the assumption of compound symmetry is simply that the variances must all be approximately equal and the covariances must all be approximately equal
The variances need not (and often do not) equal the variances though
Complicating it all
So far in this chapter, we have been dealing with only one variable that has been manipulated in a within-subject manner
However, as we saw in Chapter 13, studies usually manipulate more than one variable which raises several possibilities
2 variables
3 variables
Computationally, we will only focus on the 2 new "2 variable" situations
However, as was the case with 3 between subject variables, I will expect you to be able to interpret 3 variable results … we will spend time doing this as well
One Between - One Within
Imagine the following study (raw data is presented in the text, pp. 459)
Similar to Siegel’s morphine tolerance study, King (1986) was interested in conditioned tolerance to another drug … midazolam
The Data, Steve Style
|
1 |
2 |
3 |
4 |
5 |
6 |
SS |
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
93 |
97 |
129 |
123 |
130 |
1127218 |
131 |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
266 |
221 |
170 |
199 |
179 |
3063297 |
232 |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
98 |
109 |
109 |
124 |
139 |
1355576 |
145 |
|||
|
286 |
153 |
142 |
136 |
148 |
149 |
Grand |
169 |
The Dreaded Computations
Just like when we had two between-subject variables, there are three effects of interest in the current experiment:
However, recall that we can (an do) use a different error term when testing within-subject effects than when testing between subject effects
SStotal (by the way) = 1432293
So, the first thing we must do is to decide which effects are purely between-subjects, and which have a within-subject component
For this study, Group was manipulated between-subjects, but both Interval and the Group x Interval interaction have a between subjects component (i.e., Interval)
OK, now we separately deal with our between and within-subject effects
Between-Subject Effects
We treat between subject effects like we always have. We calculate SStreat as the sum of squares of the treatment means times the relevant n, and we calculate SSerror as the sum of the variance of subjects within the group


Within-Subject Effects
OK, for starters, the sums of squares for the Interval and interaction effects are calculated like we did in the 2 between-subject case


The Within-Subject Error Term
Remember than when we are dealing with within subject effects, we use a different error term (one that does not include the variability due to subject by subject variation)
Given the computations we have done so far, we can get the rest by subtraction …
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2obtained by subtracting SSbetween from SStotal
3obtained by subtracting SSinterval and SSgrp * int from SSwithin
4obtained by subtracting dfgroup, dfss/group, dfinterval and dfgrp * int from dftotal
Critical F’s:
F(2,21) = 3.49 F(5,105) = 2.37 F(10,105) = 1.99
Conclusions from the Anova
Main Effect of Group
We can reject the null hypothesis that there was no effect of group. The F-obtained for the main effect of group was greater than the critical F suggesting the there are differences among the three group means. From looking at the means it appears that this is mostly due to the mean for the "Same" group being much higher than the other two means.
![]()
Main Effect of Interval
We can also reject the null hypothesis that there was no effect of interval. The F-obtained for the main effect of interval was greater than the critical F suggesting that there are differences among the six interval means. From the means, it appears as though activity was very high in the first interval, then dropped of and stayed relatively constant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Interaction of Group * Interval
Finally, we can also reject the null hypothesis that the effect of interval was the same for the three groups. The F-obtained for the interaction was greater than the critical F suggesting that the effect of interval is different for the three groups. From the means, it appears as though the "Same" group stayed active longer (across more of the early intervals) than the other groups.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

*** Chapter 13 Flashback***
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*** Chapter 13 Flashback***
Simple Effects for the effect of time at each level of group.

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
So, we could describe the interaction by saying that fear increased over time for phobics, but fear did not change at all over time for the controls
*** Chapter 13 Flashback***
Simple Effects
As was the case when we had two between subject variables, we will often want to do simple-effects analyses to gain a better understanding of the interaction
Recall that there are two ways we could approach these analyses, we could ask
Here it makes sense to look at the interaction and consider the experimental predictions to determine which of these approaches is likely to yield the information you want
Since the predictions are focused primarily on potential differences between groups (or lack of differences), the first approach is the one we would want to take in this case
Nonetheless, we will briefly consider both situations
Simple Effects for Within-Subject Variables
We had decided that in our situations we were not interested in looking at the effect of interval separately for each group
But, if we had been, then we would have been examining the effect of a within-subject variable (interval)
For reasons that are not important, whenever you are doing simple-effects that are focused on the effect of a within-subject variable, you cannot use some general error term (like, for example SSs/grp * int)
Instead, what you do is a separate one-way, repeated measures analysis of variance for each simple effect
So, for example, if you were interested in the effect of interval for the control group, you would run a complete repeated measures ANOVA examining the interval variable but using only the data from the control group
Simple Effects for Between-Subject Variables
Step 1: Computing sums of squares for the effect of group at each interval

Step 2: Mean Squareds for the group effects at each interval
Since there are three groups at each interval, there are 2 degrees of freedom for each contrast
MS = SS/df, so …
OK, here is where we differ from the Chapter 13 way of doing things
The appropriate error term SS is the SSSs/Cell
We could calculate that by hand but it would take a lot of work
In the "trust me" category, I give you the following:
SSSs/Cell = SSSs/Group + SSSs/Grp X Int, and
dfSs/Cell = dfSs/Group + dfSs/Grp X Int
So, for our example …
SSSs/Cell = SSSs/Group + SSSs/Grp X Int
= 384726 + 281199 = 665925
dfSs/Cell = dfSs/Group + dfSs/Grp X Int
= 21 + 105 = 126
MSSs/Cell = SSSs/Cell / dfSs/Cell
= 665925 / 126 = 5285.12
Step 4: Source table depicting results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fcrit(2,126) = 3.07