You are on page 1of 34

Lecture/Lab 4 :

Comparison of Means (ANOVA), and


Medians (Kruskal-Wallis Test)
Introduction

The main purpose of this lab is to learn when, why, and how to perform
One-Way ANOVA, and how to correctly interpret the results.
One-Way ANOVA
Is used when comparing the averages of a quantitative variable
between more than two groups
Is an extension of Two- Independent Samples t-Test
Involves one quantitative and one qualitative (more than two
categories) variables
 Assumptions:

• Independent samples: The samples must be independent of each other

• Normality: The quantitative variable is normally distributed in each

group
• Homogeneity of variance (equality of variances): The within-group

variances are the same for each of the groups


 One-Way ANOVA

 The null hypothesis

The population means of the all groups are the same

H :    
o 1 2 3

 The alternative hypothesis:

The population means of at least two groups are different

H a
: not All  are equal
 Decision rule for ANOVA:

 If the decision is to reject the null hypothesis, then at least one of

the means is different. However, the ANOVA does not tell us


where the difference lies. Further investigation using Post Hoc
Multiple Comparisons test (such as Tukey) is needed to identify
where the group differences lie.
 A significant ANOVA should be followed by the result of a Post

Hoc Multiple Comparisons test (Tukey)


 Scenario when you would use ANOVA:
• A researcher wishes to see whether there is any difference in the weight gains of
athletes following one of three special diet.
• Three different relaxation techniques are given to a randomly selected patients
in effort to reduce their stress levels
Evidence or Proof

• If p-value ≤ 0.05, we reject the null hypothesis

P-value (Sig.)
• If p-value > 0.05, we fail to reject the null hypothesis

• If CI includes the value of zero, we fail to reject the null hypothesis

(Check to see if the interval goes from negative to positive )


Confidence Interval (CI)
• If CI does not include the value of zero, we reject the null
hypothesis
Example. Is the mean baseline systolic blood pressure different for people
with different categories of BMI?

Since we have one quantitative and one qualitative (more than two categories)
variables, One-Way ANOVA should be used to answer this research question.
Example: Is the mean baseline systolic blood pressure different
for people with different categories of BMI at baseline?

• Since we have one quantitative and one qualitative ( more than two
categories) variables, One-Way ANOVA should be used to answer this
research question.

What kind of a variable is BMI at baseline in this case?


 Qualitative ( 3 groups only)

Hypothesis:

H :      
o 1 2 3 4 H a
: not All  are equal
 To Obtain One-Way Analysis of Variance (ANOVA):

From the menus choose:


Analyze Compare Means One-Way ANOVA
Select baseline systolic blood pressure as the dependent variable
Select BMI categories as the factor variable Under
POST HOC option, select Tukey (used to know which groups are
different) Under options, select descriptive Click
continue then ok
Note: The factor variable is always the qualitative variable while
Assessing the Assumption of Normality:
Use explore function
Make sure to check that you have enough sample size in each group
Check for Outliers
SPSS Output

Since the p-value for Levene’s test is


not significant, we will assume the
variances are equal.
Since the p-value (<0.001) for ANOVA is
significant (<0.05), we conclude that there is a
significant difference in means between the
groups
SPSS Post Hoc Test outputs

Since the p-value is significant,


The mean difference between we conclude that the means of all
group 1 vs 2, group vs 3, and groups are significantly different
group 2 vs 3 from each other
Means Plots
Summary Table:

P-value
N Mean Std. Deviation
(Sig.)

Normal 102 120.22 15.94


BMI Categories Over weight 165 129.80 17.46 <0.001
Obese 140 136.47 17.67
Dependent variable: Systolic blood pressure at baseline
F (2, 404) = 26.44, p-value <0.001

Decision:

√ Reject

Since P-value less than alpha = 0.05, we reject the null hypothesis.

Conclusion (Interpretation):

• The mean baseline systolic blood pressure is statistically different for people with different categories of BMI.
• Tukey multiple comparisons test indicated that the average baseline systolic blood pressure is different for all BMI
categories at baseline.
If the assumption not met

Use Kruskal-Wallis Test


Kruskal-Wallis Test
Example: Is there a statistically significant difference in glucose
levels after 6 weeks between the marital status groups ?

Hypotheses: Ho: median 1 = median 2 =median 3 =median 4

HA: at least one median is different


Explore glucose at baseline variable
 Kruskal-Wallis Test in SPSS

From the menus choose:


Analyze Nonparametric Tests Independent Samples
Reporting the results for a Kruskal-Wallis Test
Levels of Marital status
Single Married Divorced Widowed P-
Characteristics
value*
n= 17 n=332 n=33 n=24
Glucose Levels after 6 weeks, mg/dl [Median 5 ( 3.9 - 6.8)
5 ( 3.8 – 13.7) 4.9(4.1- 11.8) 5.1(4.5 - 12.6) 0.043
(Min. - Max.)]
Kruskal Wallis Test
*

 Decision:  Reject

Since P-value ≤ 0.05, we reject the null hypothesis.


 Interpretation:

“The Kruskal-Wallis test indicated that there is a statistically significant difference in the
distribution of glucose levels after 6 weeks between the 4 groups of marital status; Post Hoc
testing indicate that the statistical difference is between divorced and widowed groups
In-class Assignment
Using CHIP_407 dataset; Is the mean baseline pulse rate
different for people with different categories of BMI at
baseline?
 Null and alternative hypotheses
 Assumptions
 Descriptive table
 Test for homogeneity of variances table
 ANOVA table
 Multiple comparisons table
 Summary table
 Conclusion/interpretation
Thank you

You might also like