Sei sulla pagina 1di 10

6 - NONPARAMETRIC TESTS FOR COMPARING

TWO POPULATIONS
In situations where the normality of the population(s) is suspect or the sample sizes are so
small that checking normality is not really feasible, it is sometimes preferable to use
nonparametric tests to make inferences about average value.

Wilcoxon Rank Sum Test (a.k.a. Mann-Whitney U Test)


This test is an alternative to the two-sample t-test for comparing the average value of
two populations where the samples from each population are taken independently.
The hypotheses tested can be stated as follows:
H o : The distribution of population 1 and population 2 are identical.
If the populations are symmetric (but not necessarily normal) the null hypothesis
can be expressed in terms of the population medians as:

M1 M 2

H a : The distribution of population 1 and population 2 are different. (two-tailed)

M1 M 2

or
H a : The distribution of population 1 is shifted to the right of the distribution for

population 2, i.e. the population 1 values are generally larger than the population
2 values. (right-tailed)
M1 M 2

or
H a : The distribution of population 1 is shifted to the left of the distribution for

population 2, i.e. the population 1 values are generally smaller than the population
2 values. (left-tailed)
M1 M 2

The tests statistic is based on the sum of the ranks assigned to the observed data from
each population when the combined sample is ranked from smallest to largest. We will
always assume that the sample size (m) for population 1 is less than or equal to the
sample size (n) from population 2.

91

Example: Anticipated Length of Office Visit and Weight Status of Patients


Researchers wanted to compare the anticipated office visit time for patients whose BMI
indicates normal weight vs. those whose BMI indicates the patient is overweight. It is
hypothesized that doctors will report a shorter anticipated office visit time for patients
who are classified as overweight. Stating this hypothesis in terms of medians the
research hypothesis would be that median office visit time for normal weight patients is
greater than that for overweight patients.
Ho : MO M N

vs.

Ha : MO M N

The data below are the anticipated office visit time (min) for these two groups of patients.
Normal:

20

25

30

35

40

45

Overweight:

10

15

15

20

30

50

The sum of the ranked appointment lengths for normal weight patients is: _________.
The sum of the ranked appointment length for overweight patients is: ____________.
The sum of the ranks for the overweight patients is smaller than the rank sum for the
normal weight patients but this would be expected even if the null hypothesis were true.
Why?

The test statistic, WO , is the sum of the ranks for population O, the overweight patients.
We can use the table on the following page to determine whether to reject the null or not.
Intuitively we will reject the null hypothesis if the sum of the ranked appointment lengths
for the overweight patients is small. The table tells what small is for a given
significance level ( ).
For m = 6 and n = 7 we find the following from the table:
From Wilcoxon Rank Sum Table:
1-tail
2-tail

m n
W
d P
6 7 27 57 7 .0175

W
29 55

d
9

P
.0367

92

The table says we will reject the null at the .05 level if:
WO 29 for H a : M O M N
WO > 55 for H a : M O M N
WO < 27 or WO 57 for H a : M O M N
We have evidence to conclude that the anticipated office visit times are generally smaller
than the anticipated office times for patients with BMIs considered normal (p < .05).
WILCOXON RANK SUM TEST IN JMP
Data Table

Select Nonparametric >


Wilcoxon Test

93

Wilcoxon Signed Rank Test


This test is an alternative to the paired t-test which is used when we do not wish to
assume that the population of paired differences is normally distributed. As with the
Mann-Whitney U test, the Wilcoxon Signed-Rank Test use ranks based on the paired
differences rather than the actual values.
Example: Effect of Togetherness on the Heart Rate of Rats
Rat Alone Rate Together Rate di = Ti Ai Sign | di | Rank |di| Signed Rank
1
463
523
60
2
462
494
32
3
462
461
-1
4
456
535
79
5
450
476
26
6
426
454
28
7
418
448
30
8
415
408
-7
9
409
470
61
10
402
437
35
We then calculate W = the sum of the positive signed ranks = _______________
and W = the sum of the negative signed ranks = _______________
Are hypotheses can be stated in terms of the median of the paired differences. Listed
below are the hypotheses along with the test statistic based on the signed rank sums used
to test it.
Intuitively we will conclude there has been a heart rate increase if.

Details of the Wilcoxon Signed Rank Test


94

Let M d median paired difference for the population of paired differences


(two-tailed) Test statistic W min(W , W )
In practical terms the null says there is no change in the rats heart rate after the change in
environment, the alternative says there is a shift up or down in their heart rate.
H o : M d 0 vs. H a : M d 0

(right-tailed) Test statistic W W


In practical terms the alternative says that there is an increase or shift up in their heart
rate as the difference is defined to be Together Alone.
H o : M d 0 vs. H a : M d 0

(left-tailed)
Test statistic W W
In practical terms the alternative says that there is a decrease or shift down in their heart
rate as the difference is defined to be Together Alone.
H o : M d 0 vs. H a : M d 0

For this example, if had originally hypothesized that the heart rate of a rat will increase
when it is placed in a social environment then we have the right-tailed alternative and our
test statistic W = _______.
The Wilcoxon Signed Rank Test Table (handed out) give p-values associated with an
observed test statistic value w for a given sample size, i.e. number of pairs, n.

Here our p-value = ____________, thus we reject the null hypothesis and conclude that
the heart rate of a rat will generally increase when it is taken from a solitary confinement
and placed in a social environment with other rats.

95

WILCOXON SIGNED RANK TEST IN JMP


We first use JMP to form the paired differences as we did for the paired t-test.

Select Distribution > Test Mean > Enter 0 for the hypothesized value and check the
nonparametric test box.

The results of the test are shown below.


The p-values for the upper-tailed t-Test and the Wilcoxon
signed-rank test have been highlighted. The test statistic
reported by JMP for Wilcoxon test =
(W W ) (52 3)

24.5
2
2
Why? I dont know, but we only need the p-value anyway.
Conclusion:
TABLE FOR WILCOXON RANK SUM TEST (Page 1)

96

TABLE FOR WILCOXON RANK SUM TEST (Page 2)


97

TABLE FOR WILCOXON SIGNED RANK TEST (Page 1)

98

TABLE FOR WILCOXON SIGNED RANK TEST (Page 2)

99

100

Potrebbero piacerti anche