Analysis of variance (ANOVA) Comparing the means of more than two groups

Similar documents
SEVERAL μs AND MEDIANS: MORE ISSUES. Business Statistics

CHI SQUARE ANALYSIS 8/18/2011 HYPOTHESIS TESTS SO FAR PARAMETRIC VS. NON-PARAMETRIC

4/6/16. Non-parametric Test. Overview. Stephen Opiyo. Distinguish Parametric and Nonparametric Test Procedures

Data analysis and Geostatistics - lecture VII

Parametric versus Nonparametric Statistics-when to use them and which is more powerful? Dr Mahmoud Alhussami

Comparing the means of more than two groups

Analysis of variance (ANOVA) ANOVA. Null hypothesis for simple ANOVA. H 0 : Variance among groups = 0

CHAPTER 17 CHI-SQUARE AND OTHER NONPARAMETRIC TESTS FROM: PAGANO, R. R. (2007)

Chapter 15: Nonparametric Statistics Section 15.1: An Overview of Nonparametric Statistics

Statistics for Managers Using Microsoft Excel Chapter 10 ANOVA and Other C-Sample Tests With Numerical Data

Introduction to hypothesis testing

STAT 135 Lab 9 Multiple Testing, One-Way ANOVA and Kruskal-Wallis

GROUPED DATA E.G. FOR SAMPLE OF RAW DATA (E.G. 4, 12, 7, 5, MEAN G x / n STANDARD DEVIATION MEDIAN AND QUARTILES STANDARD DEVIATION

Inferences About the Difference Between Two Means

PSY 307 Statistics for the Behavioral Sciences. Chapter 20 Tests for Ranked Data, Choosing Statistical Tests

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

HYPOTHESIS TESTING II TESTS ON MEANS. Sorana D. Bolboacă

Lecture 7: Hypothesis Testing and ANOVA

Data Analysis: Agonistic Display in Betta splendens I. Betta splendens Research: Parametric or Non-parametric Data?

An Analysis of College Algebra Exam Scores December 14, James D Jones Math Section 01

Two-Sample Inferential Statistics

Agonistic Display in Betta splendens: Data Analysis I. Betta splendens Research: Parametric or Non-parametric Data?

Multiple comparisons - subsequent inferences for two-way ANOVA

Introduction to Nonparametric Statistics

Assignment #7. Chapter 12: 18, 24 Chapter 13: 28. Due next Friday Nov. 20 th by 2pm in your TA s homework box

Non-parametric (Distribution-free) approaches p188 CN

Analysis of Variance

Hypothesis Testing. Hypothesis: conjecture, proposition or statement based on published literature, data, or a theory that may or may not be true

Nonparametric Statistics. Leah Wright, Tyler Ross, Taylor Brown

Non-parametric methods

This is particularly true if you see long tails in your data. What are you testing? That the two distributions are the same!

Rama Nada. -Ensherah Mokheemer. 1 P a g e

CIVL /8904 T R A F F I C F L O W T H E O R Y L E C T U R E - 8

Rank-Based Methods. Lukas Meier

Data are sometimes not compatible with the assumptions of parametric statistical tests (i.e. t-test, regression, ANOVA)

3. Nonparametric methods

Nonparametric tests, Bootstrapping

Nonparametric Statistics

4.1. Introduction: Comparing Means

DETAILED CONTENTS PART I INTRODUCTION AND DESCRIPTIVE STATISTICS. 1. Introduction to Statistics

Degrees of freedom df=1. Limitations OR in SPSS LIM: Knowing σ and µ is unlikely in large

I i=1 1 I(J 1) j=1 (Y ij Ȳi ) 2. j=1 (Y j Ȳ )2 ] = 2n( is the two-sample t-test statistic.

T.I.H.E. IT 233 Statistics and Probability: Sem. 1: 2013 ESTIMATION AND HYPOTHESIS TESTING OF TWO POPULATIONS

Non-parametric tests, part A:

Chapter 24. Comparing Means. Copyright 2010 Pearson Education, Inc.

Introduction and Descriptive Statistics p. 1 Introduction to Statistics p. 3 Statistics, Science, and Observations p. 5 Populations and Samples p.

ANOVA - analysis of variance - used to compare the means of several populations.

(Foundation of Medical Statistics)

13: Additional ANOVA Topics

Chapter 12. Analysis of variance

Review for Final. Chapter 1 Type of studies: anecdotal, observational, experimental Random sampling

Chapter Fifteen. Frequency Distribution, Cross-Tabulation, and Hypothesis Testing

Analysis of Variance (ANOVA)

BIO 682 Nonparametric Statistics Spring 2010

Nonparametric statistic methods. Waraphon Phimpraphai DVM, PhD Department of Veterinary Public Health

Module 9: Nonparametric Statistics Statistics (OA3102)

Lecture 14: ANOVA and the F-test

Chapter 7 Comparison of two independent samples

Chap The McGraw-Hill Companies, Inc. All rights reserved.

Difference in two or more average scores in different groups

Battery Life. Factory

Exam details. Final Review Session. Things to Review

Week 14 Comparing k(> 2) Populations

STATISTIKA INDUSTRI 2 TIN 4004

Biostatistics 270 Kruskal-Wallis Test 1. Kruskal-Wallis Test

Analysis of Variance (ANOVA) Cancer Research UK 10 th of May 2018 D.-L. Couturier / R. Nicholls / M. Fernandes

Multiple Pairwise Comparison Procedures in One-Way ANOVA with Fixed Effects Model

Analysis of Variance

10/31/2012. One-Way ANOVA F-test

Lecture 28 Chi-Square Analysis

Stat 427/527: Advanced Data Analysis I

1-Way ANOVA MATH 143. Spring Department of Mathematics and Statistics Calvin College

THE ROYAL STATISTICAL SOCIETY 2015 EXAMINATIONS SOLUTIONS HIGHER CERTIFICATE MODULE 3

Introduction to the Analysis of Variance (ANOVA)

What Is ANOVA? Comparing Groups. One-way ANOVA. One way ANOVA (the F ratio test)

Solutions to Final STAT 421, Fall 2008

Comparison of Two Population Means

Sampling distribution of t. 2. Sampling distribution of t. 3. Example: Gas mileage investigation. II. Inferential Statistics (8) t =

MATH Notebook 3 Spring 2018

Stats fest Analysis of variance. Single factor ANOVA. Aims. Single factor ANOVA. Data

Basic Business Statistics, 10/e

LAB 2. HYPOTHESIS TESTING IN THE BIOLOGICAL SCIENCES- Part 2

Summary of Chapter 7 (Sections ) and Chapter 8 (Section 8.1)

10 One-way analysis of variance (ANOVA)

1 One-way Analysis of Variance

Inference for Regression Inference about the Regression Model and Using the Regression Line

Chapter 22. Comparing Two Proportions 1 /29

Lec 3: Model Adequacy Checking

22s:152 Applied Linear Regression. Take random samples from each of m populations.

Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance ECON 509. Dr.

Statistics Handbook. All statistical tables were computed by the author.

Unit 14: Nonparametric Statistical Methods

EXAM # 2. Total 100. Please show all work! Problem Points Grade. STAT 301, Spring 2013 Name

STATISTICS REVIEW. D. Parameter: a constant for the case or population under consideration.

T test for two Independent Samples. Raja, BSc.N, DCHN, RN Nursing Instructor Acknowledgement: Ms. Saima Hirani June 07, 2016

The entire data set consists of n = 32 widgets, 8 of which were made from each of q = 4 different materials.

Much of the material we will be covering for a while has to do with designing an experimental study that concerns some phenomenon of interest.

Regression: Main Ideas Setting: Quantitative outcome with a quantitative explanatory variable. Example, cont.

Lecture Slides. Elementary Statistics. by Mario F. Triola. and the Triola Statistics Series

Preview from Notesale.co.uk Page 3 of 63

Transcription:

Analysis of variance (ANOVA) Comparing the means of more than two groups

Example: Cost of mating in male fruit flies Drosophila Treatments: place males with and without unmated (virgin) females

Five treatments ("groups"), randomly assigned

Response variable: longevity (days) The data (n = 25 males per group): GROUPS: 1preg 46 42 65 46 58 42 48 58 50 80 63 65 70 70 72 97 46 56 70 70 72 76 90 76 92 1virgin 21 40 44 54 36 40 56 60 48 53 60 60 65 68 60 81 81 48 48 56 68 75 81 48 68 8preg 35 37 49 46 63 39 46 56 63 65 56 65 70 63 65 70 77 81 86 70 70 77 77 81 77 8virgin 16 19 19 32 33 33 30 42 42 33 26 30 40 54 34 34 47 47 42 47 54 54 56 60 44 none 40 37 44 47 47 47 68 47 54 61 71 75 89 58 59 62 79 96 58 62 70 72 75 96 75

Results: histograms of male longevity n = 25 males per group

Descriptive statistics Treatment i Y median s i n i 1preg 64.8 65 15.6 25 1virgin 56.8 56 14.9 25 8preg 63.4 65 14.5 25 8virgin 38.7 40 12.1 25 none 63.6 62 16.5 25

Hypothesis testing with ANOVA Like a two-sample t-test, but to test differences between means of more than two groups H 0 : μ 1 = μ 2 = μ 3 = = μ k H A : At least one of the μ i is different

Hypothesis testing with ANOVA Rejecting H 0 in ANOVA indicates that at least one of the means μ i is different from the others.

Scenarios being compared μ 1 = μ 2 = μ 3 Frequency Y Not all μ's equal Frequency Y

Why we compare variances Under H 0, the variance among group means should be σ = σ / n, 2 2 Y or 2 2 σ = σ Y n 2 σ Y is the variance (squared SD) between group means Y i n is the sample size within groups σ 2 is the variance in Y within each group If the null hypothesis is not true, the variance among groups should be larger than this.

Variance within groups ("pooled sample variance") Error sum of squares SS error 2 = s i ( n 1) Error degrees of freedom df error = ( n 1) = N k where N is the total number of data points in all groups Mean Square Error (MS error ) MS = error SS df i i error error

where Y is the grand mean, Variance among groups Groups sum of squares SS groups = n i (Y i Y ) 2 Y n Y i i =. Degrees of freedom for groups df groups = k 1. Mean Square Groups (MS groups ) SSgroups MS groups = df. N groups

F = F-ratio MS MS groups error Under H 0, (except for chance) MS groups MS error So under H 0, (except for chance) F 1

F test Reject H 0 is rejected if F is significantly larger than 1 Compare F with critical value of the F distribution, F 0.05(1),dfgroups,dferror Reject H 0 F F 0.05(1),dfgroups,dferror

F distribution

ANOVA table for fruit fly experiment Source Sum of Squares df Mean Squares F P-value Groups 11939.28 4 2984.8200 13.61195 <0.001 Error 26313.52 120 219.2793 Total 38252.80 124 F 0.05(1),4,120 = 2.447 Reject H 0 Conclusion: Mean longevity not equal in all groups

Cost of mating in male fruit flies Implication: sex is deadly (in males)

R 2 ("R-squared") R 2 measures the fraction of the variation in Y that is "explained" by group differences. Based on the fact that the total sum of squares is split into its two component parts, the sum of squares of error and the sum of squares of groups, SS = SS + total groups SS error 2 R = SS SS groups total.

Fruit flies R 2 = = 11939.28 38252.80 0.312 Conclusion: 31% of the variation in longevity is "explained" by treatment

ANOVA vs two-sample t-test An ANOVA with k=2 is mathematically equivalent to a twotailed, 2-sample t-test of H 0 : μ 1 μ 2 = 0 H A : μ 1 μ 2 0

Assumptions of ANOVA The measurements in every group are a random sample from the corresponding population. The variable has a normal distribution in all k populations. The variance is the same in all k population.

The robustness of ANOVA The ANOVA is fairly robust to deviations from the assumption of normality, particularly when sample size is large. This robustness stems from a property of sample means described by the Central Limit Theorem: the sampling distribution of means is approximately normal when sample size is large, even when the variable itself does not have a normal distribution. ANOVA is also fairly robust to departures from the assumption of equal variance in the k populations if the samples sizes are all equal or nearly so.

Strategies if assumptions of ANOVA not met and we can't rely on robustness property Transformations (e.g., log-transformation, square root transformation, and arcsine transformation). Nonparametric alternatives

Nonparametric alternatives to ANOVA: Kruskal-Wallis test Analogous to the Mann-Whitney U-test for more than two groups. Based on ranks Test statistic H has an approximately χ 2 distribution H 0 : The population median is the same in all k groups. H A : At least one of the groups has a different median.

ANOVA: which means are different? H 0 : μ 1 = μ 2 = μ 3 = = μ k H A : At least one of the μ i is different (but which?)

ANOVA: which means are different? Two approaches to addressing this question: 1. Planned comparisons 2. Unplanned comparisons

Planned comparisons One or a very small number of focal comparisons that were planned at the time the study was designed.

Unplanned comparisons A comprehensive search for differences between groups

What's so important about the difference? 1. Planned comparisons: No need to correct for multiple comparisons Very few planned comparisons permitted 2. Unplanned comparisons Correction for multiple comparisons required because of rising Type 1 error rates

Planned confidence interval for the difference between two means Treatment i Y median s i n i 1preg 64.8 65 15.6 25 1virgin 56.8 56 14.9 25 8preg 63.4 65 14.5 25 8virgin 38.7 40 12.1 25 none 63.6 62 16.5 25

Planned confidence interval for the difference between two means Formula for confidence interval similar to that for twosample case: ( Y Y ) SE t < μ μ < ( Y Y SE t i j 0.05(2), N k i j i j ) + 0.05(2), N k except that we calculate SE using MS error instead of the pooled sample variance for just the two samples 1 SE = MS error + 1 n i n j and we use df error = N k for degrees of freedom.

Planned confidence interval for the difference between two means ( j Treatment Y i median s i n i 1preg 64.8 65 15.6 25 1virgin 56.8 56 14.9 25 8preg 63.4 65 14.5 25 8virgin 38.7 40 12.1 25 none 63.6 62 16.5 25 Yi Y ) = 38.7 63.4 = 24.64 SE = 4.188, df = 120, t 0.05(2),120 = 1.98 95% confidence interval: 32.93 < μ μ < 16.35 i j

Example of unplanned comparisons The Tukey-Kramer method for testing all pairs of means Comparison ( i Yj ) 1preg 8virgin 26.08 4.188 6.227 2.770 reject 1preg 1virgin 8.04 4.188 1.920 2.770 do not reject 1preg 8preg 1.44 4.188 0.344 2.770 do not reject 1preg none 1.24 4.188 0.296 2.770 do not reject none 8virgin 24.84 4.188 5.931 2.770 reject none 1virgin 6.80 4.188 1.624 2.770 do not reject none 8preg 0.20 4.188 0.048 2.770 do not reject 8preg 8virgin 24.64 4.188 5.883 2.770 reject 8preg 1virgin 6.60 4.188 1.576 2.770 do not reject 1virgin 8virgin 18.04 4.188 4.307 2.770 reject Y SE q critical q (0.05) conclusion 8virgin 1virgin 8preg none 1preg 38.72 56.76 63.36 63.56 64.80

The Tukey-Kramer method for testing all pairs of means With the Tukey-Kramer method, the probability of making at least one Type 1 error throughout the course of testing all pairs of means is no greater than the significance level α.

Fixed vs random effects ANOVA 1. Fixed effects: With fixed effects, the treatments are chosen by the experimenter. They are repeatable and of direct interest. 2. Random effects: With random effects, the treatments are a random sample from a "population" of treatments. For single-factor ANOVA, there is no difference in the F-test of the null and alternative hypotheses

Example of random effects ANOVA: Flycatcher patch height in 2 different years

Patch height measurements Bird Height 1 (mm) Height 2 (mm) Bird Height 1 (mm) Height 2 (mm) 1 10.5 9.3 16 8.1 7.0 2 10.6 9.2 17 8.1 6.8 3 8.7 9.3 18 7.4 6.7 4 8.6 9.1 19 6.7 6.8 5 9.0 9.0 20 6.3 6.7 6 9.3 8.7 21 6.8 6.4 7 8.9 8.7 22 6.7 6.2 8 9.0 7.6 23 6.1 5.8 9 7.9 8.0 24 6.5 5.6 10 7.6 7.8 25 6.7 5.3 11 7.6 8.1 26 6.5 5.0 12 7.7 8.1 27 5.7 5.1 13 6.8 7.9 28 6.7 7.8 14 7.2 7.5 29 6.6 7.6 15 7.8 7.1 30 6.6 7.7

Random effects ANOVA Each bird is a "group", randomly sampled from a population of groups (birds) n = 2 measurements per group We don't care so much about the individual birds, they are just a sample What we really want to know is whether the trait varies in the population (and by how much) H 0 : Patch height does not vary in the population H A : Patch height varies in the population

Random effects ANOVA Source Sum of Squares df Mean Squares F P-value Groups 82.494 29 2.844621 7.946 <0.001 Error 10.740 30 0.358000 Total 93.234 59 F 0.05(1),29,30 = 1.847 Reject H 0 Conclusion: patch height varies in the population

Repeatability Repeatability is the fraction of the variance in the trait that is among groups Repeatability = s 2 A 2 sa + MS error, where the variance among groups is 2 s A = MS groups n MS error.

Repeatability of patch height 2 s A 2.844621 0.358000 = 2 = 1.24331. yielding 1.24331 Repeatability = 1.24331+ 0.358000 = 0.884.

Repeatability of patch height Conclusion: 88% of the variance in patch height in the population is among birds, whereas the remaining 12% is variance from measurement to measurement on the same birds.