Statistical methods for comparing multiple groups. Lecture 7: ANOVA. ANOVA: Definition. ANOVA: Concepts

Similar documents
Lecture 5: ANOVA and Correlation

Introduction to Business Statistics QM 220 Chapter 12

Chapter Seven: Multi-Sample Methods 1/52

Disadvantages of using many pooled t procedures. The sampling distribution of the sample means. The variability between the sample means

Chapter 8 Student Lecture Notes 8-1. Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance

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

One-Way Analysis of Variance. With regression, we related two quantitative, typically continuous variables.

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

WELCOME! Lecture 13 Thommy Perlinger

Lecture 7: Hypothesis Testing and ANOVA

Data Analysis and Statistical Methods Statistics 651

Chapter 10: Chi-Square and F Distributions

Analysis of Variance

1 DV is normally distributed in the population for each level of the within-subjects factor 2 The population variances of the difference scores

ANOVA: Comparing More Than Two Means

Lecture 6 Multiple Linear Regression, cont.

Announcements. Unit 4: Inference for numerical variables Lecture 4: ANOVA. Data. Statistics 104

While you wait: Enter the following in your calculator. Find the mean and sample variation of each group. Bluman, Chapter 12 1

The One-Way Independent-Samples ANOVA. (For Between-Subjects Designs)

Introduction to the Analysis of Variance (ANOVA) Computing One-Way Independent Measures (Between Subjects) ANOVAs

Wolf River. Lecture 19 - ANOVA. Exploratory analysis. Wolf River - Data. Sta 111. June 11, 2014

ANOVA Analysis of Variance

In a one-way ANOVA, the total sums of squares among observations is partitioned into two components: Sums of squares represent:

Introduction to the Analysis of Variance (ANOVA)

Statistics For Economics & Business

Mathematical Notation Math Introduction to Applied Statistics

One-way between-subjects ANOVA. Comparing three or more independent means

PSYC 331 STATISTICS FOR PSYCHOLOGISTS

16.400/453J Human Factors Engineering. Design of Experiments II

Module 10: Analysis of Categorical Data Statistics (OA3102)

One-Way ANOVA Cohen Chapter 12 EDUC/PSY 6600

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

Chapter 7 Comparison of two independent samples

Example. χ 2 = Continued on the next page. All cells

Quantitative Analysis and Empirical Methods

Class 24. Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science. Marquette University MATH 1700

2 Hand-out 2. Dr. M. P. M. M. M c Loughlin Revised 2018

Analysis of Variance Bios 662

Module 03 Lecture 14 Inferential Statistics ANOVA and TOI

Data Skills 08: General Linear Model

Lecture (chapter 10): Hypothesis testing III: The analysis of variance

" M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2

Difference in two or more average scores in different groups

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

Review of Statistics 101

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

Regression models. Categorical covariate, Quantitative outcome. Examples of categorical covariates. Group characteristics. Faculty of Health Sciences

The t-distribution. Patrick Breheny. October 13. z tests The χ 2 -distribution The t-distribution Summary

One-factor analysis of variance (ANOVA)

The goodness-of-fit test Having discussed how to make comparisons between two proportions, we now consider comparisons of multiple proportions.

Two-Sample Inferential Statistics

Analysis of variance

COMPARING SEVERAL MEANS: ANOVA

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

IEOR165 Discussion Week 12

Statistical Analysis for QBIC Genetics Adapted by Ellen G. Dow 2017

STAT 115:Experimental Designs

Lecture 11: Two Way Analysis of Variance

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

Unit 27 One-Way Analysis of Variance

10: Crosstabs & Independent Proportions

We need to define some concepts that are used in experiments.

STATISTICS 141 Final Review

Chapter 10. Chapter 10. Multinomial Experiments and. Multinomial Experiments and Contingency Tables. Contingency Tables.

One-Way ANOVA. Some examples of when ANOVA would be appropriate include:

Acknowledge error Smaller samples, less spread

The legacy of Sir Ronald A. Fisher. Fisher s three fundamental principles: local control, replication, and randomization.

LECTURE 5. Introduction to Econometrics. Hypothesis testing

Multiple t Tests. Introduction to Analysis of Variance. Experiments with More than 2 Conditions

Chapter 15: Analysis of Variance

One-way between-subjects ANOVA. Comparing three or more independent means

TA: Sheng Zhgang (Th 1:20) / 342 (W 1:20) / 343 (W 2:25) / 344 (W 12:05) Haoyang Fan (W 1:20) / 346 (Th 12:05) FINAL EXAM

One-way ANOVA. Experimental Design. One-way ANOVA

Review. One-way ANOVA, I. What s coming up. Multiple comparisons

Example - Alfalfa (11.6.1) Lecture 14 - ANOVA cont. Alfalfa Hypotheses. Treatment Effect

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

DESAIN EKSPERIMEN Analysis of Variances (ANOVA) Semester Genap 2017/2018 Jurusan Teknik Industri Universitas Brawijaya

Lecture 9. Selected material from: Ch. 12 The analysis of categorical data and goodness of fit tests

Econ 3790: Business and Economic Statistics. Instructor: Yogesh Uppal

Wolf River. Lecture 15 - ANOVA. Exploratory analysis. Wolf River - Data. Sta102 / BME102. October 22, 2014

Sociology 6Z03 Review II

HYPOTHESIS TESTING. Hypothesis Testing

1 The Randomized Block Design

1 Descriptive statistics. 2 Scores and probability distributions. 3 Hypothesis testing and one-sample t-test. 4 More on t-tests

Comparing the means of more than two groups

BIO5312 Biostatistics Lecture 6: Statistical hypothesis testings

The One-Way Repeated-Measures ANOVA. (For Within-Subjects Designs)

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

The t-test: A z-score for a sample mean tells us where in the distribution the particular mean lies

8/23/2018. One-Way ANOVA F-test. 1. Situation/hypotheses. 2. Test statistic. 3.Distribution. 4. Assumptions

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

Wolf River. Lecture 15 - ANOVA. Exploratory analysis. Wolf River - Data. Sta102 / BME102. October 26, 2015

Power Analysis. Introduction to Power

Statistics Primer. ORC Staff: Jayme Palka Peter Boedeker Marcus Fagan Trey Dejong

Notes for Week 13 Analysis of Variance (ANOVA) continued WEEK 13 page 1

Factorial designs. Experiments

Ch 2: Simple Linear Regression

Lecture 28. Ingo Ruczinski. December 3, Department of Biostatistics Johns Hopkins Bloomberg School of Public Health Johns Hopkins University

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

Design of Experiments. Factorial experiments require a lot of resources

Transcription:

Statistical methods for comparing multiple groups Lecture 7: ANOVA Sandy Eckel seckel@jhsph.edu 30 April 2008 Continuous data: comparing multiple means Analysis of variance Binary data: comparing multiple proportions Chi-square tests for r 2 tables Independence Goodness of Fit Homogeneity Categorical data: comparing multiple sets of categorical responses Similar chi-square tests for r c tables 1 / 34 2 / 34 ANOVA: Definition ANOVA: Concepts Statistical technique for comparing means for multiple (usually 3) independent populations To compare the means in 2 groups, just use the methods we learned to conduct a hypothesis test for the equality of two population means (called a t-test) Partition the total variation in a response variable into Variability within groups Variability between groups Estimate group means Assess magnitude of variation attributable to specific sources Partition the variation according to source Extension of 2-sample t-test to multiple groups Population model Sample model: sample estimates, standard errors (sd of sampling distribution) ANOVA = ANalysis Of VAriance 3 / 34 4 / 34

Types of ANOVA Emphasis One-way ANOVA One factor e.g. smoking status (never, former, current) Two-way ANOVA Two factors e.g. gender and smoking status Three-way ANOVA Three factors e.g. gender, smoking and beer consumption One-way ANOVA is an extension of the t-test to 3 or more samples focus analysis on group differences Two-way ANOVA (and higher) focuses on the interaction of factors Does the effect due to one factor change as the level of another factor changes? 5 / 34 6 / 34 Recall: sample estimator of variance ANOVA partitioning of the variance I Sample variance: n s 2 i = (X i X) 2 n 1 The distance from any data point to the mean is the deviation from this point to the mean: (X i X) The sum of squares is the sum of all squared deviations: n SS = (X i X) 2 i 7 / 34 Variation Variation Variation between each between each in all = observation + group mean observations and its group and the overall mean mean In other words, Total = Within group + Between groups sum of squares sum of squares sum of squares In shorthand: SST = SSW + SSB 8 / 34

ANOVA partitioning of the variance II ANOVA partitioning of the variance III SST This is the sum of the squared deviations between each observation and the overall mean: SST = n (X i X) 2 SSW This is the sum of the squared deviations between each observation the mean of the group to which it belongs: SSW = i n (X i X group(i) ) 2 i SSB This is the sum of the squared deviations between each group mean and the overall mean, weighted by the sample size of each group (n group ): SSB = n group ( X group X) 2 group If the group means are not very different, the variation between them and the overall mean (SSB) will not be much more than the variation between the observations within a group (SSW) 9 / 34 10 / 34 One-way ANOVA: the picture Within groups mean square: MSW We assume the variance σ 2 is the same for each of the group s populations We can pool (combine) the estimates of σ 2 across groups and use an overall estimate for the common population variance: Variation within a group = ˆσ 2 W = SSW N k = MSW MSW is called the within groups mean square 11 / 34 12 / 34

Between groups mean square: MSB An ANOVA table We can also look at systematic variation among groups Suppose there are k groups (e.g. if smoking status has categories current, former or never, then k=3) We calculate a test statistic for a hypothesis test using the sum of square values as follows: Variation between groups = ˆσ 2 B = SSB k 1 = MSB 13 / 34 14 / 34 Hypothesis testing with ANOVA A test statistic In ANOVA we ask: is there truly a difference in means across groups? Formally, we can specify the hypotheses: H 0 H a : µ 1 = µ 2 = = µ k : at least one of the µ i s is different The null hypothesis specifies a global relationship between the means Get your test statistic (more next slide...) If the result of the test is significant (p-value α), then perform individual comparisons between pairs of groups Goal: Compare the two sources of variability: MSW and MSB Our test statistic is F obs = MSB MSW = ˆσ2 B ˆσ 2 W = variance between the groups variance within the groups If F obs is small (close to 1), then variability between groups is negligible compared to variation within groups The grouping does not explain much variation in the data If F obs is large, then variability between groups is large compared to variation within groups The grouping explains a lot of the variation in the data 15 / 34 16 / 34

The F-statistic The F-distribution For our observations, we assume X N(µgp, σ 2 ), where µgp is the (possibly different) mean for each group s population. Note: under H 0, we assume all the group means are the same We have assumed the same variance σ 2 for all groups important to check this assumption Under these assumptions, we know the null distribution of the statistic F= MSB MSW The distribution is called an F-distribution Remember that a χ 2 distribution is always specified by its degrees of freedom An F-distribution is any distribution obtained by taking the quotient of two χ 2 distributions divided by their respective degrees of freedom When we specify an F-distribution, we must state two parameters, which correspond to the degrees of freedom for the two χ 2 distributions If X 1 χ 2 df 1 and X 2 χ 2 df 2 we write: X 1 /df 1 X 2 /df 2 F df1,df 2 17 / 34 18 / 34 Back to the hypothesis test... ANOVA: F-tests I Knowing the null distribution of MSW MSB, we can define a decision How to find the value of F α;k 1,N k rule for the ANOVA test statistic (F obs ): Reject H 0 if F obs F α;k 1,N k Fail to reject H 0 if F obs < F α;k 1,N k F α;k 1,N k is the value on the F k 1,N k distribution that, used as a cutoff, gives an area in the uppper tail = α We are using a one-sided rejection region Use the R function qf(alpha, df1, df2, lower.tail = F) 19 / 34 20 / 34

ANOVA: F-tests II Example: ANOVA for HDL How to find the p-value of an ANOVA test statistic Study design: Randomized controlled trial 132 men randomized to one of Diet + exericse Diet Control Follow-up one year later: 119 men remaining in study Outcome: mean change in plasma levels of HDL cholesterol from baseline to one-year follow-up in the three groups Use the R function pf(fobs, df1, df2, lower.tail = F) 21 / 34 22 / 34 Model for HDL outcomes HDL ANOVA Table We model the means for each group as follows: µ c = E(HDL gp = c) = mean change in control group µ d = E(HDL gp = d) = mean change in diet group µ de = E(HDL gp = de) = mean change in diet and exercise group We obtain the following results from the HDL experiment: We could also write the model as E(HDL gp) = β 0 + β 1 I(gp = d) + β 2 I(gp = de) Recall that I(gp=D), I(gp=DE) are 0/1 group indicators 23 / 34 24 / 34

HDL ANOVA results & conclusions Which groups are different? F-test H 0 : µ c = µ d = µ de (or H 0 : β 1 = β 2 = 0) H a : at least one mean is different from the others Test statistic F obs = 13.0 df 1 = k 1 = 3 1 = 2 df 2 = N k = 116 Rejection region: F > F 0.05;2,116 = 3.07 Conclusions Since F obs = 13.0 > 3.07, we reject H 0 We conclude that at least one of the group means is different from the others (p< 0.05) 25 / 34 We might proceed to make individual comparisons Conduct two-sample t-tests to test for a difference in means for each pair of groups (assuming equal variance): t obs = ( X 1 X 2 ) µ 0 s 2 p n 1 + s2 p n 2 Recall: s 2 p is the pooled sample estimate of the common variance df = n 1 + n 2 2 26 / 34 Multiple Comparisons Bonferroni adjustment Performing individual comparisons require multiple hypothesis tests If α = 0.05 for each comparison, there is a 5% chance that each comparison will falsely be called significant Overall, the probability of Type I error is elevated above 5% For n independent tests, the probability of making a Type I error at least once is 1 0.95 n Example: For n = 10 tests, the probability of at least one Type I error is 0.40! Question: How can we address this multiple comparisons issue? A possible correction for multiple comparisons Test each hypothesis at level α = (α/3) = 0.0167 Adjustment ensures overall Type I error rate does not exceed α = 0.05 However, this adjustment may be too conservative 27 / 34 28 / 34

Multiple comparisons α HDL: Pairwise comparisons I Hypothesis α = α/3 H 0 : µ c = µ d (or β 1 = 0) 0.0167 H 0 : µ c = µ de (or β 2 = 0) 0.0167 H 0 : µ d = µ de (or β 1 β 2 = 0) 0.0167 Overall α = 0.05 Control and Diet groups H 0 : µ c = µ d (or β 1 = 0) t = 0.05 0.02 0.028 40 + 0.028 40 p-value = 0.06 = 1.87 29 / 34 30 / 34 HDL: Pairwise comparisons II HDL: Pairwise comparisons III Control and Diet + exercise groups H 0 : µ c = µ de (or β 2 = 0) t = 0.05 0.14 0.028 40 + 0.028 39 = 5.05 p-value = 4.4 10 7 Diet and Diet + exercise groups H 0 : µ d = µ de (or β 1 β 2 = 0) t = 0.02 0.14 0.028 40 + 0.028 39 p-value = 0.0014 = 3.19 31 / 34 32 / 34

Bonferroni corrected p-values Summary of Lecture 7 Hypothesis p-value adjusted α H 0 : µ c = µ d 0.06 0.0167 H 0 : µ c = µ de 4.4 10 7 0.0167 H 0 : µ d = µ de 0.0014 0.0167 Overall α = 0.05 The p-value must be less than the adjusted α to reject H 0 Conclusion: Significant difference in HDL change for DE group compared to other groups Sample variance, sums of squares ANOVA partition of the sums of squares ANOVA table hypothesis test setup test statistic F distribution Multiple hypothesis testing, Bonferroni correction ANOVA dull hypothesis joke: http://www.phdcomics.com/comics/archive.php?comicid=905 33 / 34 34 / 34