2. Basic concept
• We have grouping variables, commonly
referred to as:
–Factors
–Independent Variables
• best term if manipulated
experimentally
–Predictors
–Grouping Variables
–Classification Variables
3. Basic concept
• We have one continuous variable,
commonly referred to as the
–Dependent variable
• best term if data collected
experimentally
–Criterion variable
–Outcome variable
–Response variable
–Comparison variable
4. What is ANOVA?
• Analysis of variance (ANOVA): a statistical procedure to
compare the mean difference of several groups
– Null hypothesis: all means are not significantly different
from each other
– Alternate hypothesis: Some means are not equal
5. What is a One-way ANOVA?
• There must be three or more groups. If there are
two groups only, you can use an independent-
sample t-test.
• The independent variable is called the grouping
factor. The group is called the level. In this
example, there is one factor and three levels
(Group 1-3).
6. Why isn’t it called Analysis of means?
• If we want to compare the means, why is it called
Analysis of Variance (ANOVA), not Analysis of Mean?
7. Why isn’t it called Analysis of means?
In the unreal world, the people in the same
group have the same response to the
treatment:
– All people in Group 1 got 10.
– All people in Group 2 got 11.
– All people in Group 3 got 12.
But in the real world, usually there is
variability in each group (dispersion). We
must take the variance into account while
comparing the means.
8. What is a two-way ANOVA?
• So far, our ANOVA problems had only one outcome variable and one
grouping variable (a factor) [e.g. compare statistics scores across
different lecture sets]
• What if we want to use two or more grouping variables (factors)?
(e.g. compare statistics scores across different lecture sets and
different majors)
• We will only look at the case of two grouping variables, but the
process is the same for larger number of grouping variables.
• When we are examining the effect of two grouping variables (two
factors), this is called a Two-Way ANOVA.
9. What is Two-way ANOVA?
There are two factors.
Unlike one-way ANOVA, in this design it is allowed to have fewer than three
levels (groups) in each factor.
In this example, there are two factors: A and B. In each factor, there are two
levels: 1 and 2. Thus, it is called a 2X2 factorial ANOVA. Has two levels of
Factor A and two levels of Factor B.
This results in four combinations of level of A and level of B. Each such
combination is referred to as a cell.
10. What is Two-way ANOVA?
• In a Two-way ANOVA, the effects of two factors can be investigated
simultaneously.
• Two-way ANOVA permits the investigation of the effects of either
factor alone (e.g. the effect of the lecture sets on the statistics
scores, and the effect of the majors on the statistics scores) and
the two factors together (e.g. the combined effect of the lecture sets
and the effect of the majors on the statistics scores).
• This ability to look at both factors together is the advantage of a Two-
Way ANOVA compared to two One-Way ANOVA’s (one for each factor)
11. Questions of interest
• Three questions are answered by a Two-way ANOVA
– What effect does Factor A have on the outcome? (Main Effect of A)
– What effect does Factor B have on the outcome? (Main Effect of B)
– To what extent the effects of Factor A and Factor B have on the outcome
variable interact? (Interaction Effect of A and B) OR
– To what extent is there an interaction between factors A and B?
(Interaction Effect of A and B)
• This means that we will have three sets of hypotheses, one set
for each question.
12. Hypotheses
1) Main effect of Factor A:
H0: There is no difference in the mean of outcome variable across factor A.
H1: There are differences in the mean of outcome variable across factor A.
2) Main effect of Factor B:
H0: There is no difference in the mean of outcome variable across factor B.
H1: There are differences in the mean of outcome variable across factor B.
3) Interaction effect of Factor A and Factor B:
H0: There is no interaction effect between factor A and factor B.
H1: There are interaction effects between factor A and factor B.
13. Test of Hypotheses
• F-Statistic for Testing an Effect
on
distributi
F
MS
MS
F
E
effect
o
~
Numerator df = dfeffect
Denominator df = dferror
If the F-statistic is large we reject that the effect is “zero” in
favor of the alternative that the effect of the factor is non-zero.
14. Example
• We have mathematics test score of boys and
girls in age group of 10yr, 11yr, and 12yr. If we
want to study the effect of gender and age on
score:
– Factors : gender & age
– Outcome variable: test score
15. •The populations from which the samples were
obtained must be normally or approximately normally
distributed.
•The samples must be independent.
•The variances of the populations must be equal.
•The groups must have the same sample size.
Assumptions
16.
17.
18. Factors: Gender, Tahap Pendidikan
Outcome variable = Minat tentang
Politik
IV = Gender
(Male, Female)
IV = Edu Level
(School, College, University)
CONTOH ANOVA DUA HALA MENGGUNAKAN SPSS
Kajian membandingkan GENDER dan TAHAP PENDIDIKAN
terhadap MINAT TENTANG POLITIK
24. Factors : Gender, Tahap Pendidikan
Outcome variable : Minat tentang
politik
25.
26. Pindahkan pemboleh ubah Edu_Level daripada ruang [Factors]
ke ruang [Horizontal Axis] dan pemboleh ubah Gender ke ruang
[Separate Lines]
27.
28.
29.
30.
31.
32.
33.
34. Factors = Gender, Tahap Pendidikan
Outcome variable = Minat tentang politik
35. Questions of Interest
• Generally, the questions of interest here concern
three questions regarding the potential effects of
the factors on the outcome variable.
• Question 1: To what extent is there an interaction
between factors A and B?
36. Two-way ANOVA Table
Source of
Variation
Degrees of
Freedom
Sum of
Squares
Mean
Square F-ratio
P-value
Factor A a - 1 SSA MSA FA = MSA / MSE Tail area
Factor B b - 1 SSB MSB FB = MSB / MSE Tail area
Interaction (a – 1)(b – 1) SSAB MSAB FAB = MSAB / MSE Tail area
Error ab(n – 1) SSE MSE
Total abn - 1 SST
This is our initial focus
which is the p-value for
Question 1: To what extent
is there an interaction
between factors A and B?
39. • If an interaction is significant (p-value < .05) we
conclude the main effects are dependent of one
another and that both effects are important!
• In this example (i.e. the interaction is significant)
the tests for main effects in the Two-way ANOVA
table are MEANINGLESS!
We must compare levels of factor A within
each level of factor B (and vise versa).
40. Main
effect
Interaction effect
If and only if there's no interaction effect
(p >.05), we'll look into the main effects.
Adjusted r squared tells us that 83.6% of the variance in TAHAP KEPEKAAN HEPA (outcome variable)
is attributable to GENDER and EDUCATION LEVEL. In social sciences research, this is a high value,
indicating strong relationships between our factors (Gender & Edu Level) and Tahap Kepekaan HEPA.
Jika p<0.05, wujud interaction effect
antara gender and education level
41. Since the interaction effect is
significant (p = .014), interpreting
the main effects can be misleading.
Option 1) : analyze the simple main
effects (similar to one-way ANOVA )
and pairwise comparison
Option 2) : analyze the interaction
contrasts
Jika p<0.05, wujud interaction effect
antara gender and education level
42. Laporan Dapatan Kajian
• ANOVA dua hala telah dijalankan bagi
mengkaji kesan jantina dan tahap pendidikan
terhadap minat dalam politik. Terdapat
interaksi signifikan secara statistik antara
kesan jantina dan tahap pendidikan terhadap
minat dalam politik, F (2, 54) = 4.643, p = .014.
Teruskan dengan analisis simple main effect
dan analisis perbandingan berpasangan.
43. Reporting (English version)
A two-way ANOVA was conducted that
examined the effect of gender and education
level on interest in politics. There was a
statistically significant interaction between the
effects of gender and education level on interest
in politics, F (2, 54) = 4.643, p = .014. Proceed
with simple main effects and pairwise
comparison analyses.
44. Questions of Interest
• If there is not a significant interaction effect
then we can consider the main effects
separately, i.e. we ask the following:
• Question 2: Does factor A alone have a
significant effect?
• Question 3: Does factor B alone have a
significant effect?
45. • If the interaction is not statistically significant
(i.e. p-value > 0.05) then we conclude the main
effects (if present) are independent of one
another.
• We can then test for significance of the main
effects separately, again using an F-test.
• If a main effect is significant we can then use
multiple comparison procedures (post hoc
analysis) as usual to compare the mean
response for different levels of the factor while
holding the other factor fixed.
46. Summary
• These ideas can be extended to more than
two factors.
• When interactions exist, the main effects
involved are important, but cannot discussed
separately.
• Multiple comparisons can still be conducted
to compare different treatment level means.
47.
48. LATIHAN – Two Way ANOVA
Dapatkan nilai bagi F (ability), F(method) & F(interaction). Nyatakan sama
ada wujud kesan interaksi antara ability dan method dalam analisis ini.
Tuliskan dapatan kajian
49. Extra example
The aim of the study was to see which diet was best for losing weight but it was also
thought that best diets for males and females may be different so the factors are diet
and gender.
50.
51. Reporting : Two-Way ANOVA
Normality checks and Levene’s test were carried out and the
assumptions were met. The results of the two-way ANOVA
showed that there was a statistically significant interaction
between the effects of Diet and Gender on weight loss
[F(2,70)=3.513, p=.049]. There was a difference between the
mean weight lost on the 3 diets for females [F(2,40)=10.64,
p<.001] but not for males [F(2,30)=.148, p=.863). The Tukey’s
post hoc test were carried out for females. Diet 3 was
significantly different to diet 1 (p=.002) and diet 2 (p<.001)
but there is no evidence to suggest that diets 1 and 2 differ
(p=.841). For females, the mean diet lost on diet 2 was 5.88
kg compared to only 3.05 kg and 2.61 kg on diets 1 and 2
respectively.