Analysis of variance, (with and without repeated measures)

AngeloAngeles17 18 views 68 slides Sep 13, 2024
Slide 1
Slide 1 of 68
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68

About This Presentation

Analysis of variance (ANOVA)


Slide Content

Analysis of Variance ANOVA

When to use ANOVA? Analysis of variance tests whether there are statistically significant differences between three or more samples.

Types of Analysis of Variance

EXAMPLE Suppose you are studying the effectiveness of three different drugs (Drug A, Drug B, and Drug C) in reducing blood pressure. You randomly assign 90 patients to one of the three drug groups and measure their blood pressure after one month of treatment. The blood pressure measurements (in mmHg) for each patient are as follows:

EXAMPLE In this dataset, each drug group represents a separate treatment or condition, and the blood pressure measurements for each patient in that group are recorded. To analyze this dataset using ANOVA, you would compare the means of the blood pressure measurements among the three drug groups to determine if there is a statistically significant difference.

Is there a difference in the population between the different groups of the independent variable with respect to the dependent variable.

Assumptions of the one-way analysis of variance. For a one-way ANOVA to be calculated, the following conditions must be met: 1. Level of scale The scale level of the dependent variable should be metric; that of the independent variable nominally scaled.

Assumptions of the one-way analysis of variance. 2. Independence The measurements should be independent, i.e. the measured value of one group should not be influenced by the measured value of another group.

Assumptions of the one-way analysis of variance. 3. Homogeneity The variances in each group should be approximately equal. This can be checked with the Levene test.

Assumptions of the one-way analysis of variance. 4. Normal distribution The data within the groups should be normally distributed.

What if the prerequisites are not met? 

If the scale level of the dependent variable is not metric and not normally distributed, then the  Kruskal-Wallis test  can be used. If the data is a  dependent sample , then  analysis of variance with repeated measures  must be used.

How to calculate one-way analysis of variance.

SAMPLE PROBLEM Researchers want to test a new anti-anxiety medication. They split participants into three conditions (0mg, 50mg, and 100mg), and then asked them to rate their anxiety level on a scale of 1-10. Are there any differences between the three conditions using alpha = 0.05?

SAMPLE PROBLEM 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2

ONE-WAY ANOVA Define Null and Alternative Hypotheses. Calculate Degrees of Freedom State Decision Rule Calculate the test statistic State Results State the Conclusion

ONE-WAY ANOVA Define Null and Alternative Hypotheses. 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 H ; μ 0mg = μ 50mg = μ 100mg H 1 ; not all μ’s are equal

ONE-WAY ANOVA 2. Calculate Degrees of Freedom N = 21 n = 7 df Between = a -1 df Within = N - a df TOTAL = N - 1 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 3 – 1 = 2 21 - 3 = 18 21 - 1 = 20

ONE-WAY ANOVA 3.State Decision Rule 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 If F is greater than 3.5546 , reject the null hypothesis.

ONE-WAY ANOVA Calculate the test statistic 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS df MS F Between Within Total

ONE-WAY ANOVA Calculate the test statistic 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS df MS F Between 2 Within 18 Total 20

ONE-WAY ANOVA Calculate the test statistic 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS(between) SS(within) SS(total) SS between =   0mg group: 9 + 8 + 7 + 8 + 8 + 9 + 8 = 57 50mg group: 7 + 6 + 6 + 7 + 8 + 7 + 6 = 47 100mg group: 4 + 3 + 2 + 3 + 4 + 3 + 2 = 21

ONE-WAY ANOVA Calculate the test statistic SS(between) SS(within) SS(total) SS between =   0mg group: 9 + 8 + 7 + 8 + 8 + 9 + 8 = 57 50mg group: 7 + 6 + 6 + 7 + 8 + 7 + 6 = 47 100mg group: 4 + 3 + 2 + 3 + 4 + 3 + 2 = 21

ONE-WAY ANOVA Calculate the test statistic SS(between) SS(within) SS(total) SS between =   0mg group: 9 + 8 + 7 + 8 + 8 + 9 + 8 = 57 50mg group: 7 + 6 + 6 + 7 + 8 + 7 + 6 = 47 100mg group: 4 + 3 + 2 + 3 + 4 + 3 + 2 = 21

ONE-WAY ANOVA Calculate the test statistic SS(between) SS(within) SS(total) SS between =   0mg group: 9 + 8 + 7 + 8 + 8 + 9 + 8 = 57 50mg group: 7 + 6 + 6 + 7 + 8 + 7 + 6 = 47 100mg group: 4 + 3 + 2 + 3 + 4 + 3 + 2 = 21

ONE-WAY ANOVA Calculate the test statistic SS(between) SS(within) SS(total) SS between =   = 98.67

ONE-WAY ANOVA Calculate the test statistic SS(between) SS(within) SS(total) SS within =   0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2

ONE-WAY ANOVA Calculate the test statistic SS(between) SS(within) SS(total) SS within =   0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 9 2 + 8 2 + 7 2 + 8 2 + 8 2 + 9 2 + 8 2 7 + 6 2 + 6 2 + 7 2 + 8 2 + 7 2 + 6 2 +4 2 + 3 2 + 2 2 + 3 2 + 4 2 + 3 2 + 2 2 = 853  

ONE-WAY ANOVA Calculate the test statistic SS(between) SS(within) SS(total) SS within =   9 2 + 8 2 + 7 2 + 8 2 + 8 2 + 9 2 + 8 2 7 + 6 2 + 6 2 + 7 2 + 8 2 + 7 2 + 6 2 +4 2 + 3 2 + 2 2 + 3 2 + 4 2 + 3 2 + 2 2 = 853   = 10. 29

ONE-WAY ANOVA Calculate the test statistic SS(between) SS(within) SS(total) SS total =   Ss total = 853 -   = 108.95

ONE-WAY ANOVA Calculate the test statistic 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS df MS F Between 98.67 2 Within 10.29 18 Total 108.95 20

ONE-WAY ANOVA Calculate the test statistic 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS df MS F Between 98.67 2 Within 10.29 18 Total 108.95 20 F =   MS between =   = 49.34 MS within =   = 0.57

ONE-WAY ANOVA Calculate the test statistic 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS df MS F Between 98.67 2 49.34 Within 10.29 18 0.57 Total 108.95 20 F =   = 86.56

ONE-WAY ANOVA Calculate the test statistic 0mg 50mg 100mg 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS df MS F Between 98.67 2 49.34 86.56 Within 10.29 18 0.57 Total 108.95 20 F =   = 86.56

ONE-WAY ANOVA State Decision Rule If F is greater than 3.5546 , reject the null hypothesis. F = 86.56 Result: REJECT the Null Hypothesis

ONE-WAY ANOVA State the Conclusion The three conditions differed significantly on anxiety level , F (2, 18) = 86.56 , p < 0.05.

PRACTICE PROBLEM Groups of students were randomly assigned to be taught using four different teaching techniques. They were tested at the end of a specified time. Because of dropouts in the experimental groups, the number of students varied from group to group. Do the following data present sufficient evidence to indicate a difference in the mean achievement for students taught using the four teaching techniques?

TECHNIQUES A B C D 65 75 59 94 87 69 78 89 73 83 67 80 79 81 62 88 81 72 83 69 79 76 90

ONE-WAY ANOVA Define Null and Alternative Hypotheses. H ; μ A = μ B = μ C = μ D H 1 ; not all μ’s are equal

ONE-WAY ANOVA 2. Calculate Degrees of Freedom N = n = df Between = a -1 df Within = N - a df TOTAL = N - 1

ONE-WAY ANOVA 2. Calculate Degrees of Freedom N = 23 n = 7 df Between = a -1 df Within = N - a df TOTAL = N - 1

Analysis of Variance Repeated Measures

ANOVA The Repeated-Measures ANOVA is almost identical to the One-Way ANOVA, except for one additional calculation we must perform to account for the shared variability.

SAMPLE PROBLEM Researchers want to test a new anti-anxiety medication. They measured the anxiety of 7 participants three times: once before taking the medication, once one week after taking the medication, and once two weeks after taking the medication. Anxiety is rated on a scale of 1-10, with 10 being “high anxiety” and 1 being “low anxiety”. Are there any differences between the three conditions using alpha = 0.05?

SAMPLE PROBLEM Before Week 1 Week 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2

REPEATED MEASURES - ANOVA Define Null and Alternative Hypotheses. Calculate Degrees of Freedom State Decision Rule Calculate the test statistic State Results State the Conclusion

REPEATED MEASURES - ANOVA Define Null and Alternative Hypotheses. H ; μ before = μ week 1 = μ week 2 H 1 ; not all μ’s are equal

REPEATED MEASURES ANOVA 2. Calculate Degrees of Freedom df Between = a -1 df Within = N - a df Subjects = s – 1 df Error = df within – df subjects df TOTAL = N - 1 Before Week 1 Week 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 N = 21 s = 7 3-1 = 2 21 - 3 = 18 7-1 = 6 21-1 = 20 18 – 6 = 12

REPEATED MEASURES ANOVA 3.State Decision Rule To look up the critical value, we need to use two different degrees of freedom. Before Week 1 Week 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 df Between = 2 df Error = 12

REPEATED MEASURES ANOVA 3.State Decision Rule If F is greater than 3.8853, reject the H0 Before Week 1 Week 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 df Between = 2 df Error = 12

ONE-WAY ANOVA Calculate the test statistic SS df MS F Between Within - subjects - Error Total Before Week 1 Week 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2

REPEATED MEASURES ANOVA Calculate the test statistic SS df MS F Between 2 Within 18 - subjects 6 - Error 12 Total 20 Before Week 1 Week 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2

REPEATED MEASURES ANOVA Calculate the test statistic Before Wk 1 Wk 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS Between SS Within SS Subjects SS Error SS Total SS between =  

REPEATED MEASURES ANOVA Calculate the test statistic Before Wk 1 Wk 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS Between SS Within SS Subjects SS Error SS Total SS between =   Before Group: 9 + 8 + 7 + 8 + 8 + 9 + 8 = 57 Week 1 Group: 7 + 6 + 6 + 7 + 8 + 7 + 6 = 47 Week 2 Group: 4 + 3 + 2 + 3 + 4 + 3 + 2 = 21

REPEATED MEASURES ANOVA Calculate the test statistic Before Wk 1 Wk 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS Between SS Within SS Subjects SS Error SS Total SS between =   Before Group: 9 + 8 + 7 + 8 + 8 + 9 + 8 = 57 Week 1 Group: 7 + 6 + 6 + 7 + 8 + 7 + 6 = 47 Week 2 Group: 4 + 3 + 2 + 3 + 4 + 3 + 2 = 21

REPEATED MEASURES ANOVA Calculate the test statistic Before Wk 1 Wk 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS Between SS Within SS Subjects SS Error SS Total SS between =   Before Group: 9 + 8 + 7 + 8 + 8 + 9 + 8 = 57 Week 1 Group: 7 + 6 + 6 + 7 + 8 + 7 + 6 = 47 Week 2 Group: 4 + 3 + 2 + 3 + 4 + 3 + 2 = 21 = 98.67

REPEATED MEASURES ANOVA Calculate the test statistic SS(between) SS(within) SS(total) SS within =   9 2 + 8 2 + 7 2 + 8 2 + 8 2 + 9 2 + 8 2 7 2 + 6 2 + 6 2 + 7 2 + 8 2 + 7 2 + 6 2 +4 2 + 3 2 + 2 2 + 3 2 + 4 2 + 3 2 + 2 2 = 853   Before Wk 1 Wk 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2

REPEATED MEASURES ANOVA Calculate the test statistic SS(between) SS(within) SS(total) 9 2 + 8 2 + 7 2 + 8 2 + 8 2 + 9 2 + 8 2 7 2 + 6 2 + 6 2 + 7 2 + 8 2 + 7 2 + 6 2 +4 2 + 3 2 + 2 2 + 3 2 + 4 2 + 3 2 + 2 2 = 853   Before Wk 1 Wk 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS within = = 10.29  

REPEATED MEASURES ANOVA Calculate the test statistic SS(between) SS(within) SS(subjects) Subject One = 9 + 7 + 4 = 20 Subject Two = 8 + 6 + 3 = 17 Subject Three = 7 + 6 + 2 = 15 Subject Four = 8 + 7 + 3 = 18 Subject Five = 8 + 8 + 4 = 20 Subject Six = 9 + 7 + 3 = 19 Subject Seven = 8 + 6 + 2 = 16 Before Wk 1 Wk 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS subjects =  

REPEATED MEASURES ANOVA Calculate the test statistic SS(between) SS(within) SS(subjects) Subject One = 9 + 7 + 4 = 20 Subject Two = 8 + 6 + 3 = 17 Subject Three = 7 + 6 + 2 = 15 Subject Four = 8 + 7 + 3 = 18 Subject Five = 8 + 8 + 4 = 20 Subject Six = 9 + 7 + 3 = 19 Subject Seven = 8 + 6 + 2 = 16 Before Wk 1 Wk 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 SS subjects =  

REPEATED MEASURES ANOVA Calculate the test statistic SS(between) SS(within) SS(subjects) Subject One = 9 + 7 + 4 = 20 Subject Two = 8 + 6 + 3 = 17 Subject Three = 7 + 6 + 2 = 15 Subject Four = 8 + 7 + 3 = 18 Subject Five = 8 + 8 + 4 = 20 Subject Six = 9 + 7 + 3 = 19 Subject Seven = 8 + 6 + 2 = 16 SS subjects =   = 7.62

REPEATED MEASURES ANOVA Calculate the test statistic SS df MS F Between 98.67 2 Within 10.29 18 - subjects 7.62 6 - Error 12 Total 20 Before Week 1 Week 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2

REPEATED MEASURES ANOVA Calculate the test statistic SS df MS F Between 98.67 2 Within 10.29 18 - subjects 7.62 6 - Error 12 Total 20 ERROR = Within – Subjects = 10.29 – 7.62 = 2.67

REPEATED MEASURES ANOVA Calculate the test statistic SS df MS F Between 98.67 2 Within 10.29 18 - subjects 7.62 6 - Error 2.67 12 Total 108.96 20 ERROR = Within – Subjects = 10.29 – 7.62 = 2.67

REPEATED MEASURES ANOVA Calculate the test statistic SS df MS F Between 98.67 2 Within 10.29 18 - subjects 7.62 6 - Error 2.67 12 Total 108.96 20 F =   MS between =   MS error = = 0.22  

REPEATED MEASURES ANOVA Calculate the test statistic SS df MS F Between 98.67 2 49.34 224.27 Within 10.29 18 - subjects 7.62 6 - Error 2.67 12 0.22 Total 108.96 20 F =   MS between =   MS error = = 0.22   F =  

REPEATED MEASURES ANOVA S tate the result If F is greater than 3.8853, reject the H0 Before Week 1 Week 2 9 7 4 8 6 3 7 6 2 8 7 3 8 8 4 9 7 3 8 6 2 F = 224.27 Reject the H0

REPEATED MEASURES ANOVA State the Conclusion The three conditions differed significantly on anxiety level , F (2, 12) = 224.27 , p < 0.05.