Lect 11_EN
Transcript of Lect 11_EN
-
7/30/2019 Lect 11_EN
1/15
Research Methodology: Tools
Applied Data Analysis (with SPSS)
Lecture 11: Repeated Measures ANOVA / ANCOVA
May 2011
Prof. Dr. Jrg Schwarz [email protected]
MSc Business Administration
Slide 2
Contents
Aims ___________________________________________________________________________________________________ 5Introduction _____________________________________________________________________________________________ 6Outline ________________________________________________________________________________________________ 13Concepts of repeated measures ANOVA / ANCOVA ___________________________________________________________ 14ANOVA with SPSS: Two detailed examples __________________________________________________________________ 19
-
7/30/2019 Lect 11_EN
2/15
Slide 3
Table of contents
Aims ___________________________________________________________________________________________________ 5Aims of the lecture .................................................................................................................................................................................................5
Introduction _____________________________________________________________________________________________ 6Example 1 ..............................................................................................................................................................................................................6Example 2 ..............................................................................................................................................................................................................9
Outline ________________________________________________________________________________________________ 13Concepts of repeated measures ANOVA / ANCOVA ___________________________________________________________ 14Repeated measures ANOVA................................................................................................................................................................................14ANCOVA..............................................................................................................................................................................................................15Homogeneity of variances....................................................................................................................................................................................16
Case of between-group ANOVA................................................................................................................................................................................................16Case of repeated measures ANOVA.........................................................................................................................................................................................17
Covariate..............................................................................................................................................................................................................18
Slide 4
ANOVA with SPSS: Two detailed examples __________________________________________________________________ 19Repeated measures ANOVA (Dataset Diet1.sav) ................................................................................................................................................19
SPSS Elements: .......................................................................................................................19How to define repeated measures.............................................................................................................................................................................................20SPSS Output ANOVA (Diet1) Mauchly's Test of Sphericity ...................................................................................................................................................21SPSS Output ANOVA (Diet1) Tests of Within-Subjects Effects.............................................................................................................................................22SPSS Output ANOVA (Diet1) Tests of Between-Subjects Effects .........................................................................................................................................23SPSS Output ANOVA (Diet1) Contrasts.................................................................................................................................................................................24SPSS Output ANOVA (Diet1) Multivariate Tests ....................................................................................................................................................................25
ANCOVA (Dataset Diet2.sav)...............................................................................................................................................................................26SPSS Elements: ........................................................................................................................................26SPSS Output ANOVA (Diet2) Tests of Between-Subjects Effects .........................................................................................................................................27Homogeneity of regression........................................................................................................................................................................................................28Specify custom model................................................................................................................................................................................................................29Homogeneity of regression Output .........................................................................................................................................................................................30
-
7/30/2019 Lect 11_EN
3/15
Slide 5
Aims
Aims of the lecture
You will understand the key steps in conducting a repeated measures ANOVA / ANCOVA.
You will understand the concept of repeated measures ANOVA / ANCOVA.
You will understand the concept of homogeneity of variances.
You will understand the concept of homogeneity of regression.
You can conduct a repeated measures ANOVA / ANCOVA with SPSS.
In particular, you will know how to
interpret the output
Mauchly's Test of sphericitycontrasts
check of homogeneity of regression
describe the output
Slide 6
Introduction
Example 1 Repeated Measures ANOVA
Medical research: Effect on body weight of a diet over 5 weeks. (Dataset: Diet1.sav)
Typical questions
Is the diet effective?
Does it affect men and women differently?
15 women
15 men
all
Bodyweight[kg]
-
7/30/2019 Lect 11_EN
4/15
-
7/30/2019 Lect 11_EN
5/15
Slide 9
Example 2 ANCOVA
Medical research: Effect of 3 different types of diet on body weight.
Each type of diet was tested on a subsample of 5 randomly allocated overweight men.
6
7
8
9
10
11
12
13
14
15
1 2 3
Weightreduction[kg]
Type of diet
Dataset (Diet2.sav)
Sample of n = 15 overweight men
Variables for
type of diet (1,2,3) (diet)
weight reduction (kg) (reduction)
weight before diet (kg) (weight)
Typical questions
Is there an impact of the type of diet?
What is the influence of the initial weight?
Slide 10
The Result Impact of type of diet
Significant ANOVA model ("Corrected Model" with p =.000).
Significant variable diet
There is a main effect of diet (types 1, 2, 3) on weight reduction (F(2, 12) = 20.812 p = .000).
The value of Partial Eta Squared = .776 shows that 78% of the variation can be explained by the
variable diet (all other variables fixed).
-
7/30/2019 Lect 11_EN
6/15
Slide 11
What is the influence of weight before diet?
6
7
8
9
10
11
12
13
14
15
80 85 90 95 100 105 110 115
It seems that "weight before diet" and
"weight reduction" are related.
The greater weight before diet, the more
weight reduction is possible.
This relation should also be modeled.
"Weight before diet" is a metric variable.
Enter the variable weightas a so called
covariate into the model.
Weightreduction[kg]
Weight before diet [kg]
Slide 12
The Result Impact of type of diet plus weight before diet as covariate
There is a main effect of diet (types 1, 2, 3) on weight reduction (F(2, 11) = 25.017 p = .000).
The value of Partial Eta Squared = .820 shows that 82% of the variation can be explained by the
variable diet (all other variables fixed).
There is also a significant effect of the covariate weight (F(1, 11) = 6.659 p = .026).
The constant ("Intercept") is no more significant (p = .542).This is due to the covariate which "binds" the variation of the intercept.
The impact of diet is higher (2 = 82% vs. 2 = 78%) after controlling for the effects of weight
before diet. The model is more "selective" respecting the main effect.
-
7/30/2019 Lect 11_EN
7/15
Slide 13
Outline
Basic situation for repeated measures ANOVA
Given: One dependent metric scaled variable which is measured multiple and many
independent variables with categorical scales.
Task: Find a relationship between the characteristics.
Analysis of repeated measures ANOVA Statistical method is the same as in analysis of variance.
The repeated measures model can test the main effects of within-subjects factors likesubsequent measurement times or different treatments.
Basic situation for ANCOVA
Given: One dependent variable with metric scale and many independent variables with categori-
cal scales. Included is a metric scaled independent variable.
Task: Find a relationship between the characteristics.
Analysis of Covariance (ANCOVA)
Controls for the effects of the metric scaled independent variable that covaries with thedependent variable.
The metric scaled independent variable is called "covariate" or "control variable".
Slide 14
Concepts of repeated measures ANOVA / ANCOVA
Repeated measures ANOVA
Repeated measures
General term for a study in which multiple measurements are applied to the same subject
Can be several measurements over time or multiple treatments (e.g. Drug A, B, C)
Advantages
Source of variability between subjects is excluded from the experimental error
Less participants are neededThis will be important if only a few subjects are available for the experiment
Disadvantages
Carry-over effects (outcome is influenced by previous treatment in an unwanted way) Example: Subject changes his opinion on certain issues.
Order effects (outcome depends on the order of treatment)
Example: The order "treatment A > B" is different to "treatment B > A"
-
7/30/2019 Lect 11_EN
8/15
Slide 15
ANCOVA
Design of experiment
At least one categorical variable (called factor) and one metric variable (called covariate)
Blending of regression and ANOVA
ANCOVA is used for different purposes
Experiment: to control for factors that cannot be randomized but that can bemeasured on an metric scale
Survey: to remove the effects of metric variables modifying the relationship of thecategorical independents to the dependent variable
In general, the covariate is considered to be a control variable
Advantages
Irrelevant variability can be reduced ("controlled")
Disadvantages If the covariate is correlated with the factors, then its inclusion will lead to an underestimation
of the effect of the treatment factors
Slide 16
Homogeneity of variances
Case of between-group ANOVA
Back to the requirements of ANOVA in Lecture 10
3. Homogeneity of variances
Residuals (= Error) have constant variance
Correction => weight variances
Nurse example: Use homogeneity test
p < .050 => no constant variance
Weight with an appropriate variable
Nurse example of lecture 10
Homogeneity test "Options"
-
7/30/2019 Lect 11_EN
9/15
Slide 17
Case of repeated measures ANOVA
Requirements of repeated measures ANOVA ("Compound Symmetry")
1. Residuals (= Error) have constant variance
=> the same as in lecture 10 "3. Homogeneity of variances"
2. Correlations between treatments are equal
Assumption of sphericity ("Sphrizitt")
Sphericity is a less restrictive form of compound symmetry
Technical implementation: A test whether variances of the differences between each pair of
treatment outcome are equal (=> at least three levels of treatment are needed)
Example (Diet1)
Calculate differences of scores between weeks 2 and 3,
and weeks 3 and 4. Variances of the differences of the
first pair must be the same as those of the second pair, etc.
Sphericity is measured using Mauchly's Test.
p > 0.05 => Sphericity is met
p < 0.05 => Sphericity is violated
If Mauchly's Test shows violation of sphericity, this may be compensated by an adjustment.
66
68
70
72
74
76
78
80
82
0 1 2 3 4 5 6
Slide 18
Covariate
To control for metric variable x, introduce an additional (regression) term into the linear model.
(In example 2 the metric variable x is weight before diet)
gk g g gk gky y x= + + +
g
gk
y grand mean
effect of group g
random term
=
=
=
g
gk
Additional term
slope of covariate of group g
x covariate
=
=
Homogeneity of regression
ANCOVA demands that homogeneity of regression exists.
=> For each level of the covariate xg., the slope g must be equal.
The null hypothesis (H0) to verify is that all regression coefficients g have the same value
The alternative hypothesis (HA) is that this is not the case
H0: 1 = 2 = = G (= )
HA: at least two coefficients are not equal
-
7/30/2019 Lect 11_EN
10/15
Slide 19
ANOVA with SPSS: Two detailed examples
Repeated measures ANOVA (Dataset Diet1.sav)
SPSS Elements:
Variables week1, week2, week5 are repeated measures of body weight
Define a name for a virtual Within-Subject-Factor
For example "week"
Enter the number of repetitions (called "levels")
This example: 5 for week1 to week5
Slide 20
How to define repeated measures
Allocate each week variable to its level
-
7/30/2019 Lect 11_EN
11/15
Slide 21
SPSS Output ANOVA (Diet1) Mauchly's Test of Sphericity
Mauchly's Test is significant with p = .010 => sphericity is not given
How to proceed if Mauchly's Test is significant: If Epsilon in Greenhouse-Geisser < .75 => correction as per Greenhouse-Geisser
If Epsilon in Greenhouse-Geisser > .75 => correction as per Huynh-Feldt
Slide 22
SPSS Output ANOVA (Diet1) Tests of Within-Subjects Effects
This is the first of two main tables
The time elapsed (week 1, week 2, ) has a significant influence on body weight
(F(2.792, 78.175) = 178.349 p = .000, correction as per Greenhouse-Geisser).
The duration of the diet explains 86% of the variance.
There is also an interaction of time elapsed and sex on body weight
(F(2.792, 78.175) = 75.165 p = .000, correction as per Greenhouse-Geisser).
The interaction term explains 73% of the variance.
-
7/30/2019 Lect 11_EN
12/15
-
7/30/2019 Lect 11_EN
13/15
Slide 25
SPSS Output ANOVA (Diet1) Multivariate Tests
This is an alternative to the test of "within-subjects effects" if sphericity is not given.
It is part of the MANOVA procedure, which makes no assumptions as regards sphericity.
The Multivariate Tests table provides F tests of the within-subjects factor week
and the interaction with the between-subjects grouping factor sex.
Wilks' lambda is the most commonly reported
Usually the same substantive conclusion emerges from any variant.
Slide 26
ANCOVA (Dataset Diet2.sav)
SPSS Elements:
-
7/30/2019 Lect 11_EN
14/15
Slide 27
SPSS Output ANOVA (Diet2) Tests of Between-Subjects Effects
There is a main effect of diet (types 1, 2, 3) on weight reduction (F(2, 11) = 25.017 p = .000).
The value of Partial Eta Squared = .820 shows that 82% of the variation can be explained by the
variable diet (all other variables fixed).
There is also a significant effect of the covariate weight (F(1, 11) = 6.659 p = .026).
The constant ("Intercept") is no more significant (p = .542).
The covariate "binds" the variation due to the intercept.
The impact of diet is higher (2 = 82% vs. 2 = 78% without covariate) after controlling for the ef-
fects of weight before diet. The model is more "selective" respecting the main effect.
Slide 28
Homogeneity of regression
Are the slopes g between weight before diet and weight reduction equal for all levels of diet?
6
7
8
9
10
11
12
13
14
15
80 85 90 95 100 105 110 115
6
7
8
9
10
11
12
13
14
15
80 85 90 95 100 105 110 115
6
7
8
9
10
11
12
13
14
15
80 85 90 95 100 105 110 115
Use a modification of the ANCOVA to quick-check whether the slopes g are equal.
6
7
8
9
10
11
12
13
14
15
80 85 90 95 100 105 110 115
all diets
diet 1 diet 2 diet 3
-
7/30/2019 Lect 11_EN
15/15
Slide 29
Specify custom model
Allocate main effects
Allocate interaction term
Slide 30
Homogeneity of regression Output
If the interaction term of a main factor and a covariate is significant,
the assumption of homogeneity of regression is violated.
Here the interaction term is not significant=> homogeneity of regression is given
=> the covariate weight(weight before diet) may be introduced into the model.