CHAPTER 3 Analysis of Variance (ANOVA) PART 1 MADAM SITI AISYAH ZAKARIA EQT 271 SEM 2 2014/2015.
-
Upload
pamela-arnold -
Category
Documents
-
view
228 -
download
0
Transcript of CHAPTER 3 Analysis of Variance (ANOVA) PART 1 MADAM SITI AISYAH ZAKARIA EQT 271 SEM 2 2014/2015.
CHAPTER 3Analysis of Variance
(ANOVA)PART 1
MADAM SITI AISYAH ZAKARIAEQT 271
SEM 2 2014/2015
Learning Objectives• Describe the relationship between analysis
of variance, the design of experiments, and the types of applications to which the experiments are applied.
• Differentiate one-way and two-way ANOVA techniques.
• Arrange data into a format that facilitates their analysis by the appropriate ANOVA technique.
• Use the appropriate methods in testing hypothesis relative to the experimental data.
Key Terms• Factor level, treatment,
block, interaction• Experimental units• Replication• Within-group variation• Between-group
variation• Completely randomized
design• Randomized block
design• Factorial experiment
• Sum of squares:– Treatment– Error– Block– Interaction– Total
Key Concepts• ANOVA can be used to analyze the data obtained
from experimental or observational studies.• A factor is a variable that the experimenter has
selected for investigation.• A treatment is a level of a factor.• Experimental units are the objects of interest in
the experiment. [effect in experiment]• Variation between treatment groups captures the
effect of the treatment. A : B : C [Between group-variance]
• Variation within treatment groups represents random error not explained by the experimental treatments. A ONLY [Within group variance]
EXAMPLE:Mazlan studied the effect of three learning
skills; peer group discussion, extra exercises, and additional reference books towards student’s score. Define which are factor, treatment and experimental units.
Answer:Factor – Learning skillTreatment - peer group discussion, extra
exercises, and additional reference books
Experimental units - student’s score
The populations from which the samples were obtained must be normally or approximately normal distributed The populations from which the samples were obtained must be normally or approximately normal distributed
The variance of the response variable, denoted 2, is the same for all of the populations. The variance of the response variable, denoted 2, is the same for all of the populations.
The observations (samples) must be independent of each otherThe observations (samples) must be independent of each other
Assumptions for Analysis of Variance
Analysis of Variance: A Conceptual Overview
One-Way ANOVA (Completely Randomized Design)
• A completely randomized design (CRD) is an experimental design in which the treatments are randomly assigned to the experimental units.
• Purpose: Examines two or more levels of an independent variable to determine if their population means could be equal or not.
• Effects model for CRD:
1,2,...,
1, 2,...,
j
ij j ij
i nx
j t
where,
: overall mean effect
: the effect of treatment
: random error
j
ij
j
• Hypothesis:
– H0: µ1 = µ2 = ... = µt *
– H1: µi µj for at least one pair (i,j)
(At least one of the treatment group means differs from the rest. OR At least two of the population means are not equal)
@
* where t = number of treatment groups or levels
0 1 2
0
: .... 0
: 0 for at least one t
j
H
H j
One-Way ANOVA, cont.
CONCLUSION
Fail to Reject H0
No difference in mean
Between- group variance estimate
approximately equal to the within-
group variance
F test value approximately equal to 1
Reject H0
Difference in mean
Between- group variance estimate will be larger than
within-group variance
F test value = greater than 1
* All treatments are equal
* Treatments are not equal
One-Way ANOVA, cont.• Format for data: Data appear in separate columns or
rows, organized by treatment groups. Sample size of each group may differ.
• Calculations:– Sum of squares total (SST) = sum of squared
differences between each individual data value (regardless of group membership) minus the grand mean, , across all data... total variation in the data (not variance).
2
1 1
1 1
1
SST SSTR + SSE
where, ,
j
j
nt
ijj i
nt
ij tj i
jj
x x
x
x N nN
x
One-Way ANOVA, cont.
• Calculations, cont.:– Sum of squares treatment (SSTR) = sum of squared
differences between each group mean and the grand mean, balanced by sample size... between-groups variation (not variance).
– Sum of squares error (SSE) = sum of squared differences between the individual data values and the mean for the group to which each belongs... within-group variation .
2
.1
SSTRt
j jj
n x x
2
2.
1 1 1
.12
SSE = ( 1)
where, 1
j
j
nt k
ij j j jj i j
n
ij jj
jj
x x n s
x x
sn
One-Way ANOVA, cont.
• Calculations, cont.:– Mean square treatment (MSTR) = SSTR/(t – 1),
where t is the number of treatment groups... between-groups variance.
– Mean square error (MSE) = SSE/(N – t), where N is the number of elements sampled and t is the number of treatment groups... within-groups variance.
– F-Ratio [ F test ] = MSTR/MSE, where numerator degrees of freedom are t – 1 and denominator degrees of freedom are N – t.
- F, t-1,N-t refer table ms 30
– If F-Ratio > F or p-value < , reject H0 at the level.
Sampling Distribution of MSTR/MSE
Do Not Reject H0Do Not Reject H0
Reject H0Reject H0
MSTR/MSEMSTR/MSE
Critical ValueCritical ValueFF
Sampling DistributionSampling Distributionof MSTR/MSEof MSTR/MSE
One-Way ANOVA, cont.Comparing the Variance Estimates: The F Test
One-Way ANOVA, cont.ANOVA Table
Source ofVariation
Sum ofSquares
Degrees ofFreedom
MeanSquare
F p-Value
Treatments
SSTR t-1
Error SSE N-t
Total SST N-1
-1
SSTRMSTR
t
SSEMSE
N t
MSTR
MSE
One-Way ANOVA - An ExampleExample 4.1: Safety researchers, interested in
determining if occupancy of a vehicle might be related to the speed at which the vehicle is driven, have checked the following speed (MPH) measurements for two random samples of vehicles:
Driver alone: 64 50 71 55 67 61 80 56 59 74
1+ rider(s): 44 52 54 48 69 67 54 57 58 51 62 67
a. What are the null and alternative hypothesis?H0: µ1 = µ2 where Group 1 = driver alone
H1: µ1 µ2 Group 2 = with rider(s)
One-Way ANOVA - An Exampleb. Use ANOVA and the 0.025 level of significance in testing
the appropriate null hypothesis.
SSTR = 10(63.7 – 60)2 + 12(56.917 – 60)2 = 250.983SSE = (64 – 63.7 )2 + (50 – 63.7 )2 + ... + (74 – 63.7 )2
+ (44 – 56.917) 2 + (52 – 56.917) 2 + ... + (67 – 56.917) 2
= 1487.017SST = (64 – 60 )2 + (50 – 60 )2 + ... + (74 – 60 )2
+ (44 – 60) 2 + (52 – 60) 2 + ... + (67 – 60) 2 = 1738
1 1 1
2 2 2
63.7, 9.3577, 10
56.916, 7.9711, 12
60.0
x s n
x s n
x
One-Way ANOVA - An ExampleCompare calculated values to those in the Excel output:
Anova: Single Factor
SUMMARY
Groups Count Sum Average Variance
Alone 10 637 63.7 87.56666667
WithPass 12 683 56.91666667 63.53787879
ANOVA
Source of Variation SS df MS F P-value F crit
Between Groups 250.9833333 1 250.9833333 3.37566268 0.081071382 4.351250027
Within Groups 1487.016667 20 74.35083333
Total 1738 21
The test statistic The p-value The critical bound
EXAMPLEONE- WAY ANOVA
AutoShine, Inc. is considering marketing a long-lasting car wax. Three different waxes (Type 1, Type 2,and Type 3) have been developed.
Example 4.2 : AutoShine, Inc.
In order to test the durability of these waxes, 5 newcars were waxed with Type 1, 5 with Type 2, and 5with Type 3. Each car was then repeatedly runthrough an automatic carwash until the wax coatingshowed signs of deterioration.
One-Way ANOVA - An Example
The number of times each car went through thecarwash before its wax deteriorated is shown on thenext slide. AutoShine, Inc. must decide which waxto market. Are the three waxes equally effective?
Factor . . . Car wax
Treatments . . . Type I, Type 2, Type 3
Experimental units . . . Cars
Response variable . . . Number of washes
One-Way ANOVA - An Example
12345
2730292831
3328313030
2928303231
Sample MeanSample Variance
ObservationWaxType 1
WaxType 2
WaxType 3
2.5 3.3 2.529.0 30.4 30.0
Testing for the Equality of k Population Means:A Completely Randomized Design
One-Way ANOVA - An Example
1. Hypothesis
where: 1 = mean number of washes using Type 1 wax
2 = mean number of washes using Type 2 wax
3 = mean number of washes using Type 3 wax
H0: 1=2=3
H1: Not all the means are equal
Testing for the Equality of k Population Means:A Completely Randomized Design
One-Way ANOVA - An Example
Because the sample sizes are all equal:
MSE = 33.2/(15 - 3) = 2.77
MSTR = 5.2/(3 - 1) = 2.6
SSE = 4(2.5) + 4(3.3) + 4(2.5) = 33.2
SSTR = 5(29–29.8)2 + 5(30.4–29.8)2 + 5(30–29.8)2 = 5.2
Mean Square Error
2. Test Statistic - Mean Square Between Treatments
= (29 + 30.4 + 30)/3 = 29.8
Testing for the Equality of k Population Means:A Completely Randomized Design
One-Way ANOVA - An Example
1 2 3 / 3x x x x
Source ofVariation
Sum ofSquares
Degrees ofFreedom
MeanSquares F
Treatments
Error
Total
2
14
5.2
33.2
38.4
12
2.60
2.77
0.939
2. ANOVA Table
Testing for the Equality of k Population Means:A Completely Randomized Design
p-Value
0.42
One-Way ANOVA - An Example
3. F value
Testing for the Equality of k Population Means:A Completely Randomized Design
One-Way ANOVA - An Example
4. Rejection Rule (Draw picture)
p-Value Approach: Do not Reject H0 if p-value > .05
Critical Value Approach: Do not Reject H0 if F < 3.89
where F0.05,2,12 = 3.89 is based on an F distributionwith 2 numerator degrees of freedom and 12denominator degrees of freedom
2. There is insufficient evidence to conclude thatthe mean number of washes for the three waxtypes are not all the same.
5. Conclusion
1. F test < F alfa (3.89), do not fall in rejection region so we do not reject H0.
Testing for the Equality of k Population Means:A Completely Randomized Design
One-Way ANOVA - An Example
EXAMPLE 2
Reject H0
5 IMPORTANT STEP:1.HYPOTHESIS TESTING2.TEST STATISTIC – F TEST3.F – VALUE (CRITICAL VALUE)4.REJECTION REGION5.CONCLUSION
Step 21. SSTR - MSTR
2. SSE - MSE3. SST = SSTR +SSE4. F TEST = MSTR/MSE5. BUILD ANOVA TABLE
EXERCISETEXT BOOK PAGE 143 ( 1 &
2)5 IMPORTANT STEP:1.HYPOTHESIS TESTING2.TEST STATISTIC – F TEST3.F – VALUE (CRITICAL VALUE4.REJECTION REGION5.CONCLUSION