TMA4255 Applied Statistics V2016 (23) Part 7: Nonparametric tests Signed-Rank test [16.2] Wilcoxon Rank-sum test [16.3] Anna Marie Holand April 19, 2016, wiki.math.ntnu.no/tma4255/2016v/start
2 Outline of part 7 Approximation of E and Var First order Taylor approximation [p 133-135] Nonparametric tests: One sample or two paired samples: The sign test [16.1], for continuous distributions. The (Wilcoxon) signed-rank test [16.2], for continuous symmetric distributions. Two independent samples: The Wilcoxon rank-sum test (Mann-Whitney) [16.3], for two continuous distributions of the same shape.
3 Shoshoni and golden ratio conjugate Data set of ratio of height/length for n = 8 rectangles found on leather items at Shoshoni indians: 0.693 0.662 0.690 0.606 0.570 0.749 0.672 0.628 The golden ratio, 1+ 5 2 = 1.618, is the longer segment divided by the shorter, while the reverse is called the golden ratio conjugate, 0.618. Do the ratioes from the shoshoni rectangles correspond with the golden ratio (conjugate)? H 0 : median of rectangles ratios=0.618 vs. H 1 : not so. Sign test gave a p-value of 0.29. But, the sign test only used the sign of each observation as compared to the hypothesized mean. Can we do better?
4 The Sign Test [16.1] Use with one sample or two paired samples. Test for the median, or the mean in a symmetric distribution. Binomial test based on the number of positive (or negative) differences between observations and the hypothesized median. Binomial (n, p = 0.5). Normal approximation to the binomial used for n large. General rule of thumb np 5 and n(1 p) 5, here p = 0.5, so n 10. Values equal to the hypothesized median are deleted from the data set. Only the sign of the data (wrt the hypthesized median), and not the magnitude (actual value) of the data are used.
5 The Signed-Rank Test Source: Statistics review 6: Nonparametric methods Elise Whitley and Jonathan Ball.
6 Shoshoni and golden ratio conjugate y i y i 0.618 y i 0.618 rank 0.628 0.010 0.010 1 0.606-0.012 0.012 2 0.662 0.044 0.044 3 0.570-0.048 0.048 4 0.672 0.054 0.054 5 0.690 0.072 0.072 6 0.693 0.075 0.075 7 0.749 0.131 0.131 8
7 The Signed-Rank Test: Critical values
9 Critical values: W +, W and W = min(w +, W ) We have one sample of n Y i s (or the difference between paired samples). The null hypothesis tested is H 0 : µ = µ 0. We form differences Y i µ 0, and rank them. W + is the sum of the ranks of the positive differences. W + is the sum of the ranks of the negative differences. Which W (W +, W or W ) to be used to compare to the critical values in Table A16 is deciede by the alternativ hypothesis: H 1 : µ < µ 0 : Reject H 0 when W + critical value (one-sided) H 1 : µ > µ 0 : Reject H 0 when W critical value (one-sided) H 1 : µ µ 0 : Reject H 0 when W critical value (two-sided)
10 The Signed-Rank Test: questions Q: What about zeros? Remove, as for the sign test. Q: What about ties? If two observations have the same absolute value, and these two values should have been assigned rank 3 and 4 (say), then both observations are assigned rank 3.5. Q: What if n is large (n 15)? Instead of the tables use the normal approximation to calculate critical values and tail probabilites. Z = W E(W ) Var(W ) where E(W ) = n(n + 1)/4 and Var(W ) = n(n + 1)(2n + 1)/24.
11 Tar example
12 The Rank-Sum Test Source: Statistics review 6: Nonparametric methods Elise Whitley and Jonathan Ball.
13 The Rank-Sum Test:Critical values
14 The Rank-Sum Test: tail probabilities
15 Critical values and U 1, U 2 and U = min(u 1, U 2 ) Sample 1: has the n 1 observations, rank sum W 1 and adjusted rank sum U 1 = W 1 n 1(n 1 +1) 2. Sample 2: has the n 2 observations, rank sum W 2 and adjusted rank sum U 2 = W 2 n 2(n 2 +1) 2. Here n 1 n 2. The null hypothesis about the medians µ is H 0 : µ 1 = µ 2. Which U (U 1, U 2 or U) to be used to compare to the critical values in Table A17 is deciede by the alternativ hypothesis: H 1 : µ 1 < µ 2 : Reject H 0 when U 1 critical value (one-sided) H 1 : µ 1 > µ 2 : Reject H 0 when U 2 critical value (one-sided) H 1 : µ 1 µ 2 : Reject H 0 when U critical value (two-sided)
16 Efficiency of the Wilcoxon Rank-Sum test When data are normal with equal variances, the rank-sum test is 95% as efficient as the pooled t-test for large samples. 95% efficient= the t-test needs 95% of the sample size of the rank-sum test to acihive the same power. The rank-sum test will always be at least 86% as efficient as the pooled t-test, and may be more efficient if the underlying distributions are very non-normal, escpecially with heavy tails. Power calculations for the rank-sum tests is in general difficult, since we need to specify the shapes of the two distributions. Taken from Devore.
17 Balance Is it harder to maintain your balance while you are concentrating? Nine elderly and eight young people stood barefoot on a "force platform" and was asked to maintain a stable upright position and to react as quickly as possible to an unpredictable noise by pressing a hand held button. The noise came randomly and the subject concentrated on reacting as quickly as possible. The platform automatically measured how much each subject swayed in millimeters in both the forward/backward and the side-to-side directions. http://lib.stat.cmu.edu/dasl/stories/maintainingbalance.html Sway Group 1.5 14 young 1.5 14 young 3 15 young 4.5 17 young 4.5 17 young 6.5 19 elderly 6.5 19 elderly 8 20 elderly 9.5 21 elderly 9.5 21 young 11 22 young 12 24 elderly 13.5 25 elderly 13.5 25 young 15 29 elderly 16 30 elderly 17 50 elderly
18 Advantages of nonparametric tests Nonparametric methods require no or very limited assumptions to be made about the format of the data, and they may therefore be preferable when the assumptions required for parametric methods are not valid. Nonparametric methods can be useful for dealing with unexpected, outlying observations that might be problematic with a parametric approach. Nonparametric methods are intuitive and are simple to carry out by hand, for small samples at least. Nonparametric methods are often useful in the analysis of ordered categorical data in which assignation of scores to individual categories may be inappropriate. Source: Statistics review 6: Nonparametric methods Elise Whitley and Jonathan Ball.
19 Disadvantages of nonparametric tests Nonparametric methods may lack power as compared with more traditional approaches. This is a particular concern if the sample size is small or if the assumptions for the corresponding parametric method (e.g. Normality of the data) hold. Nonparametric methods are geared toward hypothesis testing rather than estimation of effects. It is often possible to obtain nonparametric estimates and associated confidence intervals, but this is not generally straightforward. Tied values can be problematic when these are common, and nonparametric methods adjustments to the test statistic may be necessary. Source: Statistics review 6: Nonparametric methods Elise Whitley and Jonathan Ball.