Analysis of variance, (with and without repeated measures)
AngeloAngeles17
18 views
68 slides
Sep 13, 2024
Slide 1 of 68
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
About This Presentation
Analysis of variance (ANOVA)
Size: 650.62 KB
Language: en
Added: Sep 13, 2024
Slides: 68 pages
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?
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 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?
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(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.