You are on page 1of 22

HYPOTHESIS TESTING FOR

THREE OR MORE MEANS:


ANOVA
CHAPTER 16

1
HYPOTHESIS TESTING FOR THREE OR
MORE MEANS

■ When testing means of three or more independent groups, we


cannot perform repeated hypothesis testing for independent
samples!!!
■ The test statistic used when we have to compare the means of
3 or more independent is: ANOVA technique (ANALYSIS OF
VARIANCE)

2
Example:
Test Scores and Socioeconomic Status
■ A researcher hypothesized that women of different
socioeconomic backgrounds would perform differently on an
anxiety rating scale.
■ They administered the test to a sample of 37 women ( 13 of
low SES, 12 of medium and 12 of high) and obtained a mean of
40.23 ± 25.17 for the low group, 15.60 ± 6.42 for the medium
and 18.06 ± 9.97 for the high. Do these results confirm this
hypothesis?
Analysis of Variance (ANOVA)
• Compares 3 or more means

• Allows us to
determine whether the samples come from the
same population

• Compares the variance among groups (SSb) to the variance


within each group (SSw)

• Independent samples

• Normally distributed variable in each group

• Calculated statistic = F ratio


ANOVA
q Three assumptions to perform ANOVA test of hypotheses:
1. The observations are independent: the value of one
observation is not correlated with the value of another.
2. The observations in each group are normally distributed
3. The variance of each group is equal to that of any other
groupà homogeneity of variances.

q ANOVA compares the variance within groups to the variance


between groups

5
Null and Alternate
Hypotheses
•H0: µ1 = µ2 = µ3

•H1: µ1 ≠ µ2 or µ1 ≠ µ3 or µ2 ≠ µ3

•At least one mean is different

•These tests are all 1-tailed as the F distribution is


always positive and it makes no sense to talk of 1-
tailed and 2-tailed in the case of three or more groups.
Rejection Zone

•F0 > Fα: reject H0

•F0 < Fα: do not reject H0


Hypothesis testing for three or more means
8

Let’s start with an example…

Chapter 17. Hypothesis testing for three or more means 8


Example
¨ (Example taken from Sullivan textbook, chap7, p.150)

¨ A clinical trial is run to compare weight loss programs, and


participants are randomly assigned for 8 weeks to one of the
comparison groups. The outcome of interest is weight loss.
¨ Three diets were compared: low-calorie diet, low-fat diet, low-
carbohydrate diet.
¨ A fourth group was considered as a control.
¨ A total of 20 patients were randomly assigned to
one of the four diet groups.

9
Example

Weight loss in each treatment


Low-calorie Low-Fat Low-Carb. Control
8 2 3 2
9 4 5 2
Is there a statistically
6 3 4 -1
significant different
7 5 2 0
weight loss among the
3 1 3 3
four diets?

Summary statistics on Weight loss by treatment

Low-calorie Low-Fat Low-Carb. Control


N1=5 N2=5 N3=5 N4=5

X 1 = 6.6 X2 =3 X 3 = 3.4 X 4 = 1.2

10
■ Procedures for hypothesis testing
à Setting up hypothesis and determine level of
significance
H0: µ1=µ2=µ3=µ4
H1:All means are not equal
α=0.05

àThe Analysis of Variance (ANOVA) technique applies when


there are more than two independent comparison groups.

à ANOVA compares two different estimates of the population


variance: within-group variance, and between-group variance
■ Procedures for hypothesis testing
à Select the appropriate test statistic
The test statistic is the F statistic for ANOVA

Mean Squares (MS) between groups à Variance


between groups
MSB
F=
MSW Mean Squares (MS) within groups à Variance within
groups
■ Procedures for hypothesis testing
à Select the appropriate test statistic
The test statistic is the F statistic for ANOVA

ANOVA table
Source Mean
Sum of squares Degrees of
of squares F
(SS) freedom (df)
variation (MS)
Between
SSB = å nj ( X j - X ) 2
groups SSB MSB
k-1 MSB = F=
k -1 MSW
Within
SSW = åå ( X - X j )2
groups N-k SSW
MSW =
N -k
Total
SST = åå ( X - X )2 N-1
■ Procedures for hypothesis testing
à Complete the ANOVA table: Variability between groups

SSB = å nj ( X j - X ) 2

1. Square the differences between each group mean X!j and the overall mean X
!

2. For each group, multiply each squared difference by the sample size
3. Sum the squared differences

SSB=5(6.6-3.6)2 + 5(3-3.6)2 + 5(3.4-3.6)2 + 5(1.2-3.6)2 = 75.8


■ Procedures for hypothesis testing
à Complete the ANOVA table

ANOVA table
Source of Degrees of Mean
Sum of squares (SS) F
variation freedom (df) squares (MS)
Between SSB=75.8 k-1= 4-1 MSB=75.8/3=
groups 25.3
Within
N-k
groups
Total N-1
■ Procedures for hypothesis testing
à Complete the ANOVA table: Variability within groups
SSW = åå ( X - X j ) 2

1. In every group, square the differences between each observation X and its group
mean X!j
2. Sum the differences
1. In every group, square the differences between each observation X and its group
mean X!j
2. Sum the differences

Low calorie Step 1: (X - 6.6) Step 2: (X-6.6)2


8 1.4 2.0
9 2.4 5.8
6 -0.6 0.4
7 0.4 0.2
3 -3.6 13.0
Total 0 21.4

SSW= 21.4 + 10 + 5.4 + 10.6 = 47.4


■ Procedures for hypothesis testing
à Complete the ANOVA table

ANOVA table
Source Sum of squares (SS) Degrees of Mean F
of freedom (df) squares
variation (MS)
Between SSB=75.8 k-1= 4-1=3 MSB=75.8/3
groups =25.3
Within SSW=47.4 N-k=20-4=16 MSW=47.4/1
groups 6=3
Total N-1

18
■ Procedures for hypothesis testing
à Complete the ANOVA table

ANOVA table
Source Mean
Sum of squares Degrees of
of squares F
(SS) freedom (df)
variation (MS)
Between SSB=75.8 k-1= 4-1=3 MSB=75.8/3
groups =25.3
Within SSW=47.4 N-k=20-4=16 MSW=47.4/1
groups 6=3
Total SSB+SSW=123.2 N-1=20-1=19

19
■ Procedures for hypothesis testing
à Complete the ANOVA table

ANOVA table
Source
Sum of squares Degrees of Mean squares
of F
(SS) freedom (df) (MS)
variation
Between SSB=75.8 MSB=75.8/3=25.3 MSB/MSW=
k-1= 4-1=3
groups 25.3/3=8.43
Within SSW=47.4 MSW=47.4/16=3
N-k=20-4=16
groups
Total SSB+SSW=123.2 N-1=20-1=19

N.B: If the between-groups variance is approximately equal to the within-


group variance, we conclude that there is no diet effect.
And therefore your ratio will be close to 1

20
■ Procedures for hypothesis
testing
à Determine critical value

To determine appropriate critical value


of F:

à df1=k-1 =3

à df2=N-k=20-4=16

à The critical F value is 3.24

•The F statistic follows a skewed


distribution, with two sets of degrees
of freedom.
•There is a family of F distributions,
one for each pair of dfs.

21
■ Procedures for hypothesis testing
à Set up the decision rule

Reject Ho if F ≥ Fcritical
àIf F ≥ 3.24

We reject Ho because 8.43>3.24

à Statistically significant evidence at α=0.05 to show that


there is a difference in mean weight loss among the four diets.

ANOVA technique is usually performed using statistical computing


software to produce the ANOVA table in addition to the exact p-value.

22

You might also like