Analysis of Variance (ANOVA) : Part 1: One-Way ANOVA (Equal Sample Sizes) Part 2: One-Way ANOVA (Unequal Sample Sizes)
Analysis of Variance (ANOVA) : Part 1: One-Way ANOVA (Equal Sample Sizes) Part 2: One-Way ANOVA (Unequal Sample Sizes)
1
Why ANOVA?
• Up to now you have learnt how to conduct
hypothesis testing for a single mean and to
compare two populations
• What if we wish to compare means of more than
two populations?
• Enter ANOVA; ANalysis Of VAriance
2
Design of Experiments
Design of experiments refers to the process of planning, designing, and
analyzing the experiment so that valid and objective conclusions can
be drawn effectively and efficiently.
3
Design of Experiments
The success of any industrially designed experiment depends on sound
planning, appropriate choice of design, statistical analysis of data, and
teamwork skills.
Every experiment involves a sequence of activities:
Conclusion What has been learned bout the original conjecture from the experiment. Often
the experiment will lead to a revised conjecture, and a new experiment, and so
forth.
4
Design of Experiments
• A one-way ANOVA, single factor ANOVA or a completely randomized
design (CRD) is the simplest design for comparative experiments.
• One-way ANOVA models are used to compare the mean response
values at different levels of the factor. Each level of the factor is
investigated to see if the response is significantly different from the
response at other levels of the factor.
5
To illustrate the use of ANOVA models in the analysis of experiments,
consider a single factor experiment where the analyst wants to see if
the surface finish of certain parts is affected by the speed of a lathe
machine.
Data is collected for three speeds (or three treatments).
Each treatment is replicated four times.
Therefore, this experiment design is balanced. Surface finish values
recorded using randomization are shown in the following table.
Treatments
7
Assumptions and Hypothesis of One-Way ANOVA
• Normality
The samples are obtained from populations that are normally
distributed
• Constant Variance
The variances of the populations are equal
• Independence
The samples drawn from different populations are random and
independent
8
Example
9
Treatments
Observations
10
11
TYPICAL DATA STRUCTURE FOR ONE-WAY ANOVA
Treatment Observations Totals Averages
(Level)
12
Assessment Observation
Score (%) Totals Averages
1 2 3 4 5 6 7
Year 1 82 93 61 74 69 70 53 502 71.71
Year 2 71 62 85 94 78 66 71 527 75.29
Year 3 64 73 87 91 56 78 87 536 76.57
𝑦.. = 1565 𝑦.. = 74.52
13
14
𝑘 𝑛
2 𝑦..2
𝑆𝑆𝑇 = 𝑦𝑖𝑗 −
𝑁
𝑖=1 𝑗=1
1565 2
= 82 2 + 93 2 + ⋯ + 78 2 + 87 2 − = 2901.238
21
𝑘
1 𝑦 2
..
𝑆𝑆𝐴 = 𝑦𝑖.2 −
𝑛 𝑁
𝑖=1
15
The ONE-WAY ANOVA table:
SOURCE OF VARIATION SUM OF SQUARES Degrees of freedom, MEAN F
(SS) df SQUARE
(SS/df) 𝑀𝑆𝐴
𝐹 =
Treatments 88.667 k-1 =2 44.333 𝑀𝑆𝐸
Error 2812.571 N-k =18 156.254
Total 2901.238 N-1 =20 0.284
𝐻0 : 𝜇1 = 𝜇2 = 𝜇3
𝐻1 : At least two of the means are not equal
𝛼 = 0.05
Critical region:
Reject 𝐻0 if 𝐹 > 𝐹𝛼(𝜐1=𝑘−1 ,𝜐2=𝑁−𝑘 )
𝐹0.05(2,18) = 3.55
F = 0.284 > 3.55, thus do not reject 𝐻0
Decision: Failed to reject 𝐻0 and conclude that there is no difference in mean test score by year of16student
The F Distribution
Where 𝜐1 = 𝑘 – 1 and 𝜐2 =
𝑁– 𝑘
18
19
Using Excel for One-Way ANOVA
Step 1: Input your data into columns or rows in Excel. For example, if three groups of
students according to year are being tested, spread the data into three columns.
Step 2: Click the “Data” tab and then click “Data Analysis.” If you don’t see Data
Analysis, load the ‘Data Analysis Toolpak’ add-in.
Step 4: Type an input range into the Input Range box. For example, if the data is in cells A1
to C10, type “A1:C10” into the box. Check the “Labels in first row” if we have column
headers, and select the Rows radio button if the data is in rows.
Step 5: Select an output range. For example, click the “New Worksheet” radio button.
Step 6: Choose an alpha level. For most hypothesis tests, 0.05 is standard.
Step 7: Click “OK.” The results from ANOVA will appear in the worksheet.
20
A recent study claims that using music in a class enhances the concentration and
consequently helps students absorb more information. To test the claim, the
study was implemented on a smaller group of randomly selected students from
three different classes.
We take three different groups of ten randomly selected students (all of the same
age) from three different classrooms. Each classroom was provided with a
different environment for students to study. Classroom A had constant music
being played in the background, classroom B had variable music being played and
classroom C was a regular class with no music playing.
After one month, we conducted a test for all the three groups and collected their
test scores. The test scores that we obtained were as follows:
21
22
One-Way ANOVA (Unequal Sample Sizes)
The only practical issue in one-way ANOVA is that very unequal sample
sizes can affect the homogeneity of variance assumption. ANOVA is
considered robust to moderate departures from this assumption, but
the departure needs to stay smaller when the sample sizes are very
different.
23
When the sample sizes between the populations
are unequal, the equations for the ANOVA are
slightly different.
𝑘 𝑛𝑖
24
Example
The article “On the Development of a New Approach for the
Determination of Yield Strength in Mg-based Alloys” (Light Metal Age,
Oct. 1998: 51–53) presented the following data
on elastic modulus (GPa) obtained by a new ultrasonic method for
specimens of a certain alloy produced using three different casting
processes.
Example cont’d
• Let 1, 2, and 3 denote the true average elastic moduli for the three
different processes under the given circumstances.
Where 𝜐1 = 𝑘 – 1 and 𝜐2 =
𝑁– 𝑘
31
32
One-Way ANOVA- unequal sample size in Excel
33