STAT 135 Lab 8 Hypothesis Testing Review, Mann-Whitney Test by Normal Approximation, and Wilcoxon Signed Rank Test.

Similar documents
STAT 135 Lab 7 Distributions derived from the normal distribution, and comparing independent samples.

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

Module 9: Nonparametric Statistics Statistics (OA3102)

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

3. Nonparametric methods

Distribution-Free Procedures (Devore Chapter Fifteen)

Non-parametric methods

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

Nonparametric hypothesis tests and permutation tests

SEVERAL μs AND MEDIANS: MORE ISSUES. Business Statistics

Comparison of Two Population Means

Non-parametric Inference and Resampling

Nonparametric Tests. Mathematics 47: Lecture 25. Dan Sloughter. Furman University. April 20, 2006

Introduction to Nonparametric Statistics

TMA4255 Applied Statistics V2016 (23)

Fish SR P Diff Sgn rank Fish SR P Diff Sng rank

Non-parametric (Distribution-free) approaches p188 CN

STAT 135 Lab 5 Bootstrapping and Hypothesis Testing

Chapter 7 Comparison of two independent samples

Wilcoxon Test and Calculating Sample Sizes

Nonparametric Statistics Notes

Introduction to Statistics

STAT 135 Lab 11 Tests for Categorical Data (Fisher s Exact test, χ 2 tests for Homogeneity and Independence) and Linear Regression

Nonparametric tests. Timothy Hanson. Department of Statistics, University of South Carolina. Stat 704: Data Analysis I

S D / n t n 1 The paediatrician observes 3 =

Stat 315: HW #6. Fall Due: Wednesday, October 10, 2018

Business Statistics MEDIAN: NON- PARAMETRIC TESTS

1 Statistical inference for a population mean

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

Relative efficiency. Patrick Breheny. October 9. Theoretical framework Application to the two-group problem

Nonparametric Statistics. Leah Wright, Tyler Ross, Taylor Brown

Dr. Maddah ENMG 617 EM Statistics 10/12/12. Nonparametric Statistics (Chapter 16, Hines)

Nonparametric Statistics

Comparison of Two Samples

Version 1: Equality of Distributions. 3. F (x) and G(x) represent the distribution functions corresponding to the Xs and Y s, respectively.

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

Lecture 26. December 19, Department of Biostatistics Johns Hopkins Bloomberg School of Public Health Johns Hopkins University.

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

Nonparametric tests. Mark Muldoon School of Mathematics, University of Manchester. Mark Muldoon, November 8, 2005 Nonparametric tests - p.

Review: General Approach to Hypothesis Testing. 1. Define the research question and formulate the appropriate null and alternative hypotheses.

Advanced Statistics II: Non Parametric Tests

Inferential Statistics

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

Nonparametric Location Tests: k-sample

Do not copy, post, or distribute. Independent-Samples t Test and Mann- C h a p t e r 13

Unit 14: Nonparametric Statistical Methods

Correct: P > Correct: < P < Correct: P = 0.036

Resampling Methods. Lukas Meier

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

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

STAT 135 Lab 3 Asymptotic MLE and the Method of Moments

Non-parametric tests, part A:

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

Non-parametric Hypothesis Testing

We know from STAT.1030 that the relevant test statistic for equality of proportions is:

One sided tests. An example of a two sided alternative is what we ve been using for our two sample tests:

Lecture 7: Hypothesis Testing and ANOVA

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

ST4241 Design and Analysis of Clinical Trials Lecture 7: N. Lecture 7: Non-parametric tests for PDG data

Summary of Chapters 7-9

Background to Statistics

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

Solutions exercises of Chapter 7

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

STAT 135 Lab 6 Duality of Hypothesis Testing and Confidence Intervals, GLRT, Pearson χ 2 Tests and Q-Q plots. March 8, 2015

Relating Graph to Matlab

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

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

Inferences About Two Proportions

MTMS Mathematical Statistics

Dealing with the assumption of independence between samples - introducing the paired design.

What to do today (Nov 22, 2018)?

Non-Parametric Two-Sample Analysis: The Mann-Whitney U Test

Recall that in order to prove Theorem 8.8, we argued that under certain regularity conditions, the following facts are true under H 0 : 1 n

Statistics: revision

Statistics for Managers Using Microsoft Excel Chapter 9 Two Sample Tests With Numerical Data

STAT Section 5.8: Block Designs

M(t) = 1 t. (1 t), 6 M (0) = 20 P (95. X i 110) i=1

Finansiell Statistik, GN, 15 hp, VT2008 Lecture 10-11: Statistical Inference: Hypothesis Testing

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

Non-parametric Tests

Chapter 7 Class Notes Comparison of Two Independent Samples

STAT 135 Lab 2 Confidence Intervals, MLE and the Delta Method

5 Introduction to the Theory of Order Statistics and Rank Statistics

8 Comparing Two Independent Populations

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

Lecture Slides. Section 13-1 Overview. Elementary Statistics Tenth Edition. Chapter 13 Nonparametric Statistics. by Mario F.

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

Nonparametric Methods

1 The Squared Ranks Test for Variances

Contents. Acknowledgments. xix

Statistical Procedures for Testing Homogeneity of Water Quality Parameters

Design of the Fuzzy Rank Tests Package

CHAPTER 8. Test Procedures is a rule, based on sample data, for deciding whether to reject H 0 and contains:

Biostatistics Quantitative Data

10.4 Hypothesis Testing: Two Independent Samples Proportion

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

Non-parametric Statistics

Tentative solutions TMA4255 Applied Statistics 16 May, 2015

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

Transcription:

STAT 135 Lab 8 Hypothesis Testing Review, Mann-Whitney Test by Normal Approximation, and Wilcoxon Signed Rank Test. Rebecca Barter March 30, 2015

Mann-Whitney Test

Mann-Whitney Test Recall that the Mann-Whitney test is a test for the difference between two independent populations, and can be conducted as follows 1. Concatenate the X i and Y j into a single vector Z 2. Let n 1 be the sample size of the smaller sample 3. Compute R = sum of the ranks of the smaller sample in Z 4. Compute R = n 1 (m + n + 1) R 5. Compute R = min(r, R ) 6. Compare the value of R to critical values in a table: if the value is less than or equal to the tabulated value, reject the null that F = G

Mann-Whitney test: the normal approximation The Mann-Whitney test tests the null hypothesis H 0 : F = G. This approach is based on the fact that when H 0 is true, we should have π = P(X < Y ) = 1 2 i.e. that it is equally likely that X < Y and that Y < X.

Mann-Whitney test: the normal approximation Under H 0 : F = G, we have π = P(X < Y ) = 1 2. Estimate the observed value of π by ranking the combined observations, X 1,..., X n, Y 1,..., Y m, from smallest (rank = 1) to largest (rank = n + m) look at the number of times that we have elements of X that are smaller than elements of Y. Then our observed proportion is: ˆπ = # times we see X i < Y j over all i, j nm so if we observe a value of ˆπ that is significantly different from 1 2, then this provides evidence against H 0.

Mann-Whitney test: the normal approximation Suppose, for example, that we had Then our ranks are X = (6.2, 3.7, 4.7, 1.3) Y = (1.2, 0.8, 1.4, 2.5, 1.1) rank(x ) = (9, 7, 8, 4) rank(y ) = (3, 1, 5, 6, 2) We only see elements of X being less than elements of Y twice: X 4 = 1.3 < Y 3 = 1.4 X 4 = 1.3 < Y 4 = 2.5 so ˆπ = 2 nm = 2 4 5 = 0.1, which is much less than the expected 0.5!

Mann-Whitney test: the normal approximation It turns out that ˆπ = 1 ( R mn ) m(m + 1) 2 where R is the sum of the ranks of the Y i s, n is the sample size for the X i s and m is the sample size for the Y i s.

Mann-Whitney test: the normal approximation Thus, for our example, where X = (6.2, 3.7, 4.7, 1.3) rank(x ) = (9, 7, 8, 4) Y = (1.2, 0.8, 1.4, 2.5, 1.1) rank(y ) = (3, 1, 5, 6, 2) we can verify the given formula: ˆπ = 1 ( R mn = 1 4 5 = 0.1 m(m + 1) 2 which is the same as we got before! ) ( (3 + 1 + 5 + 6 + 2) 5 6 2 )

Mann-Whitney test: the normal approximation Thus the Mann-Whitney test can be constructed as follows: Define our test statistic to be U Y = R m(m + 1) 2 and recall that U Y = nmˆπ, where under H 0, we have ˆπ = 0.5. To calculate an exact p-value for the test, we would need to know the distribution of U Y under H 0. Unfortunately, we don t know the exact distribution, but we can use the normal approximation to compute an approximate p-value.

Mann-Whitney test: the normal approximation Under H 0 : F = G, we have that E H0 (U Y ) = nm 2 nm(n + m + 1) Var H0 (U Y ) = 12 and it is known that, asymptotically, under H 0, the standardized statistic tends to a normal distribution: U Y E H0 (U Y ) VarH0 (U Y ) N(0, 1)

Exercise

Exercise: Mann-Whitney Researchers have asked several smokers how many cigarettes they had smoked in the previous day. The data is as follows Women Men 4 2 7 3 20 5 21 6 8 16 Why might we prefer to use a non-parametric (Mann-Whitney) test rather than a t-test? Is there enough evidence to conclude that there is a difference between the number of cigarettes smoked per day between the sexes?

Hypothesis testing for comparing paired samples

Comparing samples from paired populations So far we have focused on testing hypotheses for a parameter from a single population (H 0 : µ = 2) comparing a parameter from two different, but arbitrary and independent, populations (H 0 : µ 1 = µ 2 ) We now want to compare a parameter from paired populations. e.g. the (X i, Y i ) s might be independent pairs of twins.

Comparing samples from paired populations We can treat paired tests as a one-sample problem: where if we assume that D i = X i Y i has true mean µ D, we are testing H 0 : µ D = 0 versus H 1 : µ D > 0, H 1 : µ D < 0, H 1 : µ D 0 by observing whether D is far from 0 Can you see why is this different to observing X Y?

Hypothesis testing for comparing paired samples The paired Z-test

Comparing samples from paired populations If we know the true variance σd 2, then we can use a Z-test: corresponds to p-value: H 0 : µ D = 0 H 1 : µ D < 0 ( D P H0 (D d) = P H0 σ D / n ) d σ D / CLT n ( ) d Φ σ D / n

Comparing samples from paired populations If we know the true variance σd 2, then we can use a Z-test: corresponds to p-value: ( D P H0 (D d) = P H0 σ D / n H 0 : µ D = 0 H 1 : µ D > 0 ) d σ D / CLT n ( ) d 1 Φ σ D / n

Comparing samples from paired populations If we know the true variance σd 2, then we can use a Z-test: H 0 : µ D = 0 H 1 : µ D 0 corresponds to p-value: ( D P H0 ( D d ) = 2P H0 σ D / n d σ D / n ( )) d 2 (1 Φ σ D / n ) CLT

Hypothesis testing for comparing paired samples The paired t-test

Comparing samples from paired populations If we don t know the true variance σd 2, but the data comes from normal distributions, then we can use a t-test: corresponds to p-value: ( D P H0 (D d) = P H0 s d / n H 0 : µ D = 0 H 1 : µ D < 0 d ) ( s d / = P t n 1 n where s d is the sample standard deviation from our observed differences d 1,..., d n. and similarly for the other alternative hypotheses. d ) s d / n

Hypothesis testing for comparing paired samples The non-parametric Wilcoxon signed rank test

Comparing samples from paired populations What if we don t know the true variance, σd 2, and we also don t think our data comes from a normal distribution? We can use a non-parametric rank test to test the hypothesis. This test is called the Wilcoxon signed rank test, and is the paired sample analog to the Mann-Whitney test.

Wilcoxon signed rank test Technically, the WSRT is testing whether the D i come from a symmetric distribution, but think of this as testing the familiar H 0 : µ d = 0 since if there is no difference between the two paired conditions, we expect about half of the D i to be positive and half negative.

Wilcoxon signed rank test The general procedure is: Remove observations with no difference (D i = 0) Calculate R i = the rank of D i Calculate W i = sign(d i ) R i Compute the test statistic If H 0 is true, then E(W + ) = n(n + 1) 4 W + = i:w i >0 W i Var(W + ) = n(n + 1)(2n + 1) 24 so we can use a normal approximation to calculate a p-value.

Wilcoxon signed rank test If H 0 is true, then E(W + ) = n(n + 1) 4 Var(W + ) = n(n + 1)(2n + 1) 24 and it turns out that the standardized version of the statistic tends to a normal distribution: W + E(W + ) Var(W+ ) N(0, 1) so our p-value for the alternative H 1 : µ d < 0 is ( ) ( ) W + E(W + ) P w + E(W + ) w + E(W + ) = Φ Var(W+ ) Var(W+ ) Var(W+ ) and similarly for the other alternatives. Note that w + is the observed value of our test statistic.

Example: Wilcoxon signed rank test Suppose we have four pairs of before and after measurements, and we want to test the hypothesis that the after measurements are larger than the before measurements. That is H 0 : µ d = 0 H 1 : µ d > 0 Before After Difference (D) Difference ( D ) Rank (R) Signed Rank (W ) 25 27 2 2 2 2 29 25-4 4 3-3 60 59-1 1 1-1 27 37 10 10 4 4 Thus our observed test statistic is w + = 2 + 4 = 6

Example: Wilcoxon signed rank test Our test statistic is And H 0 : µ d = 0 H 1 : µ d > 0 E(W + ) = w + = 6 n(n + 1) 4 = 4 5 4 = 5 n(n + 1)(2n + 1) Var(W + ) = = 4 5 9 = 15 24 24 2 So we can estimate our p-value using the normal approximation ( ) p P Z > 6 5 = 1 Φ(0.365) = 0.358 15/2 And we thus fail to reject the null hypothesis: not enough evidence to show that the after measurements are larger.

Exercise

Exercise (Rice Exercise 11.6.22) An experiment was done to compare two methods of measuring the calcium content of animal feeds. The standard method uses calcium oxalate precipitation followed by titration and is quite time-consuming. A new method using flame photometry is faster. Measurements of the percent calcium content made by each method of 118 routine feed samples are contained in the file calcium.csv. Analyze the data to see if there is any systematic difference between the two methods. Use both parametric and nonparametric tests.