Download presentation
Presentation is loading. Please wait.
Published byLewis Robertson Modified over 8 years ago
1
Previous Lecture: Phylogenetics
2
Analysis of Variance This Lecture Judy Zhong Ph.D.
3
Learning Objectives Until now, we have considered two groups of individuals and we've wanted to know if the two groups were sampled from distributions with equal population means or medians. Suppose we would like to consider more than two groups of individuals and, in particular, test whether the groups were sampled from distributions with equal population means. How to use one-way analysis of variance (ANOVA) to test for differences among the means of several populations ( “groups”)
4
Hypotheses of One-Way ANOVA All population means are equal No treatment effect (no variation in means among groups) At least one population mean is different There is a treatment effect Does not mean that all population means are different (some pairs may be the same)
5
One-Factor ANOVA All means are the same: The null hypothesis is true (No treatment effect)
6
One-Factor ANOVA At least one mean is different: The null hypothesis is NOT true (Treatment effect is present) or (continued)
7
One-Way ANOVA: Model Assumptions The K random samples are drawn from K independent populations The variances of the populations are identical The underlying data are approximately normally distributed
8
Basic Idea partitioning the variation Suppose there are K groups with observations. Deviation of group mean from grand mean Deviation of observations from group mean
9
Partitioning the variation Total variation (total SS) Variation due to random sampling (within SS) Variation due to factor (between SS) Total variation is the sum of Within-group variability and Between- group variability Deviation of observations from group mean (within group variability) Deviation of observations from overall mean (between group variability)
10
Partitioning the variation
11
Group 1Group 2Group 3 Response, X Group 1Group 2Group 3 Response, X If Between group variability is large and Within group variability is small => reject Ho If Between group variability is small and Within group variability is large => accept Ho Basic Idea of ANOVA
12
Partition of Total Variation Variation Due to Factor (Between SS) Variation Due to Random Sampling (Within SS) Total Variation (total SS) Commonly referred to as: Sum of Squares Within Sum of Squares Error Sum of Squares Unexplained Within-Group Variation Commonly referred to as: Sum of Squares Between Sum of Squares Among Sum of Squares Explained Among Groups Variation = + d.f. = n – 1 d.f. = k – 1d.f. = n – k
13
Total Sum of Squares Where: Total SS = Total sum of squares k = number of groups (levels or treatments) n j = number of observations in group j y ij = i th observation from group j = grand mean (mean of all data values) Total SS = Between SS + Within SS
14
Total Variation
15
Between-Group Variation Group 1Group 2Group 3 Response, X
16
Within-Group Variation (continued)
17
Obtaining the Mean Squares
18
One-Way ANOVA Table Source of Variation dfSS MS (Variance) Between Groups B SS BMS = Within Groups n - kW SSWMS = Totaln - 1 TSS = BSS+WSS k - 1 BMS WMS F ratio k = number of groups n = sum of the sample sizes from all groups df = degrees of freedom BSS k - 1 WSS n - k F =
19
One-Way ANOVA F Test Statistic Test statistic Degrees of freedom df 1 = k – 1 (k = number of groups) df 2 = n – k (n = sum of sample sizes from all populations)
20
Interpreting One-Way ANOVA F Statistic The F statistic is the ratio of the among estimate of variance and the within estimate of variance The ratio must always be positive df 1 = k -1 will typically be small df 2 = n - k will typically be large Decision Rule: Reject H 0 if F > F U Otherwise do not reject H 0 0 =.05 Reject H 0 Do not reject H 0 FUFU
21
Example You want to see if three different golf clubs yield different distances. You randomly select five measurements from trials on an automated driving machine for each club. At the 0.05 significance level, is there a difference in mean distance? Club 1 Club 2 Club 3 254 234 200 263 218 222 241 235 197 237 227 206 251 216 204
22
Example 270 260 250 240 230 220 210 200 190 Distance Club 1 Club 2 Club 3 254 234 200 263 218 222 241 235 197 237 227 206 251 216 204 Club 1 2 3
23
Example Club 1 Club 2 Club 3 254 234 200 263 218 222 241 235 197 237 227 206 251 216 204 Y 1 = 249.2 Y 2 = 226.0 Y 3 = 205.8 Y = 227.0 n 1 = 5 n 2 = 5 n 3 = 5 n = 15 k = 3 B SS = 5 (249.2 – 227) 2 + 5 (226 – 227) 2 + 5 (205.8 – 227) 2 = 4716.4 W SS = (254 – 249.2) 2 + (263 – 249.2) 2 +…+ (204 – 205.8) 2 = 1119.6 BMS = 4716.4 / (3-1) = 2358.2 WMS = 1119.6 / (15-3) = 93.3
24
Test Statistic: Decision: Conclusion: 0 =.05 F U = 3.89 Reject H 0 Do not reject H 0 Critical Value: F U = 3.89 Example H 0 : µ 1 = µ 2 = µ 3 H 1 : µ j not all equal 0.05 df 1 = 2, df 2 = 12 Table 9: Critical Value=2.052
25
Test Statistic: Decision: Conclusion: 0 =.05 F U = 3.89 Reject H 0 Do not reject H 0 Critical Value: F U = 3.89 Example H 0 : µ 1 = µ 2 = µ 3 H 1 : µ j not all equal 0.05 df 1 = 2, df 2 = 12 Table 9: Critical Value=2.052
26
Test Statistic: Decision: Conclusion: 0 =.05 F U = 3.89 Reject H 0 Do not reject H 0 Critical Value: F U = 3.89 Example H 0 : µ 1 = µ 2 = µ 3 H 1 : µ j not all equal 0.05 df 1 = 2, df 2 = 12 Table 9: Critical Value=2.052 F = 25.275
27
Test Statistic: Decision: Reject H 0 at = 0.05 Conclusion: 0 =.05 F U = 3.89 Reject H 0 Do not reject H 0 Critical Value: F U = 3.89 Example H 0 : µ 1 = µ 2 = µ 3 H 1 : µ j not all equal 0.05 df 1 = 2, df 2 = 12 Table 9: Critical Value=2.052 F = 25.275
28
Test Statistic: Decision: Reject H 0 at = 0.05 Conclusion: There is evidence that at least one µ j differs from the rest 0 =.05 F U = 3.89 Reject H 0 Do not reject H 0 Critical Value: F U = 3.89 Example H 0 : µ 1 = µ 2 = µ 3 H 1 : µ j not all equal 0.05 df 1 = 2, df 2 = 12 Table 9: Critical Value=2.052 F = 25.275
29
SourceSSDFMSFP-value Between4716.422358.225.76<0.001 Within1119.61293.3 Total5836.0 ANOVA Table
30
Next Lecture: Categorical Data Methods
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.