Presentation is loading. Please wait.

Presentation is loading. Please wait.

Biostatistics, statistical software VII. Non-parametric tests: Wilcoxon’s signed rank test, Mann-Whitney U-test, Kruskal- Wallis test, Spearman’ rank correlation.

Similar presentations


Presentation on theme: "Biostatistics, statistical software VII. Non-parametric tests: Wilcoxon’s signed rank test, Mann-Whitney U-test, Kruskal- Wallis test, Spearman’ rank correlation."— Presentation transcript:

1 Biostatistics, statistical software VII. Non-parametric tests: Wilcoxon’s signed rank test, Mann-Whitney U-test, Kruskal- Wallis test, Spearman’ rank correlation. Krisztina Boda PhD Department of Medical Informatics, University of Szeged

2 Krisztina Boda INTERREG 2 Parametric tests Parameter: a parameter is a number characterizing an aspect of a population (such as the mean of some variable for the population), or that characterizes a theoretical distribution shape. Usually, population parameters cannot be known exactly; in many cases we make assumptions about them.

3 Krisztina Boda INTERREG 3 Parameters of the normal distribution: ,  Parameter of the binomial distribution: n, p Parameter of the Poisson distribution:

4 Krisztina Boda INTERREG 4 Normal distributions N( ,  ) N(0,1) N(1,1) N(0,2) ,  : parameters (a parameter is a number that describes the distribution)

5 Krisztina Boda INTERREG 5 Binomial distributions 1. Each trial results in one of two possible, mutually exclusive outcome. (success, failure) 2. The probability of a success, p, remains constant from trial to trial 3. The trials are independent. We are interested in being able to compute the probability of k successes in n trials. The binomial distribution is useful for describing distributions of binomial events, such as the number of males and females in a random sample of companies, or the number of defective components in samples of 20 units taken from a production process. The binomial distribution is defined as: p is the probability that the respective event will occur q is equal to 1-p n is the maximum number of independent trials.

6 Krisztina Boda INTERREG 6 Example Suppose that it is known that 30% of a certain population are immune to some disease. If a random sample of size n=10 is selected from this population, what is the probability that it will contain exactly k=4 immune persons?

7 Krisztina Boda INTERREG 7

8 Krisztina Boda INTERREG 8 Poisson distribution The Poisson distribution is also sometimes referred to as the distribution of rare events. Examples of Poisson distributed variables are number of accidents per person, number of sweepstakes won per person, or the number of catastrophic defects found in a production process. If n tends to infinity, but at the same time np= is kept constant the binomial distribution approaches a fixed distribution

9 Krisztina Boda INTERREG 9 Example. In a certain disease the number of new occurrences in a month is 3 in average. Assuming that the number of new occurrences follows a Poisson distribution, what is the probability that  Nobody becomes ill (0.0498)  There are exactly 2 new occurrences (0.224)

10 Krisztina Boda INTERREG 10 Parametric tests The null hypothesis contains a parameter of a distribution. The assumptions of the tests are that the samples are drawn from a normally distributed population. One sample t-test: H0:  =c, Two sample t-test: H 0 :  1 =  2, assumptions:  1 =  2

11 Krisztina Boda INTERREG 11 Nonparametric tests We do not need to make specific assumptions about the distribution of data. They can be used when  The distribution is not normal  The shape of the distribution is not evident  Data are measured on an ordinal scale (low- normal-high, passed – acceptable – good – very good)

12 Krisztina Boda INTERREG 12 Ranking data Nonparametric tests can't use the estimations of population parameters. They use ranks instead. Instead of the original sample data we have to use its rank. To show the ranking procedure suppose we have the following sample of measurements: 199, 126, 81, 68, 112, 112. Sort the data in ascending order: 68, 81,112,112,126,199 Give ranks from 1 to n: 1, 2, 3, 4, 5, 6 Cases 5 and 6 are equal, they are assigned a rank of 3.5, the average rank of 3 and 4. We say that case 5 and 6 are tied. Ranks corrected for ties: 1, 2, 3.5, 3.5, 5, 6

13 Krisztina Boda INTERREG 13 Result of ranking data Case Data Rank Ranks corrected for ties 4 68 1 1 3 81 2 2 5 112 3 3.5 6 112 4 3.5 2 126 5 5 1 199 6 6 The sum of all ranks must be Using this formula we can check our computations. Now the sum of ranks is 21, and 6(7)/2=21.

14 Krisztina Boda INTERREG 14 Nonparametric tests for paired data (nonparametric alternatives of paired t-test) Sign test Wilcoxon’s matched pairs test Null hypothesis: the paired samples are drawn from the same population

15 Krisztina Boda INTERREG 15 The sign test Example: 13 students were measured in reading speed and comprehension at a course ending and after 1 month. Suppose we have reason to believe that the two distributions of reading scores are not normal. Number of positive signs: 6 Number of negative signs: 5 Cases with no change are omitted Student Score Score Difference Sign at course after ending 1 month 150 52-2 - 248 51-3 - 346 460 450 491 + 562 502 + 680 7010 + 723 212 + 830 33-3 - 945 46-1 - 1053 530 1149 481 + 1251 483 + 1346 48-2 -

16 Krisztina Boda INTERREG 16 Table of the sign test The table contains the acceptance region for given sample size and 

17 Krisztina Boda INTERREG 17 Decision based on table If the distributions of the two variables are the same (If the null hypothesis is true), the numbers of positive and negative differences should be similar. The null hypothesis is accepted if both numbers lie in the interval given it table for the sign test Number of positive signs: 6 Number of negative signs: 5 For n=11 and  =0.05, this interval is 1-10. As both 5 and 6 lies in the interval 1-10, we accept the null hypothesis at 5% level.

18 Krisztina Boda INTERREG 18 The Wilcoxon signed rank test Example: 13 students were measured in reading speed and comprehension at a course ending and after 1 month. Suppose we have reason to believe that the two distributions of reading scores are not normal. Sum of ranks belonging to positive signs: R + =40.5 Sum of ranks belonging to negative signs: R - =25.5 Cases with no change are omitted Student Score Score Difference Rank at course after ignoring ending 1 month signs 150 52-2 5.5 248 51-3 9 346 460 450 491 2 562 502 5.5 680 7010 11 723 212 830 33-3 9 945 46-1 2 1053 530 1149 481 2 1251 483 9 1346 48-2 5.5

19 Krisztina Boda INTERREG 19 Table of the Wilcoxon signed rank test The table contains the acceptance region for given sample size and 

20 Krisztina Boda INTERREG 20 Decision based on table If the distributions of the two variables are the same (If the null hypothesis is true), the sum of positive and negative ranks should be similar. The null hypothesis is accepted if both numbers lie in the interval given it table for the test Sum of ranks belonging to positive signs: R + =40.5 Sum of ranks belonging to negative signs: R - =25.5 For n=11 and  =0.05, this interval is 10-56. As both rank sums are in this interval, we do not reject the null hypothesis and claim that the difference is not significant at 5% level.

21 Krisztina Boda INTERREG 21 The case of large samples When the sample size is large, we can count the mean and standard deviation of the ranks and use the normal distribution to get the p-value. Computer packages use this normal approximation also in case of small sample size

22 Krisztina Boda INTERREG 22 Nonparametric test for data in independent groups (nonparametric alternatives of two sample t-test) Mann-Whitney U test Null hypothesis: the samples are drawn from the same population

23 Krisztina Boda INTERREG 23 Hypothetical example The change of body weight are compared in two groups: patients having a special diet and control patients. Null hypothesis: the diet is not effective, data are drawn from the same population. The original data are ranked and the sum of ranks in each group is computed. If the null hypothesis is true, the sum of ranks in the two groups are similar.

24 Krisztina Boda INTERREG 24

25 Krisztina Boda INTERREG 25 Table of the Mann- Whitney U test

26 Krisztina Boda INTERREG 26 Decision based on table If the distributions of the two variables are the same (If the null hypothesis is true), the sum of ranks in the two groups should be similar. The test statistic T is the sum of the ranks in the smaller group. The null hypothesis is accepted T lies in the interval given it table for the test Sum of ranks in the first group (n=10): R 1 =140 Sum of ranks in the second group (n=11): R 2 =91 The test statistic T is the sum of the ranks in the smaller group. T=140. For n1=10 and n2=11 and  =0.05, this interval is 81-139. As T lies outside of this interval, we reject the null hypothesis and claim that the difference is significant at 5% level.

27 Krisztina Boda INTERREG 27 An alternative test statistic The statistic U (due to Mann Whitney) is the number of all possible pairs of observations comprising one from each sample, say x i and y i, for which x i <y i. This if the sample sizes are n 1 and n 2, the U/n 1 n 2 is the proportion of all such pairs, and so is also the estimated probability that a new observation from the first population will be less than a new observation sampled from the second population.

28 Krisztina Boda INTERREG 28 The case of large samples When the sample size is large, T test statistic T has an approximately Normal distribution And we can calculate the test statistic z according to the following formula: (n s and n L are the sample sizes in the smaller and larger group respectively). Computer packages use this normal approximation also in case of small sample size

29 Krisztina Boda INTERREG 29 Comparing several independent groups: the Kruskal-Wallis test It is also called nonparametric one-way ANOVA It tests whether k independent samples that are defined by a grouping variable are from the same population. This test assumes that there is no a priori ordering of the k populations from which the samples are drawn. As a result, it gives one p-value. If the null hypothesis is rejected, further tests are required to make pairwise comparisons. These pairwise comparisons are generally not available in standard statistical packages. Pairwise comparisons can be performed by Mann Whitney U tests and p-values can be corrected by Bonferroni correction.

30 Krisztina Boda INTERREG 30 Comparison of several related samples: the Friedman test The Friedman test is the nonparametric equivalent of a one-sample repeated measures design or a two-way analysis of variance with one observation per cell. Friedman tests the null hypothesis that k related variables come from the same population. For each case, the k variables are ranked from 1 to k. The test statistic is based on these ranks. As a result, it gives one p-value. If the null hypothesis is rejected, further tests are required to make pairwise comparisons. These pairwise comparisons are generally not available in standard statistical packages. Pairwise comparisons can be performed by Wilxocon signed rank tests and p-values can be corrected by Bonferroni correction.

31 Krisztina Boda INTERREG 31 Review questions and exercises Problems to be solved by hand- calculations ..\Handouts\Problems hand VII.doc..\Handouts\Problems hand VII.doc Solutions ..\Handouts\Problems hand VII solutions.doc..\Handouts\Problems hand VII solutions.doc Problems to be solved using computer - none

32 Krisztina Boda INTERREG 32 Useful WEB pages  http://www-stat.stanford.edu/~naras/jsm http://www-stat.stanford.edu/~naras/jsm  http://www.ruf.rice.edu/~lane/rvls.html http://www.ruf.rice.edu/~lane/rvls.html  http://my.execpc.com/~helberg/statistics.html http://my.execpc.com/~helberg/statistics.html  http://www.math.csusb.edu/faculty/stanton/m26 2/index.html http://www.math.csusb.edu/faculty/stanton/m26 2/index.html


Download ppt "Biostatistics, statistical software VII. Non-parametric tests: Wilcoxon’s signed rank test, Mann-Whitney U-test, Kruskal- Wallis test, Spearman’ rank correlation."

Similar presentations


Ads by Google