Chapter 6 Ranksumtest


Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Chapter 6 Ranksumtest

  1. 1. 12. Nonparametric test based on ranks Jin-Xin Zhang (张晋昕) School of Public Health Sun Yat-sen University 2009.11.02
  2. 2. <ul><li>A large scale survey reported that the mean of pulses for healthy males is 72 bpm . A physician randomly selected 25 healthy males in a mountainous area and measured their pulses, resulting in a sample mean of 75.2 bpm and a standard deviation of 6.5 bpm . Can one conclude that the mean of pulses for healthy males in the mountainous area is higher than that in the general population ( μ > μ 0 ) ? </li></ul>
  3. 4. Supporting Area Rejection Area Rejection Area
  4. 5. Parametric Test <ul><li>The methods of hypothesis testing we have learnt </li></ul><ul><li>(1) Assume: the variable follows a normal distribution; </li></ul><ul><li>(2) To test whether the means (parameters) are equal or not under such an assumption. </li></ul><ul><li>Therefore, they are called parametric tests . </li></ul>
  5. 6. Non-parametric tests (distribution-free tests) <ul><li>There aren ’t any assumptions about the distribution. </li></ul><ul><li>Chi-square test ( chapter. 6 ) is a kind of non-parametric test. </li></ul><ul><li>Rank sum tests: Another kind of non- </li></ul><ul><li>parametric test, which is based on ranks of the data. </li></ul>
  6. 7. <ul><li>Under the following situations, the non-parametric tests could be used: </li></ul><ul><li>a . The distribution of data is unknown; </li></ul><ul><li>b . The distribution of data is skew; </li></ul><ul><li>c . Ranked data or non-precise data; </li></ul><ul><li>d . A quick and brief analysis ( for pilot study ). </li></ul>
  7. 8. <ul><li>It is suitable for a variety of data: </li></ul><ul><li>Measurement or enumeration or ordinal </li></ul><ul><li>Normal distribution or not </li></ul><ul><li>Symmetric or not </li></ul><ul><li>However , </li></ul><ul><li>If the data are suitable for parametric tests, </li></ul><ul><li>the power of non-parametric test (if it is used) </li></ul><ul><li>will be slightly lower. </li></ul>
  8. 9. 12.1 Wilcoxon’s signed rank sum test (matched pairs) <ul><li>Example 12-1 In order to study the difference of intelligence between twin brothers, the intelligence scores of 12 pairs of twin brothers were measured. The results are listed in Table 12.2. </li></ul>
  9. 10. T + =24.5; T - =41.5
  10. 11. <ul><li>Steps: </li></ul><ul><li>(1) Hypotheses: </li></ul><ul><li>H 0 : The median of the difference is 0 </li></ul><ul><li>H 1 : The median of the difference is not 0 </li></ul><ul><li>α =0.05. </li></ul><ul><li>(2) Difference </li></ul><ul><li>(3) Ranking absolute differences (omit zero) </li></ul><ul><li>and give back the signs </li></ul><ul><li>(4) Rank sum and statistic </li></ul><ul><li>T = min {positive sum, negative sum} </li></ul><ul><li>(5) P -value and conclusion </li></ul><ul><li>From Table 10 , T is in 10-56, P >0.05, H 0 is not rejected. Conclusion: The intelligence score are at the same level . </li></ul>
  11. 12. 12.2 Wilcoxon’s rank sum test for two samples <ul><li>Two independent samples; </li></ul><ul><li>it is not a normal distribution, </li></ul><ul><li>or it is not sure whether the variable </li></ul><ul><li>follows a normal distribution . </li></ul>
  12. 14. <ul><li>(1)Hypotheses: </li></ul><ul><li>H 0 : The distributions of two populations are same </li></ul><ul><li>H 1 : The two distributions are not same </li></ul><ul><li>α = 0.05 </li></ul><ul><li>(2) Ranking all the observations in two samples. </li></ul><ul><li>If same values appear in (tie), give a mean rank. </li></ul><ul><li>“ 25” in both sample, and the ranks should be 9 and 10, so that (9+10)/2= 9.5 for each. </li></ul><ul><li>(3) Rank sum for smaller sample, T = T 1 = 78.5 </li></ul><ul><li>(4) P -value and conclusion ( Table 11 ) </li></ul><ul><li>T 0.05,5,9 =28~72, T is outside the range, P <0.05. </li></ul><ul><li>The difference is of statistical significance between two animals. </li></ul>
  13. 15. 12.3.1 Kruskal-Wallis’ H test for comparing more than 2 samples <ul><li>Example 12.3 14 newborn infants were grouped into 4 categories according to their mother’s smoking habit. </li></ul><ul><li>A: smoking more than 20 cigarettes per day; </li></ul><ul><li>B: smoking less than 20 cigarettes per day; </li></ul><ul><li>C: ex-smoker; </li></ul><ul><li>D: never smoking. </li></ul><ul><li>Their weights are listed in Table 12.7. </li></ul>
  14. 17. <ul><li>(1)Hypothesis : </li></ul><ul><li>H 0 : The distributions of three populations are all same </li></ul><ul><li>H 1 : The distributions of three populations are not all same </li></ul><ul><li>α = 0.05 </li></ul><ul><li>(2) Ranking all the observations in three samples </li></ul><ul><li>(Same way for ties) </li></ul><ul><li>(3) Rank sums for each sample </li></ul><ul><li>R 1 = R 2 =15, R 3 = R 4 =37.5 </li></ul>
  15. 18. <ul><li>(4) Statistic H </li></ul><ul><li>If there is no tie </li></ul><ul><li>If there are ties </li></ul><ul><li>t j : Number of individuals in j - th tie </li></ul><ul><li>Example 12.7: </li></ul>
  16. 19. (5) P -value and conclusion —— Compare with critical value of H ( C 7 ) or k : Number of samples Example 12.7: Conclusion: The weights are not all at an equal level.
  17. 20. 12.3.2 Friedman test for the data from a randomized block design Example 12.4 The riboflavin were tested for 3 samples of cabbage under four test conditions (A, B, C and D). The results are listed in Table 12.9. Now the question is if the test results are different in different kinds of test conditions.
  18. 24. 12.3.3. multiple comparison of mean ranks <ul><li>When the comparison among four groups results in </li></ul><ul><li>significant differences, multiple comparison is needed to </li></ul><ul><li>know who and who are different. Z tests for pair-wise </li></ul><ul><li>comparison could be used. </li></ul><ul><li>H 0 : The location of population A and B are different </li></ul><ul><li>H 1 : The location of population A and B are not different </li></ul><ul><li>α = 0.05 </li></ul>
  19. 26. <ul><li>(1)Hypothesis: </li></ul><ul><li>H 0 : this pair of two population distributions have the same location </li></ul><ul><li>H 1 : this pair of two population distributions have different locations, </li></ul><ul><li>α =0.05. </li></ul><ul><li>(2) Calculate Z value: </li></ul>
  20. 27. <ul><li>(3) Decide P value , </li></ul><ul><li>Weights in first group has a different level from that of fourth group. Since , The mothers who smoke may have babies with lower weights. </li></ul>Conclusion: Smoking may lead to the newborn’s lower weights.
  21. 28. The End