Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Time k
1
2
.
.
.
n
x11
x21
x12
x22
x1k
x2 k
xn 2
xnk
.
.
.
xn1
STAT3010: Lecture 7
Source of
Variation
Sums of Squares
(SS)
Between
SS subj k ( X s. X .. ) 2
n-1
SS b n( X . j X .. ) 2
k-1
Mean Squares
(MS)
Subjects
Between
s b2 MS b
SS b
k 1
Trtmts
Within
SS w SS total SS subj SS b
Total
SS total SS subj SS b SS w
(n-1)(k-1) s w2 MS w
nk-1
SS w
(n 1)(k 1)
MS b
MS w
STAT3010: Lecture 7
3. Decision Rule:
4. Conclusion.
Example 9.10: Repeated Measures ANOVA to Test Difference
in Mean Completion Times Among 3 Training Courses
Were comparing the cardiovascular fitness of elite runners on
three different training courses, each of which covers 10 miles.
Course 1 is flat, Course 2 has graded inclines and Course 3
includes steep inclines. Each runners heart rate is monitored at
mile 5 of the run on each course. Ten runners are involved, and
their heart rates measured on each course are shown:
Runner Number
1
2
3
4
5
6
7
8
9
10
Course 1
Course 2
132
143
135
128
141
150
131
150
142
139
135
148
138
131
141
156
134
156
145
165
Course 3
138
148
141
139
150
161
138
162
151
160
STAT3010: Lecture 7
Treatment 2
29.0
29.2
29.1
28.9
28.8
25.1
25.0
25.0
24.9
25.0
Treatment 3
20.1
20.0
19.9
19.8
20.2
132
143
135
128
141
150
131
150
142
139
135
148
138
131
141
156
134
156
145
165
Course 3
138
148
141
139
150
161
138
162
151
160
STAT3010: Lecture 7
Sums of Squares
(SS)
Degrees of
Freedom
(df)
Between
Subjects
Between
Trtmts
Within
Total
Mean Squares
(MS)
STAT3010: Lecture 7
3. Decision Rule:
4. Conclusion:
Using SAS:
SAS CODE:
options ps=62 ls=80;
data repeatedmeasurments;
input runner course1 course2 course3;
subjmean=mean(course1,course2,course3);
cards;
1
2
3
4
5
6
7
8
9
10
132
143
135
128
141
150
131
150
142
139
135
148
138
131
141
156
134
156
145
165
run;
proc print;
var course1 course2 course3 subjmean;
run;
138
148
141
139
150
161
138
162
151
160
STAT3010: Lecture 7
proc means;
var course1 course2 course3 subjmean;
run;
proc glm;
model course1 course2 course3=/nouni;
repeated course;
run;
SAS OUTPUT:
The SAS System
Obs
course1
course2
course3
subjmean
1
2
3
4
5
6
7
8
9
10
132
143
135
128
141
150
131
150
142
139
135
148
138
131
141
156
134
156
145
165
138
148
141
139
150
161
138
162
151
160
135.000
146.333
138.000
132.667
144.000
155.667
134.333
156.000
146.000
154.667
course1
10
139.1000000
7.6077446
128.0000000
150.0000000
course2
10
144.9000000
11.2195266
131.0000000
165.0000000
course3
10
148.8000000
9.6930674
138.0000000
162.0000000
subjmean
10
144.2666667
9.0769005
132.6666667
156.0000000
10
10
STAT3010: Lecture 7
course1
1
course2
2
course3
3
Statistic
Wilks' Lambda
Pillai's Trace
Hotelling-Lawley Trace
Roy's Greatest Root
0.09790213
0.90209787
9.21428275
9.21428275
Num DF
Den DF
Pr > F
2
2
2
2
8
8
8
8
<.0001
<.0001
<.0001
<.0001
36.86
36.86
36.86
36.86
DF
Type III SS
Mean Square
F Value
Pr > F
course
Error(course)
2
18
476.4666667
274.8666667
238.2333333
15.2703704
15.60
0.0001
Adj Pr > F
G - G
H - F
Source
course
Error(course)
0.0013
Greenhouse-Geisser Epsilon
Huynh-Feldt Epsilon
0.0009
0.6350
0.6922
Once a significant f-test has been obtained for a repeatedmeasures ANOVA, a post-hoc test (pairwise tests) can be done
to determine which of the means are different. Tests that are
commonly used include the least significant difference (LST)
test, modified Bonferroni t-test, and Sidak test.
STAT3010: Lecture 7
to
x1 x 2
2 MS E
n
with a critical value t-test using table B.3 with error degrees of
freedom. Note: All comparisons must be completed (similar to
the Scheffe Procedure).
Block 2
Block 3
Block 4
t2
t1
t3
t1
t3
t2
t3
t2
t1
t2
t1
t3
Block:
y11
y 21
y 31
y12
y 22
y 32
y13
y14
y 24
y 34
y 23
y 33
STAT3010: Lecture 7
1
42.5
39.8
40.2
41.3
163.8
2
39.3
40.1
40.5
42.2
162.1
3
39.6
40.5
41.3
43.5
164.9
4
39.9
42.3
43.4
44.2
169.8
5
42.9
42.5
44.9
45.9
176.2
6
43.6
43.1
45.1
42.3
174.1
Total
247.8
248.3
255.4
259.4
1010.9
SAS CODE:
options ps=62 ls=80;
data randomizedblock;
input block machine1 machine2 machine3 machine4;
blockmean=mean(machine1,machine2,machine3,machine4);
cards;
1
42.5 39.8 40.2 41.3
2
39.3 40.1 40.5 42.2
10
STAT3010: Lecture 7
3
39.6 40.5
4
39.9 42.3
5
42.9 42.5
6
43.6 43.1
run;
proc print;
var machine1
run;
proc means;
var machine1
run;
41.3
43.4
44.9
45.1
43.5
44.2
45.9
42.3
proc glm;
model machine1 machine2 machine3 machine4=/nouni;
repeated machine;
run;
SAS OUTPUT:
The SAS System
Obs
machine1
machine2
1
2
3
4
5
6
42.5
39.3
39.6
39.9
42.9
43.6
39.8
40.1
40.5
42.3
42.5
43.1
machine3
40.2
40.5
41.3
43.4
44.9
45.1
The SAS System
machine4
blockmean
41.3
42.2
43.5
44.2
45.9
42.3
40.950
40.525
41.225
42.450
44.050
43.525
machine1
6
41.3000000
1.9047310
39.3000000
43.6000000
machine2
6
41.3833333
1.4119726
39.8000000
43.1000000
machine3
6
42.5666667
2.1924112
40.2000000
45.1000000
machine4
6
43.2333333
1.6609234
41.3000000
45.9000000
blockmean
6
42.1208333
1.4506392
40.5250000
44.0500000
11
6
6
STAT3010: Lecture 7
Level of machine
M=0.5
N=0.5
Value
F Value
Num DF
Den DF
Pr > F
0.17064463
0.82935537
4.86013150
4.86013150
4.86
4.86
4.86
4.86
3
3
3
3
3
3
3
3
0.1133
0.1133
0.1133
0.1133
DF
Type III SS
Mean Square
F Value
Pr > F
machine
Error(machine)
3
15
15.92458333
23.84791667
5.30819444
1.58986111
3.34
0.0479
Source
machine
Error(machine)
Adj Pr > F
G - G
H - F
0.0820
Greenhouse-Geisser Epsilon
Huynh-Feldt Epsilon
12
0.0482
0.6283
0.9963
STAT3010: Lecture 7
14
14
16
14
14
15
14
13
15
13
13
15
13
13
13
14
13
13
14
12
13
14
12
13
12
12
STAT3010: Lecture 7
suburban
suburban
suburban
urban
urban
urban
urban
urban
urban
urban
urban
urban
urban
run;
13
12
12
16
16
15
15
15
14
14
14
13
12
proc glm;
class school;
model age=school;
run;
SAS OUTPUT:
The SAS System
The GLM Procedure
Class Level Information
Class
school
Levels
3
Values
rural suburban urban
28
28
DF
Sum of
Squares
Model
Error
Corrected Total
2
25
27
9.25357143
23.17500000
32.42857143
R-Square
Coeff Var
Mean Square
F Value
Pr > F
4.62678571
0.92700000
4.99
0.0150
Root MSE
14
age Mean
STAT3010: Lecture 7
0.285352
7.057234
0.962808
13.64286
Source
school
DF
2
Type I SS
9.25357143
Mean Square
4.62678571
F Value
4.99
Pr > F
0.0150
Source
school
DF
2
Type III SS
9.25357143
Mean Square
4.62678571
F Value
4.99
Pr > F
0.0150
15