やさしいノンパラメトリック推定

安田正實 (千葉大学）

today

1 Wilcoxon の符号順位検定

WILCOXON SIGNED RANK TEST

Let Y_{1}, Y_{2}, …, Y_{n} be a set of independent and identically distributed random variables having a probability distribution that is continuous and symmetric, with density function f_{Y} (y). Formulate the null and alternative hypotheses Define the sign indecator Z_{i}, i = 1, 2, ⋯, n, as

The Wilcoxon test statistic is calculated as:

If the null hypothesis is true, the mean and variance of the Wilcoxon test statistic are given by :

For n > 12, the z score of W has an approximately standard normal distribution, i.e., Therefore, if n is large, H_{o} will be rejected in favor of H_{1} if

Z_{W} < z_{a/2} or Z_{W} > z_{1−a/2}

http://davidmlane.com/hyperstat/dist_free.html

Overview of Distribution-Free Tests (1 of 2)

Most (*)inferential statistics assume (*)normal distributions. Although these statistical tests work well even if the assumption of normality is violated, extreme deviations from normality can distort the results. Usually the effect of violating the assumption of normality is to decrease the (*)Type I error rate. Although this may sound like a good thing, it often is accompanied by a substantial decrease in (*)power. There is a collection of tests called distribution-free tests that do not make any assumptions about the distribution from which the numbers were sampled. Thus the name, ”distribution-free.” The main advantage of distribution-free tests is that they provide more power than traditional tests when the samples are from highly-(*)skewed distributions. Since alternative means of dealing with skewed distributions such as taking logarithms or square roots of the data are available, distribution-free tests have not achieved a high level of popularity. Distribution-free tests are nonetheless a worthwhile alternative. Moreover, computer analysis has made possible new and promising variations of these tests.

Overview of Distribution-Free Tests (2 of 2)

Distribution-free tests are sometimes referred to as nonparametric tests because, strictly speaking, they do not test hypotheses about population (*)parameters. Nonethless, they do provide a basis for making inferences about populations and are therefore classified as inferential statistics. Some researchers take the position that measurement on at least an (*)interval scale is necessary for techniques such as the analysis of variance that result in inferences about means. These researchers use distribution- free tests as alternatives to the usual parametric tests. As discussed in another section, most researchers do not accept the argument that tests such as the analysis of variance can only be done with interval-level data.

Randomization Tests (1 of 6)

Most distribution-free tests are based on the principle of randomization. The best way to understand the principle of randomization is in terms of a specific example of a randomization test. Assume that four numbers are sampled from each of two populations. The numbers are shown below.

         Group 1    Group 2
           11          2
           14          9
            7          0
            8          5
      Mean 10          4

The first step is to compute the difference between means. For these data, the difference is six. The second step is to compute the number of ways these eight numbers could be divided into two groups of four. The general formula is:

W = N!/(n_{1}!n_{2}!)

where W is the number of ways, N is the total number of numbers (8 in this case), n_{1} is the size of the first group (4 in this case) and n_{2} is the size of the second group (4 in this case). Therefore, W = 8!/(4!4!) = 70.

Randomization Tests (2 of 6)

This means that there are 70 ways in which eight numbers can be divided into two groups of four.

                            Mean
 Group 1  ->  11  14  9  8   10.5
 Group 2  ->   2   7  0  5    3.5
                            Mean
 Group 1  ->  11  14  9  7   10.25
 Group 2  ->   2   8  0  5    3.75

The third step is to determine how many of these W ways of dividing the data result in differences between the means as large or larger than the difference obtained in the actual data. An examination of the data shows that there are only two ways the eight numbers can be divided into two groups of four with a larger difference between means than the difference of six found in the actual arrangement. These two ways are shown on the right side of this page. Thus, including the original data, there are three ways in which the eight numbers can be arranged so that the difference between means is six or more.

Randomization Tests (3 of 6)

To compute the (*)probability value for a (*)one-tailed test of the difference between groups, divide this value of three by the W of ways of dividing the data into two groups of four. The probability value is therefore: p = 3/70 = .0429. For a two-tailed test, the three cases in which Group 2 had a mean that was greater than Group 1 by six or more would be considered. This would make the two-tailed probability: p = 6/70 = .0857. In summary, a randomization test proceeds from the data actually collected. It compares a computed statistic (the difference between means in this example) with the value of that statistic for other arrangements of the data. The probability value is simply the proportion of arrangements leading to a value of the statistic as large or larger than the value obtained from the actual data.

Randomization Tests (4 of 6)

Consider one more example of a randomization test. Suppose a researcher wished to know whether or not there was a relationship between two variables: X and Y. The most common way to test the relationship would be using (*)Pearson’s r.

     X  Y
     4  3
     8  5
     2  1
    10  7
     9  8

The test based on the principle of randomization would proceed as follows. First, Pearson’s correlation would be computed for the data as they stand. The value is: r = .9556. Next, the number of ways the X and Y numbers could be paired is calculated (Note that X’s do not become Y ’s and Y ’s do not become X’s. It is the pairings that change.) The formula for the number of ways that the numbers can be paired is simply: W = N! where N is the number of pairs of numbers. For this example, N = 5 and W = 120. This means there are 120 ways the numbers can be paired. Of these pairings, only one would produce a higher correlation than .9556. It is shown on the next page. Therefore, there are two ways of arranging the data that result in correlations of .9556 or higher.

Randomization Tests (5 of 6)

      X   Y
      4   3
      8   5
      2   1
     10   8
      9   7
    r = .981

This makes the one-tailed probability equal to : p = 2/120 = .017. Naturally, the two-tailed probability is .034. Randomization tests have only one major drawback: they are impractical to compute with moderate to large sample sizes. For example, the number of ways 45 scores can be equally divided among three groups is

 W = 45!/ (15! 15! 15!) = 5.34 * 10^19

which is an astronomical number. Even high-speed computers are incapable of the necessary calculations. Randomization Tests (6 of 6) Fortunately, there is an alternative computational method called ”resampling.” Instead of calculating

all possible ways the data could be arranged, one can take numerous random samples from the set of possible arrangements. For the problem of dividing 45 numbers into three groups of 15 each, one could randomly select 10, 000 of the possible arrangements and determine the proportion of these for which the effect size in the sample is exceeded. This proportion is then an accurate estimate of the probability level. This procedure is currently not in frequent use due, in part, to the general unavailability of programs to do this type of computation.

Rank Randomization Tests (1 of 4)

The major problem with randomization tests is that they are very difficult to compute. Rank randomization tests are performed by first converting the scores to ranks and then computing a randomization test. The primary advantage of rank randomization tests is that there are tables that can be used to determine significance. The disadvantage is that some information is lost when the numbers are converted to ranks. Therefore, rank randomization tests are generally less powerful than randomization tests based on the original numbers. Consider the following data:

    Group 1     Group 2
      11          2
      14          9
       7          0
       8          5

that were used as an example in the section on randomization tests. A rank randomization test on these data begins by converting the numbers to ranks. The converted data are:

    Group 1     Group 2
       7          2
       8          6
       4          1
       5          3

The sum of the ranks of the first group is 24 and the sum of the ranks of the second group is 12. The difference is therefore 12. The problem is to figure out the number of ways that data can be arranged so that the difference between summed ranks is 12 or more. The bottom of this page shows the four arrangements of the eight ranks that lead to a difference of 12 or more. Since there are W = 8!/(4!4!) = 70 ways of arranging the data, the one-tailed probability is: 4/70 = .057.

         8 4
         7 3
         6 2

         5 1
         8 5
         7 3
         6 2
         4 1
         8 6
         7 3
         5 2
         4 1
         8 5
         7 4
         6 2
         3 1

The two-tailed probability is therefore: 8/70 = .114. Notice that this probability value is slightly higher than the .0857 obtained with the randomization test for these same data. This rank randomization test for differences between two groups has several names. It is most often called the Mann-Whitney U test or the Wilcoxon Rank Sum test. In practice, tables are available to look up the probability value based on the sum of the ranks of the group with the lower mean rank. For these data, the sum of the ranks is: 2 + 6 + 1 + 3 = 12. A table would show that for a one-tailed test to be significant at the .05 level, the sum of the ranks must be ≤ 11. Since 12 > 11, the test is not significant at this level. This agrees with the calculated probability value of .057. The purpose of this section is to present the concepts rather than the details of the computations. Therefore, if you wish to actually perform this test, you should find a textbook with appropriate tables.

Rank randomization tests are also available for correlation and for testing differences between more than two groups (analogous to one-way ANOVA). The rank randomization test for correlation is called Spearman’s rho. The rank randomization test for differences among groups is called the Kruskal and Wallis Test. In summary, rank randomization tests are based on the principle of randomization. They are much easier to compute than randomization tests. However, they are less powerful than randomization tests and the more typically performed parameteric tests such as analysis of variance. For this reason, they are not as widely used.

2 符号検定

Sign Test (1 of 2)

Suppose a researcher were interested in whether a drug helped people fall asleep. Subjects took the drug one night and a placebo another night with the order counterbalanced. The number of minutes it took each of 8 subjects to fall asleep is shown below.

       Drug       Placebo
        12          21
         9          16
        11           8
        21          36
        17          28
        22          20
        18          29
        11          22

If the drug has no effect, then the population proportion (π)π of people falling asleep faster in the drug condition is .50. Therefore, the null hypothesis is that π = .50. Of the 8 subjects, 7 fell asleep faster with the drug.

Sign Test (2 of 2) Next chapter: Measuring effect size

Using the formula for the binomial distribution, the probability of obtaining 7 or more ”successes” with N = 8 and π = .50 can be calculated to be .0352 as follows:

P(7) = 8!/7!(8-7)! * 5^7 (1-.5)^(8-7)
     = 8 * .00391 = .03125
P(8) = 8!/8!(8-8)! * 5^8 (1-.5)^(8-8)
     = .00391

Therefore, P (7) + P (8) = .03125 + .00391 = .0352. The one-tailed probability value is therefore .03516; The two-tailed probability value is (2)(.03516) = .0732. Technically speaking, the sign test is a test of whether the median is a particular value. In this example, the test is whether the median difference between conditions is zero. The sign test is generally less powerful than a t test of the difference between dependent means. For the example data, the t test would be: t(7) = −3.21. The two-tailed probability value for this t is 0.015.

Chapter 17

1. Explain the principle of randomization.

2. What is the reason that rank randomization tests rather than pure randomization tests are conducted.

3. Which is more powerful: randomization or rank randomization tests? Why?

4. Conduct a rank randomization test, a randomization test, and a t- test for the data shown below. Make all tests two-tailed.

     Group 1 Group 2
        9      5
        7      2

12     8
16     4
14    10

(answer) 4. Rank randomization test: p = 0.063. Randomization test: p = 0.040 t-test: t(8) = −2.675, p = 0.028.

cf. http://davidmlane.com/hyperstat/index.html