Introduction
to Analysis
of Variance
(ANOVA)
Prepared by:
Jhunar John M. Tauy, RPm, CCH
Learning Objectives
1 2 3
understand the logic show competency in recognize the
behind the hypothesis calculating, assumptions of
test for comparing analyzing, and ANOVA and what to
two or more means interpreting the results use if its assumptions
(ANOVA) of ANOVA were not met
Example
A psychologist at a private psychiatric hospital was asked
to determine whether there was any clear difference in the
length of stay of patients with different categories of
diagnosis. Looking at the last four patients in each of the
three major categories, the results (in terms of weeks of
stay) were as follows
Example (cont.)
Analysis of Variance (ANOVA)
• a hypothesis-testing procedure that is used to evaluate mean differences
between two or more treatments/groups/populations
Formula:
𝑀𝑆𝑏𝑒𝑡𝑤𝑒𝑒𝑛
𝐹=
𝑀𝑆𝑤𝑖𝑡ℎ𝑖𝑛
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th
ed.). Cengage Learning
F Ratio
• ratio of the between-groups population variance estimate to the
within-groups population variance estimate
Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.). Pearson Education Inc.
F Table
table of cutoff scores on the F distribution
Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.). Pearson Education Inc.
Basic Logic of ANOVA
• the null hypothesis in an analysis of variance is that the population
being compared all have the same mean
Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.). Pearson Education Inc.
Carrying Out an Analysis of
Variance (Sum of Squares)
Step 1
• calculate the Total Sum of Squares (SStotal)
Formula:
2
𝐺
𝑠𝑠𝑡𝑜𝑡𝑎𝑙 = 𝑋2 −
𝑁
where:
X = score of each subject/respondent
G = ΣT (T = sum of scores in a group)
N = kn (k = number of groups; n = number of scores for each group)
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
Carrying Out an Analysis of
Variance (Sum of Squares)
Step 2
• calculate the Within-Treatments Sum of Squares (SSwithin)
Formula:
𝑠𝑠𝑤𝑖𝑡ℎ𝑖𝑛 = 𝑠𝑠1 + 𝑠𝑠2 + ⋯ + 𝑠𝑠𝑛
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
Carrying Out an Analysis of
Variance (Sum of Squares)
Step 3
• calculate the Between-Treatments Sum of Squares (SSbetween)
Formula:
𝑠𝑠𝑏𝑒𝑡𝑤𝑒𝑒𝑛 = 𝑠𝑠𝑡𝑜𝑡𝑎𝑙 − 𝑠𝑠𝑤𝑖𝑡ℎ𝑖𝑛
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
Carrying Out an Analysis of
Variance (Degrees of Freedom)
Step 4
• calculate the Total Degrees of Freedom (dftotal)
Formula:
ⅆ𝑓total = 𝑁 − 1
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
Carrying Out an Analysis of
Variance (Degrees of Freedom)
Step 5
• calculate the Within-Treatments Degrees of Freedom (dfwithin)
Formula:
ⅆ𝑓within = 𝑁 − k
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
Carrying Out an Analysis of
Variance (Degrees of Freedom)
Step 6
• calculate the Between-Treatments Degrees of Freedom (dfbetween)
Formula:
ⅆ𝑓between = 𝑘 − 1
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.).
Cengage Learning
Carrying Out an Analysis of
Variance (Variances)
Step 7
• calculate the Between-Treatments Variance (MSbetween)
Formula:
2 𝑆𝑆between
𝑠between = 𝑀𝑆between = ⅆ𝑓between
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
Carrying Out an Analysis of
Variance (Variances)
Step 8
• calculate the Within-Treatments Variance (MSwithin)
Formula:
2 𝑆𝑆wi𝑡ℎ𝑖𝑛
𝑠within = 𝑀𝑆within = ⅆ𝑓within
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
Carrying Out an Analysis of
Variance (F ratio)
Step 9
• calculate the F ratio
Formula:
𝑀𝑆𝑏𝑒𝑡𝑤𝑒𝑒𝑛
𝐹=
𝑀𝑆𝑤𝑖𝑡ℎ𝑖𝑛
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
ANOVA Summary Table
• chart showing the major elements in figuring an analysis of
variance
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
ANOVA Summary Table (Example)
Source SS df MS
Between Treatments 42.67 2 21.34 F(2,9) = 9.61
Within Treatments 20.00 9 2.22
Total 62.67 11
Measuring Effect Size for ANOVA
Percentage of Variance Accounted For (η2)
• pronounced as eta squared, a percentage that measures how much of the variability in the scores is
accounted for by the differences between treatments
Interpretation: 0.01 = small effect; 0.06 = medium effect; 0.14 = large effect
Formula:
𝑆𝑆between
η2 =
𝑆𝑆total
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
Assumptions of the ANOVA
1. Your dependent variable should be measured at the interval or ratio level (i.e., they
are continuous).
2. Your independent variable should consist of two or more categorical, independent groups.
3. You should have independence of observations, which means that there is no relationship
between the observations in each group or between the groups themselves.
4. There should be no significant outliers.
5. Your dependent variable should be approximately normally distributed for each category of
the independent variable. Alternatively, the residuals of the dependent variable is
approximately normally distributed
6. There needs to be homogeneity of variances.
Post Hoc
Comparisons
Analysis of Variance (ANOVA)
Post Hoc Comparisons
• also known as Post Hoc Tests or Posttests, are additional hypothesis
tests that are done after an ANOVA to determine exactly which
mean differences are significant and which are not
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.).
Cengage Learning
Tukey’s Honestly Significant
Difference (HSD) Test
• or Tukey Test, is a single-step multiple comparison procedure and statistical test. It can be used
on raw data or in conjunction with an ANOVA to find means that are significantly different from
each other
• most commonly used for equal sample sizes
Formula:
𝑀𝑆within
𝐻𝑆𝐷 = 𝑞
𝑛
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th ed.). Cengage
Learning
Games-Howell
• a nonparametric approach in comparing combinations of groups or
treatments
• it is like the Tukey’s test, but it does not assume equal variances and
sample sizes
Games-Howell Nonparametric post-hoc test. (n.d.).
RPubs. [Link]
Scheffé’s Test
• method of figuring the significance of post hoc comparisons that
takes into account all possible comparisons that could be made1
• It is customarily used for unequal sample sizes2
1Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.). Pearson Education Inc.
2Scheffé's S method. (n.d.). Statistics. [Link]
Bonferroni Procedure
• is a multiple-comparison procedure in which the total alpha
percentage is divided among the set of comparisons so that each is
tested at a more stringent significance level
Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.). Pearson Education
Inc.
Reporting the ANOVA Results in
Research Articles
• A One-Way ANOVA was used to determine the differences of means among the different
disorders in terms of length of stay. The results show significant difference in the length of
stay among the groups who had different disorder classification, F(2,9) = 9.60, p < .05.
Tukey’s HSD further shows that significant difference lies between the groups who has
affective disorders and cognitive disorders, as well as affective disorders and drug-related
disorders. Sixty-eight percent (68%) of the variability in the length of stay among the
respondents can be explained by disorder classification. The group with cognitive disorders
(M = 10.00, SD = 1.83) and drug-related disorders (M = 10.00, SD = 1.63) got the longest
length of stay in weeks, while the group who has affective disorders (M = 6.00, SD = 0.82)
got the shortest length of stay in weeks. See Graph A. Therefore, this study shows that the
length of stay is likely affected by the type of disorder.
Power Table
for One-Way
ANOVA
Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.).
Pearson Education Inc.
Planning a Sample Size for One-Way ANOVA
(80% Statistical Power)
Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.). Pearson Education Inc.
Kruskal-Wallis H Test
• (sometimes also called the "one-way ANOVA on ranks") is a rank-
based nonparametric test that can be used to determine if there
are statistically significant differences between two or more groups
of an independent variable on a continuous or ordinal dependent
variable
Kruskal-Wallis H Test using SPSS Statistics. (2018). In Laerd Statistics. [Link]
tutorials/[Link]
Assumptions of the
Kruskal-Wallis H Test
1. The dependent variable should be measured at the ordinal or continuous level.
2. The independent variable should consist of two or more categorical,
independent groups.
3. You should have independence of observations
4. The two or more dependent variables are not normally distributed.
Kruskal-Wallis H Test using SPSS Statistics. (2018). In Laerd Statistics. [Link]
tutorials/[Link]
A Kruskal-Wallis H Test was used to
Reporting determine if there is a significant
difference on the length of stay in
Kruskal-Wallis H weeks among the different disorders.
Test Results in Based on the gathered data, it was
Research revealed that there is a significant
difference among the three
Articles diagnosis categories in terms of
length of stay, H(2) = 7.48, p < 0.001.
One-Way ANOVA in
Jamovi
1. Open the dataset with a filename
“Name of the [Link]”
2. Click ANOVA → One-Way ANOVA
3. Transfer the dependent variable
from the left box to the “Dependent
Variables” box.
4. Transfer the factor/independent
variable/quasi-independent variable
from the left box to the “Grouping
Variable” box.
One-Way ANOVA in
Jamovi (cont.)
5. Under Assumption Checks, click
Homogeneity test and Normality test.
6. If the homogeneity of variance
assumption was violated, click Don’t
assume equal (Welch) under the
Variances section. Otherwise, use
Assume equal (Fisher).
One-Way ANOVA in
Jamovi (cont.)
7. To acquire the effect size, click
ANOVA -> ANOVA, repeat the steps
of transferring variables, and click η2
(if ANOVA results is significant).
8. Under the Post-Hoc Tests click Tukey
if the result is significant and all the
assumptions of ANOVA were met.
One-Way ANOVA in
Jamovi (cont.)
9. Under the Post-Hoc Tests, use
Games-Howell if the homogeneity of
variance assumption was violated.
10. Under the Additional Statistics, click
Mean difference, Report
significance, and Flag significant
comparisons.
One-Way ANOVA in
Jamovi (cont.)
11. If you want to use the Scheffé test,
run a different analysis by clicking
ANOVA -> ANOVA. Repeat the steps
in transferring variables and click
Scheffé under the Post-Hoc Tests.
Kruskal-Wallis in Jamovi
1. Open the dataset with a filename
“Name of the [Link]”
2. Click ANOVA → Kruskal-Wallis
3. Transfer the dependent variable
from the left box to the “Dependent
Variables” box.
Kruskal-Wallis in Jamovi
(cont.)
4. Transfer the factor/independent
variable/quasi-independent variable
from the left box to the “Grouping
Variable” box.
5. Click Effect Size.
6. Click DSCF Pairwise Comparison
One-Way ANOVA in
JASP
1. Open the dataset with a filename
“Name of the [Link]”
2. Click ANOVA → ANOVA
3. Transfer the dependent variable
from the left box to the “Dependent
Variable” box.
4. Transfer the factor/independent
variable/quasi-independent variable
from the left box to the “Fixed
Factors” box.
One-Way ANOVA in
JASP (cont.)
5. Under Assumption Checks, click
Homogeneity of Variance and Q-Q
plot of residuals.
6. If the homogeneity of variance
assumption was violated, click Welch
under the Homogeneity corrections.
7. If the normality assumption was
violated, click Nonparametrics, and
transfer the factor/independent
variable to the right box.
One-Way ANOVA in
JASP (cont.)
8. Under the Display section, click
Descriptive Statistics, and Estimate of
effect size -> η2 (if ANOVA results is
significant).
9. Click Post-Hoc Tests -> Tukey if the
result is significant and all the
assumptions of ANOVA were met. If
sample size is unequal, click Scheffé.
One-Way ANOVA in
JASP (cont.)
10. Click Post Hoc Tests -> Games-
Howell if the homogeneity of
variance assumption was violated
11. Click Post Hoc Tests -> Dunn if you
use Kruskal-Wallis and the result is
significant. Transfer the
factor/independent variable/quasi-
independent variable to the right
box.
Variations of ANOVA
Repeated Measures ANOVA
• an ANOVA for a repeated-measures design----a design with one group of
individuals participating in three (3) or more treatment conditions
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th
ed.). Cengage Learning
Variations of ANOVA
Two-Way ANOVA
• an ANOVA used for a factorial design----a design with more than one
independent variable and one dependent variable
Gravetter, F.J., Wallnau, L. B., & Forzano, L, B. (2020). Essentials of statistics for the behavioral science (9th
ed.). Cengage Learning
Main Effect
◦the action of a single independent variable in an
experiment; the change in the dependent
variable produced by the various levels of a
single factor.
Myers, A. & Hansen, C. (2012). Experimental Psychology (7th ed.). Cengage Learning
Interaction
◦the effect of one independent variable changes
across the levels of another independent
variable; can only be detected in a factorial
design
Myers, A. & Hansen, C. (2012). Experimental Psychology (7th ed.). Cengage Learning
Analysis of Covariance (ANCOVA)
• analysis of variance that controls for the effect of one or more
additional variables
Covariate - variable controlled for in an analysis of variance
Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.). Pearson Education Inc.
Multivariate Analysis of
Variance (MANOVA)
• analysis of variance with more than one dependent
variable
Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.). Pearson Education Inc.
Multivariate Analysis of
Covariance (MANCOVA)
• analysis of covariance with more than one dependent
variable
Aron, A., Coups, E., & Aron, E. (2013). Statistics for psychology (6th ed.). Pearson Education Inc.