Repeated-measures ANOVA

Repeated-measures
ANOVA
Chapter 10
Vitamin C




Study: Year 1 = # of cold symptoms, Year 2 = # cold
symptoms with treatment
Factor: Group
 Placebo
 Low dose of Vitamin C
 High dose of Vitamin C
Dependent variable: Difference in cold symptoms
from year 1 to year 2
Hypotheses
Boxplot of Vitamin C data
20
1
10
3
0
DIFF
-10
-20
N=
10
10
10
placebo
low
hi
Vitamin C Treatment
Vitamin C: Data
X2
Report
Report
DIFF
DIFF2
Vitamin C Treatment
placebo
low
hi
Total
Mean
3.50
-2.10
-2.00
-.20
N
10
10
10
30
Std. Deviation
4.143
4.067
5.477
5.182
Sum
35
-21
-20
-6
T1=
T2=
T3=
SS1=
SS2=
SS3=
n1=
n2=
n3=
N=
M1=
M2=
M3=
k=
G=
x2=
Vitamin C Treatment
placebo
low
hi
Total
Mean
27.7000
19.3000
31.0000
26.0000
N
10
10
10
30
Std. Deviation
47.32406
24.23977
12.75408
30.87014
Sum
277.00
193.00
310.00
780.00
Vitamin C: Data
Report
Report
DIFF
DIFF2
Vitamin C Treatment
placebo
low
hi
Total
Mean
3.50
-2.10
-2.00
-.20
N
10
10
10
30
Std. Deviation
4.143
4.067
5.477
5.182
Sum
35
-21
-20
-6
T1= 35
T2= -21 T3= -20 G= -6
SS1=
SS2=
SS3=
x2=
n1= 10
n2= 10
n3= 10
N= 30
M1=
3.5
M2=
-2.1
M3=
-2.0
k= 3
Vitamin C Treatment
placebo
low
hi
Total
Mean
27.7000
19.3000
31.0000
26.0000
N
10
10
10
30
Std. Deviation
47.32406
24.23977
12.75408
30.87014
Sum
277.00
193.00
310.00
780.00
Vitamin C: Data
Report
Report
DIFF
Vitamin C Treatment
placebo
low
hi
Total
DIFF2
Mean
3.50
-2.10
-2.00
-.20
N
10
10
10
30
Std. Deviation
4.143
4.067
5.477
5.182
Sum
35
-21
-20
-6
T1= 35
T2= -21
T3= -20
G = -6
SS1=
154.5
SS2=
148.9
SS3=
270
x2=
780
n1= 10
n2= 10
n3= 10
N= 30
M1= 3.5
M2= -2.1 M3= -2.0 k= 3
Vitamin C Treatment
placebo
low
hi
Total
SS
X2
Mean
27.7000
19.3000
31.0000
26.0000
( X )2
N
N
10
10
10
30
Std. Deviation
47.32406
24.23977
12.75408
30.87014
Sum
277.00
193.00
310.00
780.00
(35) 2
10
SS
277
SS
( 21) 2
193
10
SS
( 20) 2
10
310
Vitamin C: Data
T1= 35
T2= -21
T3= -20
G = -6
SS1= 154.5
SS2= 148.9
SS3= 270
n1= 10
n2= 10
n3= 10
N= 30
M1= 3.5
M2= -2.1
M3= -2.0
k= 3
x2= 780
Total SS:
SS
X2
G2
N
SS
780
( 6) 2
30
778.8
SS: 154.5 + 148.9 + 270 = 573.4
Within SS:
Between SS:
SS between
T
n
2
2
G
N
SS between
35
10
2
21
10
2
20
10
2
62
30
205.4
Vitamin C: Data
T1= 35
T2= -21
T3= -20
G = -6
n1= 10
n2= 10
n3= 10
N= 30
M1= 3.5
M2= -2.1
M3= -2.0
k= 3
MS between
SS between
df between
MS within
SS within
df within
MS between
MS within
205.4
2
573.4
27
dfbetween = k – 1
x2= 780
SS1= 154.5 SS2= 148.9 SS3= 270
102.7
21.237
dfwithin = N - k
F
F
MS between
MS within
102.7
21.237
Critical F @ .05 = 3.35, @ .01 = 5.49
4.836
ANOVA summary table
SPSS v. Write-up
ONEWAY ANOVA
DIFF
Between Groups
Within Groups
Total
Source
Between
Sum of
Squares
205.400
573.400
778.800
df
2
27
29
Mean Square
102.700
21.237
df
SS
Within
2
27
205.4
573.4
Total
30
778.8
* Significant at the .02 level
F
4.836
Significance
.016
MS
102.7
21.2
F
4.84*
Vitamin C: Conclusions


A one-way ANOVA was conducted to
examine the hypothesis that different types of
vitamin C treatment have a differential effect
on cold symptoms compared to prior years
without the treatment.
It was found that the number of colds were
significantly different for the placebo (M =
3.5), low dose (M = -2.1), and high dose (M =
-2.0) groups, F(2, 27) = 4.8, p < .05.
Post Hoc Tests




Significant ANOVA – there is at least 1 mean that is
different
Post-tests examine which means are and are not
significantly different
Compare 2 means at a time (pair-wise comparisons)
Type I error: divide alpha among all tests need to do




Planned comparisons: based on predictions
Tukey’s HSD
Scheffe test (numerator is for MSbetween for only the two
treatments you want to compare)
Bonferroni
Zettergren (2003)



School adjustment in adolescence for previously
rejected, average, and popular children.
Effect of peer reputation on academic performance
and school adjustment
IV or Factor = Peer reputation




3 levels: rejected, average, popular (based on…)
3rd and 4th grade students ranked every classmate (same
gender) in the order they wanted them to stay with the
class if they were to move to a smaller room and not
everyone could go
DV = Academic ability (8th grade)
DV = Attitudes toward school (8th grade)
Zettergren (2003) results
Self-esteem study:
Self-Esteem Descriptor (SED) at 5, 7, 9, 11, 13
160
140
3
3
120
3
11
11
100
80
5
11
5
12
8
6
60
40
20
0
-20
N=
25
25
Self-esteem at age 5
25
25
Self-esteem at age 9
Self esteem at age 7
25
Self-esteem at age 1
Self-esteem at age 1
Self-esteem: Between subject
ONEWAY Descriptives
SED
N
1.00
2.00
3.00
4.00
5.00
Total
25
25
25
25
25
125
Mean
33.8800
27.6000
29.6000
29.9600
16.0800
27.4240
Std. Deviation
27.91702
35.35180
31.49206
34.86340
16.95071
30.20181
Std. Error
5.58340
7.07036
6.29841
6.97268
3.39014
2.70133
95% Confidence Interval for
Mean
Lower Bound Upper Bound
22.3564
45.4036
13.0075
42.1925
16.6007
42.5993
15.5691
44.3509
9.0831
23.0769
22.0773
32.7707
Minimum
2.00
1.00
3.00
1.00
1.00
1.00
ONEWAY ANOVA
SED
Between Groups
Within Groups
Total
Sum of
Squares
4539.088
108567.4
113106.5
df
4
120
124
Mean Square
1134.772
904.729
F
1.254
Significance
.292
Maximum
106.00
138.00
127.00
125.00
66.00
138.00
Self-esteem: Within subject
Descriptive Statistics
Self-es teem at age 5
Self es teem at age 7
Self-es teem at age 9
Self-es teem at age 11
Self-es teem at age 13
Mean
33.88
27.60
29.60
29.96
16.08
Std. Deviation
27.917
35.352
31.492
34.863
16.951
N
25
25
25
25
25
Tests of Within-Subjects Effects
Measure: MEASURE_1
Source
AGE
Error(AGE)
Sphericity Ass umed
Greenhous e-Geis ser
Huynh-Feldt
Lower-bound
Sphericity Ass umed
Greenhous e-Geis ser
Huynh-Feldt
Lower-bound
Type III Sum
of Squares
4539.088
4539.088
4539.088
4539.088
22834.512
22834.512
22834.512
22834.512
df
4
2.989
3.461
1.000
96
71.727
83.058
24.000
Mean Square
1134.772
1518.796
1311.589
4539.088
237.859
318.355
274.922
951.438
F
4.771
4.771
4.771
4.771
Sig.
.001
.004
.003
.039
Self-esteem: Planned contrasts
Paired Samples Statistics
Pair
1
Pair
2
Pair
3
Pair
4
Self-esteem at age 5
Self es teem at age 7
Self-esteem at age 5
Self-esteem at age 9
Self-esteem at age 5
Self-esteem at age 11
Self-esteem at age 5
Self-esteem at age 13
Mean
33.88
27.60
33.88
29.60
33.88
29.96
33.88
16.08
N
Std. Deviation
27.917
35.352
27.917
31.492
27.917
34.863
27.917
16.951
25
25
25
25
25
25
25
25
Std. Error
Mean
5.583
7.070
5.583
6.298
5.583
6.973
5.583
3.390
Paired Samples Test
Paired Differences
Std. Deviation
Std. Error
Mean
6.28
18.311
3.662
-1.28
13.84
1.715
24
.099
4.28
22.868
4.574
-5.16
13.72
.936
24
.359
3.92
22.546
4.509
-5.39
13.23
.869
24
.393
17.80
20.738
4.148
9.24
26.36
4.292
24
.000
Mean
Pair
1
Pair
2
Pair
3
Pair
4
Self-esteem at age 5 Self esteem at age 7
Self-esteem at age 5 Self-esteem at age 9
Self-esteem at age 5 Self-esteem at age 11
Self-esteem at age 5 Self-esteem at age 13
95% Confidence
Interval of the
Difference
Lower
Upper
t
df
Sig. (2-tailed)
Self-esteem write-up
Within-subject design


A longitudinal study was conducted on self-esteem. A repeatedmeasures ANOVA was conducted over five time periods; five years
old (M = 33.88, SD = 27.92), seven years old (M = 27.60, SD =
35.35), nine years old (M = 29.60, SD = 31.49), 11 years old (M =
29.96, SD = 34.86), and 13 years old (M = 16.08, SD = 16.95). A
significant effect of age was found, F (4, 96) = 4.77, p = .001.
Post-hoc tests were performed comparing the youngest age (five
years old) with each of the other ages (7, 9, 11, and 13 years). One
significant result was found. Self-esteem at age five (M = 33.88, SD
= 27.92) was significantly different compared to self-esteem at age
13 (M = 16.08, SD = 16.95), t(24) = 4.29, p < .001. This suggests
that self-esteem remains stable from age five until age 11, and then
declines at age 13.
ANOVA: Partitions the Variance
Total Variance
Between Treatment Variance
Within Treatment Variance
1. Treatment effects
Chance
2. Chance
Between variance
F = ---------------------Within variance
Repeated-measures ANOVA
3
2
1
0
5
10
rating
15
One-way v. Repeated ANOVA
F

treatment effect chance/err or
chance/err or
One-way ANOVA chance/error =



Between subject individual differences
 For overall sample
 For each group
Within subject experimental error
Repeated ANOVA chance/error=



F
MS between
MS error
Between subject sampling error (only for overall sample)
Within subject experimental error
Advantage to remove individual differences that
can mask effect
Repeated-measures ANOVA

One-way or independent-measures ANOVA
w/o individual differences error
F
treatment effect chance/err or
chance/err or
F

MS between
MS error
Advantage: remove individual differences that
can mask treatment effect
Structure of data sets
One-way v. Repeated ANOVA
Group
Data
1
52
Ss
Test1
Test2
Test3
1
67
1
52
59
52
1
33
2
59
2
67
42
49
2
42
3
33
56
53
2
56
3
52
3
49
3
53
Pain Relief
The effect of drug treatment on the amount of
time (in seconds) a stimulus is endured.
Pain relief by subject
8
7
6
5
4
3
2
1
0
Placebo
DrugA
DrugB
DrugC
MSerror
The partitioning of degrees of freedom
for a repeated-measures experiment
Compute df
For N = 20; k = 4; n = 5

dftotal = N – 1


dfbetween = k – 1


20 – 4 = 16
dfbetween subjects = n – 1


4–1=3
dfwithin = N – k


20 – 1 = 19
5–1=4
dferror = dfwithin – dfbetween subjects

= 16 – 4 = 12
The partitioning of sum of squares (SS) for
a repeated-measures analysis of variance
Calculate MS and F-ratio
MS between
MS error
F


SS between
df between
MS between
SS error
df error
MS error
MS between
MS error
F
50
3
8
12
16.67
0.67
16.67
0.67
24.88
Critical F @ .05 = 3.49, @ .01 = 5.95
F (3, 12) = 24.88, p < .01
ANOVA summary table: Repeated-measures
Significant at p < .01
50
3
32
16
24
4
8
12
82
19
16.67
0.67
24.88*