Introduction to 2

Introduction to 2-way ANOVA
Statistics
Spring 2005
Terminology
 2-Way ANOVA means
2
independent variables
 1 dependent variable
 3X4 ANOVA means
2
independent variables
 1 dependent variable
 one IV has 3 levels
 one IV has 4 levels
HYPOTHESES TESTED
in 2-WAY ANOVA
 No
differences for IV #1 (A - 3 levels)
 H0:
 No
differences for IV #2 (B - 4 levels)
 H0:
 No
MA1 = MA2 = MA3
MB1 = MB2 = MB3 = MB4
interaction
 At
least one MAiBj  MAmBn
These are
called
“Main
Effects”
EXAMPLE
 One
might suspect that level of
education and gender both have
significant impacts on salary.
Using the data found in
Census90 condensed.sav
determine if this statement is true.
Dependent Variable
Independent Variables
INCOME
GENDER (2 levels)
(ratio level data)
EDUCAT (6 levels)
 = .05
HYPOTHESES TESTED
for a 2X6 ANOVA
No differences for GENDER (2 levels)
H0: MMale = MFemale
No differences for EDUCATION (6 levels)
H0: MB1 = MB2 = MB3 = MB4 = MB5 = MB6
No interaction
At least one MAiBj  MAmBn
To run the test of these hypotheses in SPSS…..
Analyze  General Linear Model  Univariate
NOTE: Use
this method of
analysis when
both IV’s are
not repeated
measures.
Estimated Marginal Means of Wage or salary incom
70000
60000
50000
40000
30000
Sex
20000
10000
Male
0
Female
<= 9th grade
HS diploma
HS - no diploma
EDUCAT
Bachelors Degree
Some college
Graduate Degree
n
-
D
II
S
d
S
u
F
S
i
f
g
a
C
0
1
4
7
0
In
1
1
1
7
0
S
0
1
0
1
0
E
0
5
5
2
0
S
7
5
7
4
2
E
1
1
4
T
1
3
C
1
2
a
R
n
-
D
III
S
d
S
u
F
S
i
f
g
a
C
0
1
4
7
0
In
1
1
1
7
0
S
0
1
0
1
0
E
0
5
5
2
0
S
7
5
7
4
2
E
1
1
4
T
1
3
C
1
2
a
R
Table 1
Results of the 2-way ANOVA (Gender X Education) for Income.
Source
SS
df
MS
Gender
12,142,860,574
1
12,142,860,574
Education
28,840,936,475
5
5,768,187,295
Gender X Education
6,215,428,787
5
1,243,085,757
Residual
197,550,969,717 471
419,428,810
F
28.95
13.75
2.96
p
0.000
0.000
0.012
HYPOTHESES TESTED
for a 2X6 ANOVA
Reject H0
(F(1,471)=29.95: p=.000)
Reject H0
(F(5,471)=13.75: p=.000)
Reject H0
(F(5,471)=2.96: p=.012)
No differences for GENDER
(2 levels)
H0: MMale = MFemale
No differences for EDUCATION
(6 levels)
H0: MB1 = MB2 = MB3 = MB4 =
MB5 = MB6
No interaction
At least one MAiBj  MAmBn
Types of 2-Way ANOVA designs
 Both
IV’s are between subjects
(i.e. not-repeated measures)
 Both IV’s are within subjects
(i.e. repeated measures)
 One IV is between subjects, the other IV is
within subjects
 Both
IV’s are between subjects
(i.e. not-repeated measures)
Analyze  General Linear Model  Univariate
 Both
IV’s are within subjects
(i.e. repeated measures)
Analyze  General Linear Model  Repeated Measures
Analyze  General Linear Model
 Repeated Measures
Estimated Marginal Means of MEASURE_1
41.8
41.6
41.4
41.2
DAY
41.0
1
40.8
2
1
TRIAL
2
-
S
M
u
e
I
I
I
n
q
S
S
d
u
S
F
f
i
o
g
a
q
u
D
S
A
p
4
1
4
3
1
3
4
7
G
r
e
0
4
1
4
3
0
3
4
7
H
u
0
4
1
4
3
0
3
4
7
L
o
w
0
4
1
4
3
0
3
4
7
E
S
r
p
r
3
6
3
1
8
G
r
e
0
6
3
0
8
H
u
0
6
3
0
8
L
o
w
0
6
3
0
8
T
S
R
p
7
7
7
2
1
2
1
0
G
r
e
0
7
7
7
2
0
2
1
0
H
u
0
7
7
7
2
0
2
1
0
L
o
w
0
7
7
7
2
0
2
1
0
E
S
r
p
r
3
5
8
1
7
G
r
e
0
5
8
0
7
H
u
0
5
8
0
7
L
o
w
0
5
8
0
7
D
S
A
p
8
1
3
6
1
6
9
8
G
r
e
0
8
1
3
6
0
6
9
8
H
u
0
8
1
3
6
0
6
9
8
L
o
w
0
8
1
3
6
0
6
9
8
E
S
r
p
r
3
0
1
1
5
G
r
e
0
0
1
0
5
H
u
0
0
1
0
5
L
o
w
0
0
1
0
5
n
-
M
T
I
I
I
S
q
d
F
S
i
u
S
I
n
7
1
7
7
0
E
6
1
2
Table 2
Summary of the 2X2 repeated measures ANOVA (Day X Trial) for the test
data.
Source
SS
df
MS
F
p
Subjects
3630.16
31
117.10
DAY
0.44
1
0.44
0.21
0.647
Error(DAY)
64.12
31
2.07
TRIAL
2.87
1
2.87
1.97
0.17
Error(TRIAL)
45.18
31
1.46
DAY * TRIAL
5.69
1
5.69
4.72
0.038
Residual
37.35
31
1.21
 One
IV is between subjects, other IV is within
subjects
Analyze  General Linear Model  Repeated Measures
Estimated Marginal Means of MEASURE_1
42.5
42.0
41.5
41.0
SEX
40.5
Female
40.0
Male
1
TRIAL
2
-
S
M
I
I
I
q
S
d
S
u
S
F
i
f
g
T
S
R
4
1
4
3
7
G
4
0
4
3
7
H
4
0
4
3
7
L
4
0
4
3
7
T
S
R
9
1
9
3
2
G
9
0
9
3
2
H
9
0
9
3
2
L
9
0
9
3
2
E
S
3
0
6
G
3
0
6
H
3
0
6
L
3
0
6
n
-
M
T
I
I
I
d
S
F
u
i
S
g
f
I
n
2
1
2
6
0
S
4
1
4
3
6
E
4
0
4
Table 3.
Analysis of the 2X2 ANOVA (Gender x Trial) with repeated
measures on the second factor for the test data.
Source
SS
df
MS
F
p
SEX
23.13
1
23.13
0.43
0.516
Error
1604.51 30
53.48
TRIAL
8.14
1
8.14
4.77
0.037
TRIAL * SEX
0.16
1
0.16
0.09
0.762
Residual
51.19
30
1.71
Table 1
Results of the 2-way ANOVA (Gender X Education) for Income.
Source
SS
df
MS
Gender
12,142,860,574
1
12,142,860,574
Education
28,840,936,475
5
5,768,187,295
Gender X Education
6,215,428,787
5
1,243,085,757
Residual
197,550,969,717 471
419,428,810
F
28.95
13.75
2.96
p
0.000
0.000
0.012
Table 2
Summary of the 2X2 repeated measures ANOVA (Day X Trial) for the test
data.
Source
SS
df
MS
F
p
Subjects
3630.16
31
117.10
DAY
0.44
1
0.44
0.21
0.647
Error(DAY)
64.12
31
2.07
TRIAL
2.87
1
2.87
1.97
0.17
Error(TRIAL)
45.18
31
1.46
DAY * TRIAL
5.69
1
5.69
4.72
0.038
Residual
37.35
31
1.21
Table 3.
Analysis of the 2X2 ANOVA (Gender x Trial) with repeated
measures on the second factor for the test data.
Source
SS
df
MS
F
p
SEX
23.13
1
23.13
0.43
0.516
Error
1604.51 30
53.48
TRIAL
8.14
1
8.14
4.77
0.037
TRIAL * SEX
0.16
1
0.16
0.09
0.762
Residual
51.19
30
1.71
HYPOTHESES TESTED
in 2-WAY ANOVA
 No
differences for IV #1 (A - 3 levels)
 H0:
 No
differences for IV #2 (B - 4 levels)
 H0:
 No
MA1 = MA2 = MA3
MB1 = MB2 = MB3 = MB4
interaction
 At
least one MAiBj  MAmBn
These are
called
“Main
Effects”