Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Sums of Squares
(SS)
Between
SS b
nj (X .j
Within
SS w
( X ij
Total
SS total
( X ij
Degrees of
Freedom
(df)
Mean Squares
(MS)
X .. ) 2
k-1
s b2
MS b
SS b
k 1
X . j )2
N-k
s w2
MS w
SS w
N k
X .. ) 2
F
F
MS b
MS w
N-1
25
20
30
25
30
15
20
25
20
20
1
STAT3010: Lecture 5
x1
s12
29
0.025
x2
s22
25
0.005
x3
s32
20
0.025
s1 0.158
s2
0.071
s3
0.158
To test whether the true mean times to relief under the three
different drugs are equal, we use a five step procedure:
1. Set up the hypothesis.
STAT3010: Lecture 5
Sums of Squares
(SS)
Degrees of
Freedom
(df)
Mean Squares
(MS)
Between
Within
Total
4. Decision Rule.
5. Conclusion.
STAT3010: Lecture 5
A
30
A
35
A
40
A
25
A
35
B
25
B
20
B
30
B
25
B
30
C
15
C
20
C
25
C
20
C
20
run;
proc print;
run;
proc anova;
class trt;
model time=trt;
run;
SAS OUTPUT:
The SAS System
Obs
1
2
3
4
5
trt
time
A
A
A
A
A
30
35
40
25
35
STAT3010: Lecture 5
6
7
8
9
10
11
12
13
14
15
B
B
B
B
B
C
C
C
C
C
25
20
30
25
30
15
20
25
20
20
15
15
R-Square
0.628713
Source
trt
DF
2
12
14
Sum of
Squares
423.3333333
250.0000000
673.3333333
Coeff Var
17.33299
DF
2
Mean Square
211.6666667
20.8333333
Root MSE
4.564355
Anova SS
423.3333333
F Value
10.16
Pr > F
0.0026
time Mean
26.33333
Mean Square
211.6666667
F Value
10.16
Pr > F
0.0026
STAT3010: Lecture 5
the sample sizes are unequal or equal. Since the sample sizes
are equal in example 9.3, we used the ANOVA procedure.
Example 9.5: Testing Difference in Mean Weight Gain Among 4
Different Diets
A study is developed to examine the effects of vitamin and milk
supplements on infant weight gain. Four diet plans are
considered: Diet A involves a regular diet plus the vitamin
supplement Diet B involves a regular diet plus the special milk
formula, Diet C is our control diet (no restrictions) and Diet D
involves a regular diet plus the vitamin and the special milk
formula. Twenty infants are selected for the investigation and
each is randomized to one of the four competing diet
programs. The following table displays weight gains, measured
in pounds, after 1 month on the assigned diet:
Diet A
Diet B
2.0
1.6
1.5
1.9
2.4
2.1
1.9
1.1
2.6
1.7
1.) Set up the hypothesis.
Diet C
1.5
2.0
1.8
1.3
1.2
Diet D
2.1
2.4
1.9
1.8
2.2
STAT3010: Lecture 5
A
2.6
B
1.6
B
1.9
B
2.1
B
1.1
B
1.7
C
1.5
C
2.0
C
1.8
C
1.3
C
1.2
D
2.1
D
2.4
D
1.9
D
1.8
D
2.2
run;
proc print;
run;
proc glm;
class diet;
model gain=diet;
run;
SAS OUTPUT:
STAT3010: Lecture 5
18
19
20
D
D
D
1.9
1.8
2.2
Levels
4
Values
A B C D
20
20
DF
3
16
19
Sum of
Squares
1.09400000
1.99600000
3.09000000
Coeff Var
19.09187
Mean Square
0.36466667
0.12475000
Root MSE
0.353200
F Value
2.92
Pr > F
0.0659
gain Mean
1.850000
Source
diet
DF
3
Type I SS
1.09400000
Mean Square
0.36466667
F Value
2.92
Pr > F
0.0659
Source
diet
DF
3
Type III SS
1.09400000
Mean Square
0.36466667
F Value
2.92
Pr > F
0.0659
Decision:
Conclusion:
STAT3010: Lecture 5
STAT3010: Lecture 5
10
STAT3010: Lecture 5
11
STAT3010: Lecture 5
12
STAT3010: Lecture 5
3. Decision Rule:
Sums of Squares
(SS)
Degrees of
Freedom
(df)
Mean Squares
(MS)
Between
423.329
211.66
Within
250
12
20.833
Total
673.329
14
F
10.1598
STAT3010: Lecture 5
n3
n1 5
n2
x1 33
s1 5.7
x 2 26
s2 4.2
2. Test Statistic:
3. Decision:
4. Conclusion:
14
x 3 20
s3 3.5
STAT3010: Lecture 5
2. Test Statistic:
3. Decision:
4. Conclusion:
2. Test Statistic:
3. Decision:
4. Conclusion:
15