Lecture 7: Hypothesis Testing and ANOVA

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

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

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

Statistics for Managers Using Microsoft Excel/SPSS Chapter 8 Fundamentals of Hypothesis Testing: One-Sample Tests

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

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

What is a Hypothesis?

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

Lecture 9: Linear Regression

A3. Statistical Inference Hypothesis Testing for General Population Parameters

SEVERAL μs AND MEDIANS: MORE ISSUES. Business Statistics

Statistical Inference Theory Lesson 46 Non-parametric Statistics

Chapter 7 Comparison of two independent samples

Glossary. The ISI glossary of statistical terms provides definitions in a number of different languages:

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

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

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

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

We like to capture and represent the relationship between a set of possible causes and their response, by using a statistical predictive model.

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

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

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

Lecture 4: Parameter Es/ma/on and Confidence Intervals. GENOME 560, Spring 2015 Doug Fowler, GS

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

Selection should be based on the desired biological interpretation!

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

Nonparametric Statistics

Rank-Based Methods. Lukas Meier

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.

Summary of Chapters 7-9

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

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

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

Module 9: Nonparametric Statistics Statistics (OA3102)

Formulas and Tables by Mario F. Triola

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

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

Types of Statistical Tests DR. MIKE MARRAPODI

ANOVA CIVL 7012/8012

Harvard University. Rigorous Research in Engineering Education

Pooled Variance t Test

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

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

STATISTIKA INDUSTRI 2 TIN 4004

Non-parametric tests, part A:

Exam details. Final Review Session. Things to Review

Nonparametric Location Tests: k-sample

Business Statistics: Lecture 8: Introduction to Estimation & Hypothesis Testing

Non-parametric methods

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

How do we compare the relative performance among competing models?

STAT Section 5.8: Block Designs

7.2 One-Sample Correlation ( = a) Introduction. Correlation analysis measures the strength and direction of association between

Analysis of variance

z and t tests for the mean of a normal distribution Confidence intervals for the mean Binomial tests

Basic Business Statistics, 10/e

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

Variance Estimates and the F Ratio. ERSH 8310 Lecture 3 September 2, 2009

1.0 Hypothesis Testing

Lecture 5: ANOVA and Correlation

STAT Chapter 13: Categorical Data. Recall we have studied binomial data, in which each trial falls into one of 2 categories (success/failure).

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

Contents. Acknowledgments. xix

Nonparametric Statistics. Leah Wright, Tyler Ross, Taylor Brown

Psychology 282 Lecture #4 Outline Inferences in SLR

Sleep data, two drugs Ch13.xls

HYPOTHESIS TESTING. Hypothesis Testing

Tentative solutions TMA4255 Applied Statistics 16 May, 2015

Analysis of Variance

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

An introduction to biostatistics: part 1

Analysis of Variance. Read Chapter 14 and Sections to review one-way ANOVA.

Glossary for the Triola Statistics Series

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

Statistics For Economics & Business

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

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

Unit 14: Nonparametric Statistical Methods

STAT Chapter 8: Hypothesis Tests

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

Turning a research question into a statistical question.

16.3 One-Way ANOVA: The Procedure

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

= 1 i. normal approximation to χ 2 df > df

Inferential Statistics

Chapter 11 - Lecture 1 Single Factor ANOVA

11-2 Multinomial Experiment

Introduction to Nonparametric Statistics

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

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

Non-Parametric Statistics: When Normal Isn t Good Enough"

Statistics: revision

INTERVAL ESTIMATION AND HYPOTHESES TESTING

Comparing the means of more than two groups

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

Transition Passage to Descriptive Statistics 28

Comparison of two samples

Intuitive Biostatistics: Choosing a statistical test

Small n, σ known or unknown, underlying nongaussian

10: Crosstabs & Independent Proportions

Transcription:

Lecture 7: Hypothesis Testing and ANOVA

Goals Overview of key elements of hypothesis testing Review of common one and two sample tests Introduction to ANOVA

Hypothesis Testing The intent of hypothesis testing is formally examine two opposing conjectures (hypotheses), H 0 and H A These two hypotheses are mutually exclusive and exhaustive so that one is true to the exclusion of the other We accumulate evidence - collect and analyze sample information - for the purpose of determining which of the two hypotheses is true and which of the two hypotheses is false

The Null and Alternative Hypothesis The null hypothesis, H 0 : States the assumption (numerical) to be tested Begin with the assumption that the null hypothesis is TRUE Always contains the = sign The alternative hypothesis, H a : Is the opposite of the null hypothesis Challenges the status quo Never contains just the = sign Is generally the hypothesis that is believed to be true by the researcher

One and Two Sided Tests Hypothesis tests can be one or two sided (tailed) One tailed tests are directional: H 0 : µ 1 - µ 2 0 H A : µ 1 - µ 2 > 0 Two tailed tests are not directional: H 0 : µ 1 - µ 2 = 0 H A : µ 1 - µ 2 0

P-values Calculate a test statistic in the sample data that is relevant to the hypothesis being tested After calculating a test statistic we convert this to a P- value by comparing its value to distribution of test statistic s under the null hypothesis Measure of how likely the test statistic value is under the null hypothesis P-value α Reject H 0 at level α P-value > α Do not reject H 0 at level α

When To Reject H 0 Level of significance, α: Specified before an experiment to define rejection region Rejection region: set of all test statistic values for which H 0 will be rejected One Sided α = 0.05 Two Sided α = 0.05 Critical Value = -1.64 Critical Values = -1.96 and +1.96

Some Notation In general, critical values for an α level test denoted as: One sided test : X " Two sided test : X "/2 where X depends on the distribution of the test statistic For example, if X ~ N(0,1): One sided test : z " (i.e., z 0.05 = 1.64) Two sided test : z "/2 (i.e., z 0.05 / 2 = z 0.025 = ± 1.96)

Errors in Hypothesis Testing Actual Situation Truth Decision Do Not Reject H 0 H 0 True H 0 False Rejct H 0

Errors in Hypothesis Testing Actual Situation Truth Decision Do Not Reject H 0 H 0 True Correct Decision 1 - α H 0 False Incorrect Decision β Rejct H 0 Incorrect Decision α Correct Decision 1 - β

Type I and II Errors Actual Situation Truth Decision Do Not Reject H 0 Rejct H 0 H 0 True Correct Decision 1 - α Incorrect Decision Type I Error α H 0 False Incorrect Decision Type II Error β Correct Decision 1 - β " = P ( Type I Error)! = P( Type II Error) Power = 1 - "

Parametric and Non-Parametric Tests Parametric Tests: Relies on theoretical distributions of the test statistic under the null hypothesis and assumptions about the distribution of the sample data (i.e., normality) Non-Parametric Tests: Referred to as Distribution Free as they do not assume that data are drawn from any particular distribution

Whirlwind Tour of One and Two Sample Tests Type of Data Goal Gaussian Non-Gaussian Binomial Compare one group to a hypothetical value One sample t-test Wilcoxon Test Binomial Test Compare two paired groups Paired t-test Wilcoxon Test McNemar s Test Compare two unpaired groups Two sample t-test Wilcoxon-Mann- Whitney Test Chi-Square or Fisher s Exact Test

General Form of a t-test Statistic One Sample T = x " µ s n Two Sample T = x " y " (µ 1 " µ 2 ) s p 1 m + 1 n df t ",n#1 t ",m +n#2

Non-Parametric Alternatives Wilcoxon Test: non-parametric analog of one sample t- test Wilcoxon-Mann-Whitney test: non-parametric analog of two sample t-test

Hypothesis Tests of a Proportion Large sample test (prop.test) z = ˆ p " p 0 p 0 (1" p 0 ) /n Small sample test (binom.test) - Calculated directly from binomial distribution

Confidence Intervals Confidence interval: an interval of plausible values for the parameter being estimated, where degree of plausibility specifided by a confidence level General form: ˆ x ± critical value " se x - y ± t ",m +n#2 s p 1 m + 1 n

Interpreting a 95% CI We calculate a 95% CI for a hypothetical sample mean to be between 20.6 and 35.4. Does this mean there is a 95% probability the true population mean is between 20.6 and 35.4? NO! Correct interpretation relies on the long-rang frequency interpretation of probability Why is this so? µ

Hypothesis Tests of 3 or More Means Suppose we measure a quantitative trait in a group of N individuals and also genotype a SNP in our favorite candidate gene. We then divide these N individuals into the three genotype categories to test whether the average trait value differs among genotypes. What statistical framework is appropriate here? Why not perform all pair-wise t-tests?

Basic Framework of ANOVA Want to study the effect of one or more qualitative variables on a quantitative outcome variable Qualitative variables are referred to as factors (i.e., SNP) Characteristics that differentiates factors are referred to as levels (i.e., three genotypes of a SNP

One-Way ANOVA Simplest case is for One-Way (Single Factor) ANOVA The outcome variable is the variable you re comparing The factor variable is the categorical variable being used to define the groups - We will assume k samples (groups) The one-way is because each value is classified in exactly one way ANOVA easily generalizes to more factors

Assumptions of ANOVA Independence Normality Homogeneity of variances (aka, Homoscedasticity)

One-Way ANOVA: Null Hypothesis The null hypothesis is that the means are all equal H 0 : µ µ 1 = µ µ 2 = µ... = µ k µ : = = = L = 0 1 2 3 k The alternative hypothesis is that at least one of the means is different Think about the Sesame Street game where three of these things are kind of the same, but one of these things is not like the other. They don t all have to be different, just one of them.

Motivating ANOVA A random sample of some quantitative trait was measured in individuals randomly sampled from population Genotyping of a single SNP AA: 82, 83, 97 AG: 83, 78, 68 GG: 38, 59, 55

Rational of ANOVA Basic idea is to partition total variation of the data into two sources 1. Variation within levels (groups) 2. Variation between levels (groups) If H 0 is true the standardized variances are equal to one another

The Details Our Data: AA: 82, 83, 97 AG: 83, 78, 68 GG: 38, 59, 55 x 1. = (82 + 83 + 97) /3 = 87.3 x 2. = (83+ 78 + 68) /3 = 76.3 x 3. = (38 + 59 + 55) /3 = 50.6 Let X ij denote the data from the i th level and j th observation Overall, or grand mean, is: x.. = K J "" i=1 j=1 x ij N x.. = 82 + 83 + 97 + 83 + 78 + 68 + 38 + 59 + 55 9 = 71.4

Partitioning Total Variation Recall, variation is simply average squared deviations from the mean SST = SST G + SST E K J K ##(x ij " x.. ) 2 # n i (x i. " x.. ) ## 2 (x ij " x i. ) 2 i=1 j=1 i=1 K i=1 J j=1 Sum of squared deviations about the grand mean across all N observations Sum of squared deviations for each group mean about the grand mean Sum of squared deviations for all observations within each group from that group mean, summed across all groups

In Our Example SST = SST G + SST E K J ##(x ij " x.. ) 2 n ##(x ij " x i. ) 2 i (x i. " x.. ) 2 i=1 j=1 K # i=1 K i=1 J j=1 (82 " 71.4) 2 + (83" 71.4) 2 + (97 " 71.4) 2 + (83" 71.4) 2 + (78 " 71.4) 2 + (68 " 71.4) 2 + (38 " 71.4) 2 + (59 " 71.4) 2 + (55 " 71.4) 2 = 3 (87.3" 71.4) 2 + 3 (76.3" 71.4) 2 + 3 (50.6 " 71.4) 2 = (82 " 87.3) 2 + (83 " 87.3) 2 + (97 " 87.3) 2 + (83 " 76.3) 2 + (78 " 76.3) 2 + (68 " 76.3) 2 + (38 " 50.6) 2 + (59 " 50.6) 2 + (55 " 50.6) 2 = 2630.2 2124.2 506

In Our Example SST = SST G + SST E K J ##(x ij " x.. ) 2 # n ##(x ij " x i. ) 2 i (x i. " x.. ) 2 i=1 j=1 K i=1 K i=1 J j=1 x 1. x 2. x.. x 3.

Calculating Mean Squares To make the sum of squares comparable, we divide each one by their associated degrees of freedom SST G = k - 1 (3-1 = 2) SST E = N - k (9-3 = 6) SST T = N - 1 (9-1 = 8) MST G = 2124.2 / 2 = 1062.1 MST E = 506 / 6 = 84.3

Almost There Calculating F Statistic The test statistic is the ratio of group and error mean squares F = MST G MST E = 1062.2 84.3 =12.59 If H 0 is true MST G and MST E are equal Critical value for rejection region is F α, k-1, N-k If we define α = 0.05, then F 0.05, 2, 6 = 5.14

ANOVA Table Source of Variation df Sum of Squares MS F Group k-1 SST G SST G k "1 SST G k "1 SSTE N " k Error N-k SST E SST E N " k Total N-1 SST

Non-Parametric Alternative Kruskal-Wallis Rank Sum Test: non-parametric analog to ANOVA In R, kruskal.test()