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

Similar documents
Hypothesis Testing in Action: t-tests

Hypothesis Testing in Action

Non-parametric methods

Distribution-Free Procedures (Devore Chapter Fifteen)

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

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

Nonparametric Statistics. Leah Wright, Tyler Ross, Taylor Brown

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

Non-parametric Hypothesis Testing

Module 9: Nonparametric Statistics Statistics (OA3102)

SEVERAL μs AND MEDIANS: MORE ISSUES. Business Statistics

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

TMA4255 Applied Statistics V2016 (23)

Rank-Based Methods. Lukas Meier

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

Statistics: revision

STAT Section 5.8: Block Designs

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

Non-parametric tests, part A:

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

Wilcoxon Test and Calculating Sample Sizes

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

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.

Violating the normal distribution assumption. So what do you do if the data are not normal and you still need to perform a test?

3. Nonparametric methods

Lecture 7: Hypothesis Testing and ANOVA

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

6 Single Sample Methods for a Location Parameter

Non-parametric Statistics

Physics 509: Non-Parametric Statistics and Correlation Testing

Nonparametric Location Tests: k-sample

LECTURE 5. Introduction to Econometrics. Hypothesis testing

Inferential Statistics

Resampling Methods. Lukas Meier

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

Tentative solutions TMA4255 Applied Statistics 16 May, 2015

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

Analysis of Variance (ANOVA)

Chapter 18 Resampling and Nonparametric Approaches To Data

Unit 14: Nonparametric Statistical Methods

Introduction to Statistical Analysis. Cancer Research UK 12 th of February 2018 D.-L. Couturier / M. Eldridge / M. Fernandes [Bioinformatics core]

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

Non-parametric (Distribution-free) approaches p188 CN

Analysis of 2x2 Cross-Over Designs using T-Tests

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

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

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

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

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

Statistical Inference: Estimation and Confidence Intervals Hypothesis Testing

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

Background to Statistics

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

Nonparametric hypothesis tests and permutation tests

How do we compare the relative performance among competing models?

Statistical Inference Theory Lesson 46 Non-parametric Statistics

Transition Passage to Descriptive Statistics 28

Exam details. Final Review Session. Things to Review

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

Design of the Fuzzy Rank Tests Package

We might divide A up into non-overlapping groups based on what dorm they live in:

Frequency table: Var2 (Spreadsheet1) Count Cumulative Percent Cumulative From To. Percent <x<=

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

Correlation. We don't consider one variable independent and the other dependent. Does x go up as y goes up? Does x go down as y goes up?

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

PSY 305. Module 3. Page Title. Introduction to Hypothesis Testing Z-tests. Five steps in hypothesis testing

Last two weeks: Sample, population and sampling distributions finished with estimation & confidence intervals

Nonparametric Statistics

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

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

1 ONE SAMPLE TEST FOR MEDIAN: THE SIGN TEST

The independent-means t-test:

Data analysis and Geostatistics - lecture VII

Hypotheses and Errors

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

Mitosis Data Analysis: Testing Statistical Hypotheses By Dana Krempels, Ph.D. and Steven Green, Ph.D.

STAT Section 3.4: The Sign Test. The sign test, as we will typically use it, is a method for analyzing paired data.

Class 4: Classification. Quaid Morris February 11 th, 2011 ML4Bio

Contents Kruskal-Wallis Test Friedman s Two-way Analysis of Variance by Ranks... 47

NONPARAMETRIC TESTS. LALMOHAN BHAR Indian Agricultural Statistics Research Institute Library Avenue, New Delhi-12

Comparison of Two Population Means

Last week: Sample, population and sampling distributions finished with estimation & confidence intervals

Nonparametric Statistics Notes

Hypothesis testing I. - In particular, we are talking about statistical hypotheses. [get everyone s finger length!] n =

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

A3. Statistical Inference Hypothesis Testing for General Population Parameters

Solutions exercises of Chapter 7

Glossary for the Triola Statistics Series

HYPOTHESIS TESTING. Hypothesis Testing

What is a Hypothesis?

STATISTIKA INDUSTRI 2 TIN 4004

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

Hypothesis testing, part 2. With some material from Howard Seltman, Blase Ur, Bilge Mutlu, Vibha Sazawal

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

Comparison of Two Samples

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

Data Analysis and Statistical Methods Statistics 651

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

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

Transcription:

Nonparametric s Mark Muldoon School of Mathematics, University of Manchester Mark Muldoon, November 8, 2005 Nonparametric s - p. 1/31

Overview The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Last week we studied the t-s, which assume the data are drawn from normal distributions. We also learned how to make qq-plots... what if these showed our data to be non-normally distributed? The sign, a simple introduction to the idea of non-parametric s The Mann-Whitney U, an analogue of the two-sample t- The Wilcoxon rank-sum, an analogue of the paired-sample t- Why would you want to use non-parametric Why wouldn t you want to use them? Mark Muldoon, November 8, 2005 Nonparametric s - p. 2/31

The sign, motivation The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Recall the first of H.H. Koh s macular pigment data sets Patients Controls Difference Sign of Diff. 0.189 0.377-0.188-0.301 0.26 0.041 + 0.072 0.161-0.089-0.242 0.119 0.123 + 0.271 0.295-0.024-0.32 0.055 0.256 + 0.409 0.037 0.372 + 0.279 0.179 0.100 + 0.556 0.453 0.143 + Mark Muldoon, November 8, 2005 Nonparametric s - p. 3/31

The idea of the sign The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Suppose the two groups were the same, in the sense that their MPOD levels were drawn independently from the same distribution. Positive and negative differences would be equally likely: each has probability 0.5. Say there are N pairs. Then the number of negative differences has a binomial distribution with p = 0.5. (Ignore differences of zero and reduce N accordingly). This is a sort of paired-sample. Mark Muldoon, November 8, 2005 Nonparametric s - p. 4/31

Distribution of number of signs 0.25 The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Generally Probability 0.2 0.15 0.1 0.05 0 1 2 3 4 5 6 7 8 9 Number of - signs P( k neg. diffs in N pairs ) = p k (1 p) N k N! k! (N k)! = (0.5) N N! k! (N k)! Mark Muldoon, November 8, 2005 Nonparametric s - p. 5/31

MPOD data, conclusion The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Returning to the MPOD data, one finds that if the null hypothesis were true... The probability of seeing 3 or fewer minus signs (a one-sided ) is about 0.254. The probability of seeing either 3 or fewer or 6 or more minus signs (the two-sided version) is about 0.508. It appears, from this, that the patients and the controls have the same distribution of IOP. Mark Muldoon, November 8, 2005 Nonparametric s - p. 6/31

The Mann-Whitney The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small This is a non-parametric replacement for the two-sample t-: Ingredients are two {x 1, x 2,..., x Nx } and {y 1, y 2,..., y Ny }, not necessarily the same size. The null hypothesis is that the x s and y s are drawn from the same distribution. Alternative hypotheses include: The two data sets are drawn from different distributions (two-tailed alternative) The x s tend to be larger (one-tailed alternative) The y s tend to be larger (another one-tailed alternative) Mark Muldoon, November 8, 2005 Nonparametric s - p. 7/31

The idea behind Mann-Whitney The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small The idea behind the is clearest when the lists are very small, say 2 x s and 3 y s. Assemble all 5 numbers into a single list and arrange them in ascending order. If the null hypothesis is true if these numbers really are all drawn from the same distribution then all orderings of the x s and y s are equally likely. It would be somewhat odd if, say, the two x s were the first two entries in the ordered list. It is, of course, equally unlikely that they should fall in the last two entries. Mark Muldoon, November 8, 2005 Nonparametric s - p. 8/31

Possible outcomes when ordering 5 letters The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Pattern of x s & y s Ranks of in ordered list the x s Rank Sum xxyyy 1, 2 3 xyxyy 1, 3 4 xyyxy 1, 4 5 yxxyy 2, 3 5 yxyxy 2, 4 6 xyyyx 1, 5 6 yyxxy 3, 4 7 yxyyx 2, 5 7 yyxyx 3, 5 8 yyyxx 4, 5 9 Mark Muldoon, November 8, 2005 Nonparametric s - p. 9/31

Remarks The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small There are five-choose-two, ( ) 5 = 2 ways to arrange the letters 5! 2! 3! = 10 The sum of the ranks associated with the two x s ranges from 3 to 9. All the values of the rank-sum are reasonably likely: Rank sum 3 4 5 6 7 8 9 Probability 0.1 0.1 0.2 0.2 0.2 0.1 0.1 Mark Muldoon, November 8, 2005 Nonparametric s - p. 10/31

Larger The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small For even moderate N x and N y there are large numbers of patterns (large compared to the range of the rank sum, that is), and some values of the rank sum are much, much more likely than others. Num. Min. Max. Range of N x N y patterns rank-sum rank-sum rank-sum 2 5 21 3 13 11 2 6 28 3 15 13 2 7 36 3 17 15 2 8 45 3 19 17 3 17 2280 6 57 52 Mark Muldoon, November 8, 2005 Nonparametric s - p. 11/31

Larger, details The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small The formulae are: Num. of patterns = (N x + N y )! N x! N y! Min. rank-sum = N x(n x + 1) 2 Max. rank-sum = N x(n x + 2N y + 1) 2 Range of rank-sum = N x N y + 1 Mark Muldoon, November 8, 2005 Nonparametric s - p. 12/31

.1 2 3 4 Larger, in pictures Ranks..... 26 27 28 86 p < 0.002 130 p < 0.247 141 p < 0.435 161 p < 0.232 199 p < 0.005 The figures at the end of each row give the rank sum for the red bars and the one-sided probability of a sum that size having arisen by chance if the null hypothesis were true. Mark Muldoon, November 8, 2005 Nonparametric s - p. 13/31

The Mann-Whitney recipe The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small The ingredients are a confidence level C and two lists of values {x 1, x 2,..., x Nx } and {y 1, y 2,..., y Ny } where N x N y. The null hypothesis is that these two lists are drawn from the same distribution. Assemble all the data into one large list. Sort the data into ascending order and assign ranks, averaging over ties. Add up the ranks of the x s and call this number R x. Work out the probability of getting this sum when adding together N x randomly chosen numbers from the list {1, 2,..., (N x + N y )}. Mark Muldoon, November 8, 2005 Nonparametric s - p. 14/31

The Mann-Whitney recipe, continued The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small The statistic, U, is defined by U = min(u x, u y ) where u x = N x N y + N x(n x + 1) 2 u y = N x N y u x = N x N y + N y(n y + 1) 2 where R y is the rank sum for the y s. R x R y Mark Muldoon, November 8, 2005 Nonparametric s - p. 15/31

The Mann-Whitney recipe, large The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small When bothn x and N y are bigger than about 8 this statistic is approximately normally distributed with mean and variance given by: µ U = N xn y 2 Nx N y (N x + N y + 1) σ U = 12 One can thus check whether the U one measured is extreme by computing a z-score z = U µ U σ U and checking it against the standard tables. Mark Muldoon, November 8, 2005 Nonparametric s - p. 16/31

Large with many tied values The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small If the data contain many repeated values the standard deviation of the rank sum will be greatly diminished. In this case a more accurate expression for σ U is this appalling formula v 0 1 0 1 Nx+Ny u NxNy t @ A B X @ r 2 C (Nx + Ny)(Nx + Ny 1) j A j 0 @ N xny(nx + Ny + 1) 2 4(Nx + Ny 1) Here the r j are the ranks (after averaging) of all the data. 1 A Mark Muldoon, November 8, 2005 Nonparametric s - p. 17/31

The Mann-Whitney recipe, small The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small For smaller values of N y one consults the attached table and rejects the null hypothesis in favour of the two-sided alternative if U is strictly less than the value tabulated for α = (1 C)/2; rejects the null in favour of the one-sided alternative the x s tend to be bigger if u x is strictly less than the tabulated value for α = (1 C); rejects the null in favour of the one-sided alternative the y s tend to be bigger if u y is strictly less than the tabulated value for α = (1 C); Mark Muldoon, November 8, 2005 Nonparametric s - p. 18/31

The Mann-Whitney, an example The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Consider the following random sub-sample from Catherine Collins s IOP data (the file CDvsIOP.xls that we have examined in computer labs). Received treatment 22 29 40 34 26 No treatment 20 27 16 18 48 22 Take the values from the Treatment group to be the x s as there are fewer of them. Then N x = 5 and N y = 6. Mark Muldoon, November 8, 2005 Nonparametric s - p. 19/31

Sorting the data The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Arranging the data in order one finds Value: 16 18 20 22 22 26 27 29 34 40 48 Rank: 1 2 3 4 5 6 7 8 9 10 11 But it doesn t really make sense to give the two 22 s different ranks: one should average the rank over tied values. Value: 16 18 20 22 22 26 27 29 34 40 48 Rank: 1 2 3 4.5 4.5 6 7 8 9 10 11 Mark Muldoon, November 8, 2005 Nonparametric s - p. 20/31

Summing the ranks The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small The rank-sum corresponding to the x s is thus R x = 4.5 + 6 + 8 + 9 + 10 = 37.5 and the statistics are u x = N x N y + N x(n x + 1) R x 2 = 5 6 + (5 6)/2 37.5 = 7.5 and u y = N x N y u x = 22.5 Mark Muldoon, November 8, 2005 Nonparametric s - p. 21/31

Checking the table The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Clearly the smaller of the two is u x so U = u x. Consulting the attached table in the rows for n 1 = 5 and n 2 = 6 we see that we cannot reject the null hypothesis: these 11 values could plausibly all have been drawn from the same distribution. Mark Muldoon, November 8, 2005 Nonparametric s - p. 22/31

Paired : the Wilcoxon The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small There is also a non-parametric analogue of the paired-sample t- which looks at the distribution of the differences between the members of the pairs. The null hypothesis is that both members of each pair are drawn from the same distribution, though the distribution may vary from pair to pair. If the null is true, the differences are equally likely to be positive or negative and should be distributed symmetrically. These ideas give rise to the Wilcoxon... Mark Muldoon, November 8, 2005 Nonparametric s - p. 23/31

The Wilcoxon recipe The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small The ingredients are a confidence level C and a list of paired values {(x 1, y 1 ),..., (x N, y N )}; here there are N pairs. The null hypothesis is that the respective members of the N pairs are drawn from identical distributions. Compute the list of differences δ j = (x j y j ). Sort the absolute values of the differences { δ j } into ascending order. Add up the ranks assigned to the positive differences and call it w +. Similarly, find the rank-sum for the negative differences and call it w. Mark Muldoon, November 8, 2005 Nonparametric s - p. 24/31

The Wilcoxon recipe, large The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small For N > 25 there is an approximate based on a z-score. Find T = min(w +, w ) and compute where µ T and σ T are given by: µ T = σ T = z = T µ T σ T N(N + 1) 4 N(N + 1)(2N + 1). 24 Mark Muldoon, November 8, 2005 Nonparametric s - p. 25/31

The Wilcoxon recipe, small The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small For small N one must do something more involved using the attached table Reject the null in favour of the two-sided alternative if T = min(w +, w ) is less than or equal to the tabulated value for α = (1 C)/2. Reject the null in favour of the one-sided alternative the x s tend to be bigger if w is less than or equal to tabulated value for α = (1 C); Reject the null in favour of the one-sided alternative the y s tend to be bigger if w + is less than or equal to the tabulated value for α = (1 C); Mark Muldoon, November 8, 2005 Nonparametric s - p. 26/31

Example: Wilcoxon applied to The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Here again are the differences, (patient - control), in the MPOD data: δ 0.188 0.041 0.089 0.123 0.024 0.256 0.372 0.100 0.143 δ 0.188 0.041 0.089 0.123 0.024 0.256 0.372 0.100 0.143 where those among the δ j that come from negative differences are highlighted in red. Sorting these yields δ 0.024 0.041 0.089 0.100 0.123 0.143 0.188 0.256 0.372 Rank 1 2 3 4 5 6 7 8 9 Mark Muldoon, November 8, 2005 Nonparametric s - p. 27/31

MPOD pairs: rank sum The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small The two rank sums are w = 1 + 3 + 7 = 11 w + = 2 + 4 + 5 + 6 + 8 + 9 = 34 Thus T = w = 11 and one sees, from the attached table, that once again we cannot reject the null hypothesis with any substantial confidence. Mark Muldoon, November 8, 2005 Nonparametric s - p. 28/31

Why use non-parametric The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small There are two main reasons: They apply to more kinds of data than the t-s. Suppose the observations can be ordered, but that differences between the observations do not have a consistent meaning. For example, anxiety is sometimes measured with sets of yes-no questions and the score is the number of yes answers. A set of 36 questions gives a scale 0-36, but the difference between scores of 1 and 2 is not the same as the difference between scores of 31 and 32. Even when t-ing is possible, the data may be so obviously non-normal (say, bimodal) as to rule it out. Mark Muldoon, November 8, 2005 Nonparametric s - p. 29/31

Why not non-parametric The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small In light of the preceding slide one might wonder, why not use non-parametric s all the time? Non-parametric s cannot give significant results for very small as all the possible rank-sums are fairly likely. They may require the use of fiddly tables and are not built into Excel (though they are available in R). They do not, without the addition of extra assumptions, give confidence intervals for the means or medians of the underlying distributions. Mark Muldoon, November 8, 2005 Nonparametric s - p. 30/31

Downsides, continued The sign, motivation The Mann-Whitney Larger Larger, in pictures large small Paired : the Wilcoxon, small Other reasons not to use non-parametric s include They are not entirely without assumptions: they assume that the data can be ordered and if there are lots of ties the power of the will be much diminished. If the t-s are applicable they will be more powerful: they will more often correctly detect small differences between two normally-distributed groups of measurements (whether paired or not). Mark Muldoon, November 8, 2005 Nonparametric s - p. 31/31