0% found this document useful (0 votes)
17 views10 pages

Sign and Wilcoxon Signed Rank Test

Uploaded by

Dralaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views10 pages

Sign and Wilcoxon Signed Rank Test

Uploaded by

Dralaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Nonparametric Statistics

1 Nonparametric Tests
Hypothesis-testing procedures can be based on the assumption that the
random samples are selected from normal populations. Fortunately, most
of these tests are still reliable when we
experience slight departures
from normality, particularly when the sample size is large. Traditionally,
these testing procedures have been referred to as paramnetric methods. In this
chapter, we consider a number of alternative test procedures, called nonparamet
ric or distribution-free methods, that often assume no
knowledge
about the distributions of the underlying populations, except perhapswhatsoever
that they
are continuous.
Nonparametric. or distribution-free procedures, are used with increasing fre
quency by data analysts. There are many applications in science and engineering
where the data are reported as values not on a continuum but rather on an ordinal
scale such that it is quite natural to assign ranks to the data. In fact, the reader
may notice quite early in this chapter that the distribution-free methods described
here involve an analysis of ranks. Most analysts find the computations involved in
nonparametric mnethods to be very appealing and intuitive.
For an example where a nonparametric test is applicable, consider the situation
in which two judges rank five brands of premium beer by assigning a rank of l to
the brand believed to have the best overall quality, a rank of 2 to the second best,
and so forth. Anonparametric test could then be used to deternmine whether there
is any agreement between the two jdges.
We should also point out that there are a number of disadvantages associ
ated with nonparametric tests. Primarily, they do not utilize all the information
provided by the sample, and thus a nonparametric test will be less efficient than
the corresponding parametric procedure when both methods are applicable. Con
sequently, to achieve the same power, a nonparametric test will require a larger
sample size than will the corresponding parametric test.
As we indicated earlier, slight departures from nornality result in minor devi
ations from the ideal for the standard parametric tests. This is particularly true
for the ttest and the Ftest. In the case of the ttest and the test, the Pvalhhe

From
Chapt
AlHyerrights er 16 f Probability &Statistics for Engineers &Scientists, Ninth Edition, Ronald E. Walpole, Raymond H.
s. ,Sharreserved
of
on L. Myers, Keying Ye, Copyright 2012 by Pearson Education, Inc. Published by Pearson Prentice Hall.
729
Nonparametric Stutistics

quoted may be lightly in error if there is a moderate violation of the nonnality

ISNption.
if n paranctric andl a nonparametric test are both applicable
Iu summary,
the san)e sot of data, we shouldl carry out the Imore efficient parametric technique.to
However, we should recognize that the assumptions of normality often cannot he
justified and that we do ot always have qlantitative measurements. It is fortu-
oI Iseful nonparandt
ute thnt, statisticians have provided us with a nUmber
techniques, the data analvst ho
procedures, Armed with nonparametric eb
wider variety of experinental situationg t
unition to acComodate a
normal theory assumptions th t
be pointed out tlhnt even under the standard remarkably close to those of
ficiencies of the Ionparanetric techniques are
hand, serious departuroe f
corresponding parametric procedure, On the other
mnore efficient than the
normality will render the nonparametric method much
parametric procedure.

Sign Test
The procedures for testing the null hypothesis where = is valid only if the pop
ulation is approximately normal or if the sarnple is large. If n<30 and the population
is decidedly nonnormal, we must resort to a nonparametric test.
Thesign test is used to test hypotheses on a population median. In the case of
marny of the nonparametric procedures, the mean is replaced by the median as the
pertinent location parameter under test. The population counterpart, denoled
by , has an analogous definition. Given a random variable X, is defined such that
P(X > i) s0.5 and P(X <ü) s0.5. In the continuous case,

P(X >) = P(X < i) = 0.5.


Of course, if the listribution is symmetric, the population mean and median are
equal. In testing the null hypothesis Ho that = against an appropriate
alternative, on the basis of a random sample of size n, we replace each sampe
value
Tninusexceeding /o null
sign. If the with hypothesis
a plus signisand
trueeach
and sample value lessis than
the population o wit thea
symmetric,
sum of the plus signs should be approximately equal to the sum of the minus signs.
When 0ne sign appears more frequently than it should based on chance alone, we
reject the bypothesis that the population median is equal to 0
Iu theory, the sign test is applicable only in situations where io cannot equal
the value of any of the observations. Although there is a zero probability of obtain-
iug a sample observ.ation exactly cqual to jo when the population is ContinuoUs,
lackof
nevertheless, in practice a sauple value equal
precision in recording the data. When sample to io equal
values will often OCCur from a
to lo are observed, they
are cxcluded fron the analysis and the sample size is correspondingly reduced.
The appropriate test statistic for the sigu test is the biIonial randomvariable
X, representing the number of plus mull hy
Ifthe either
pothesis sigus in our random sample. iu
n plus orthat ji sign
a mimus jlo isistrue,
cqualtheprobability
to 1/2. Therefore, null results
a test thevalue
that tosanple hypothesisthat

730
Nonparamctric Statistics
u= o. we actually test the nullhypothesis that the number of plussigns is a valte
of arandom variable having the binomial distribution with the parameter P
P-values tor both one-sided and two-sided alternatives can then be caleulated using
this binomial distribution. For example, in testing
Ho: = io:
HË: /< io:
we shall reject HÍ in favor of H, only if the proportion of plus signs is sufficiently
less than 1/2, that is, when the value z of our random variable is small. Hence, if
the computed Pvalue
P= P(X< when p =1/2)

is less than or equal to some preselected significance level a, we reject H, in favor of


H,. For example, when n = 15 and z = 3, we find from Table Binomial Probability
Surns at the end of this chapter that
3

P= P(X<3 when p=1/2) =:15,;) = 0.0176,


I=0

so the null hypothesisi = jo can certainly be rejected at the 0.05 level of signifi
cance but not at the 0.01 level.
To test the hypothesis
HÍ: =o,
H: /> Éo:
we reject Ho in favor of HË only if the proportion of plus signs is sufficiently greater
than 1/2, that is, when z is large. Hence, if the cormputed P-value
P=PX > when p = 1/2)

is less than a, we reject Ho in favor of H1. Finally, to test the hypothesis


HÍ: î=o:
HË: o,
we reject Ho in favor of HË when the proportion of plus signs is significantly less
r being sufficiently snall
thanor greater than 1/2. This, of course, is equivalent to
and the computed Pvalue
or sufficiently large. Therefore, if z < n/2
P=2P(X <r when p = 1/2)

> n/2 and the computed P-value


is less than or equal to a, or if z
P= 2P(X> when p = 1/2)

less than or equal to a, we reject HÍ in favor of H,.


is

731
Nonparmetric Statistics
Whenever n >
10, binomial
from the nornmal curve,
test the hypothesis since np probabilities
= q > 5. with p =
1/2 can be
Suppose, for
Ho: =o
HË: /< o,
example. tlhat,
ap roX0Tnals
we wisl, tr,
at the a= 0.05
level of
T =6 plus
signs. Using significance, for a
the normal curve random sample of
approximation withsize n = 20 that yielkds
/= np=(20)(0.5) = 10
and

g= /npg = V(20) (0.5) (0.5) =


we find that 2.236.
6.5 - 10
2.236 =-1.57.
Therefore,
P= P(X< 6) P(Z < -1.57) =0.0582,
which leads to the nonrejection of the null hypothesis.
Example 1: The following data represent the
mer operates before a recharge is number of hours that a rechargeable hedge trim
required:
1.5, 2.2,0.9, 1.3, 2.0, 1.6, 1.8, 1.5, 2.0, 1.2, 1.7.
Use the sign test to test the hypothesis, at
the 0.05 level of significance, that this
particular trimmer operates a median of 1.8 hours before requiring a recharge.
Solution: 1. Ho: ç=1.8.
2. H: u#1.8.
3. a = 0.05.
4. Test statistic: Binomial variable X with p =;.
5. Computations: Replacing each value by the symbol 4" if it exceeds 1.8 and
by the symbol _" if it is less than 1.8 and discarding the one measuremet
that equals 1.8, we obtain the sequence

Probability
Binomial
for which n = 10, x = 3, and /2 = 5. Therefore, from Table
Sums the computed P-value is
=0.3438 > 0.05.
P=P(Xs3 when p ) =(z:10.;) T=0

732
Nonparanetric Statistics
6. Decision: Do not reject the null hypothesis and conciude
that the median
operating time is not significantly different from 1.8 hours.
We can also use the sign test to test the null hypothesis 1 - n =
do tor
paired observations. Here we replace each difference, dË, with a plus or minus
sign depending on whether the adjusted difference, dË - do, is positive or
negative.
Throughout this section, we have assumed that the populations are synnetric.
However, even if populations are skewed, we can carry out the sarne test procedure,
but the hypotheses refer to the population medians rather than the means.

Example 2: A taxi company is trying to decide whether the use of radial tires instead of regular
belted tires improves fuel economy. Sixteen cars are equipped with radial tires and
driven over a prescribed test course. Without changing drivers. the same cars are
then equipped with the regular belted tires and driven once again over the test
course. The gasoline consumption, in kilometers per liter, is given in Table 1.
Can we conclude at the 0.05 level of significance that cars equipped with radial
tires obtain better fuel economy than those equipped with regular belted tires?

Table 1: Data for Example 2


Car 2 4 5 6 7
Radial Tires 4.2 4.7 6.6 7.0 6.7 4.5 3.7 6.0
Belted Tires 4.1 4.9 6.2 6.9 6.8 4.4 5.7 5.8
Car 9 10 11 12 13 14 15 16
Radial Tires 7.4 4.9 6.1 5.2 5.7 6.9 6.8 4.9
Belted Tires 6.9 4.9 6.0 4.9 5.3 6.5 7.1 4.8

Solution: Let Ly and represent the median kilometers per liter for cars equipped with
radial and belted tires, respectively.
1. Ho: Ë- 2 =0.
2. HË: - 2 >0.
3. a 0.05.
4. Test statistic: Binomial variable X with p = 1/2.
5.Computations: After replacing each positive difference bya *+" syntol and
each negative difference by a "-" symbol and then discarding the two zero
differences, we obtain the sequence
+

for which n = l4 and z= 11. Using the normal curve approximation, we fnd
10.5 - 7
= 1.87,
V(14)(0.5)(0.5)
and then

P= PX > 11) P(2> 1.87) = 0.0307.

733
Nonparametric Statistics

6. Decision: Reject Ho and conclude that, on the average, radial tires do


fuel economy. improve
Not only is the sign test one of the simplest nonparametric procedures
ply: it has the additional advantage of being applicable to dichotomous dot to ap-
cannot be recorded on a numerical scale but can be represented by nositiat that
negative responses. For example, the sign test 1s applicable in experiments w
a qualitative response such as hit" or "miss" is recorded, and in sensory-tyne
periments where a plus or minus sign is recorded depending on whether the taste
ingredient.
tester correctly or incorrectly identifies the desired
We shall attempt to make comparisons between many of the nonparametrie
procedures and the corresponding parametric tests. In the case of the sign test the
competition is, of course, the t-test. If we are sampling from a normal distribution.
the use of the trtest will result in a larger power for the test. If the distriby
tion is merely symmetric, though not normal, the ttest is preferred in terms of
power unless the distribution has extremely "heavy tails" compared to the normal
distribution.

2 Signed-Rank Test
The reader should note that the sign test utilizes only the plus and minus signs
of the differences between the observations and o in the one-samnple case, or the
plus and minus signs of the differences between the pairs of observations in the
paired-sample case; it does not take intoconsideration the magnitudes of these
differences. A test utilizing both direction and magnitude, proposed in 1945 by
Frank Wilcoxon, is now commonly referred to as the Wilcoxon signed-rank test.
The analyst can extract more information from the data in a nonparametric
fashion if it is reasonable to invoke an additional restriction on the distribution
from which the data were taken. The Wilcoxon signed-rank test applies in the case
of a symmetric continuous distribution. Under this condition, we can test the
null hypothesis = io. We first subtract io from each sample value, discarding all
differences equal to zero. The remaining differences are then ranked without regard
to sign. A rank of 1 is assigned to the smallest absolute difference (i.e., without
sign), a rank of2 to the next smallest, and so on, When the absolute value of two
or more differences is the same, assign to each the average of the ranks that would
have been assigned if the differences were distinguishable. For example,ifthe fifth
and sixth smallest differences are equal in absolute value, each is assigned a rank
of 5.5. If the hypothesis = o is true, the total of the ranks corresponding tototheu
positive differences should nearly egual the total of the ranks corresponding We
negative differences. Let us represent these totals by w+ and w-, respectively.
designate the smaller of w4 and w_ by w.
In selecting repeated samples, we would expect W+ and w_, and therefore w
corresponding
to vary. Thus, we may think of w+, w-, and w as values of the rejected
random variables W+, W-, and WW. The null hypothesis = Mo can be Likewise.
in favor of the alternative i < ço only if w is small
and w- is large. For
the alternative > io can be accepted only if w+ is large and w is small. and
W-,
a two-sided alternative, we may reject Ho in favVor of H1 if either W4 orhypothesis
hence w, is sufficiently small. Therefore, no matter what the alternative

734
Nonparanetric Statistics

may be, we reject the null hypothesis when the value of the appropriate stat ist ic
W.. W,or W is sufficiently smalJ.

Two Samples with Paired Observations


To test the null hypothesis that we are sanpling two continuons synmetric pop
ulations with o1 = i2 for the paired-sanple case, we rank the differenIces of the
paired observations without regard to sign and proceed as in the single-sarople
case. Thevarious test procedures for both the single- and paired-sarnple caes are
summarized in Table 2.

Table 2: Signed-Rank Test


HÍ H Compute

W
i1 = 2

It is not difficult to show that whenever n <5 and the level of significance does
not exceed 0.05 for a one-tailed test or 0.10 for a tw0-tailed test, all possible values
of w+, w-,or w will lead to the acceptance of the null hypothesis. However, whern
5sns30, Table Critical Values for the Signed-RankTest shows approxirnate crit
ical values of W, and W_for levels of significance equal to 0.01, 0.025, and 0.05 for
a one-tailed test and critical values of Wfor levels of significance equal to 0.02, 0.05,
and 0.10 for a two-tailed test. The null hypothesis is rejected if the computed value
w.,w_, or wis less than or equal to the appropriate tabled value. For exarnple,
when n = 12,Table Critical Values for the Signed-Rank Test at the end of this chap
ter shows that a value of w+ s 17 is required for the one-sided alternative ñ<Ë,
to be significant at the 0.05 level.

Example 3: Rework Example 1 by using the signed-rank test.


Solution: 1. HÍ: i= 1.8.
2. H): o# 1.8.
3. a= 0.05.
4. Critical region: Since n= 10 after discarding the one measurerment that equals 1.8
Table Critical Values for the Signed-Rar1k Test shows the critical region to be
ws8.
5. Computations: Subtracting 1.8 from each measuremnent and then ranking the
differences without regard to sign, we have
--0.3 0.4 -0.9 -0.5 0.2 -0.2 -0.3 0.2 -0.6 -0.1
d,
Ranks 5.5 7 10 3 3 5.5 3
.
Now w. 13 and w 42, sO w =1l3, the sImaller of u. ald

735
Nonparametric Statistics

reject HÍand conclude that the median


6. Decision: As before, do not
different from 1.8 hours.

that operating
time is not significantly
used to test the null hypothesis
The signed-rank test can also be symmetric. As
do. In this case, the populations need not beadjusted with /1 - n
rank the the sign test,
subtract do from each difference,
above. differences
without
sign, and apply the same procedure as to regard
Example 4: |It is claimed that a college senior can increase his or her SCore in
area of the graduate record examination by at least 50 points if 1he or
the major feld
with sample problems in advance. To test this claim, 20 she is
into 10 pairs such that the students in each matched pair have seniors arecollege providividdeded
the same
Samplealmostproblems
overall grade-point averages for their first 3 years in college.
answers are provided at random to one member of each pair 1 and
week prior to the
examination. The examination scores are given in Table 3.

Table 3: Data for Example 4


Pair
1 2 3 4 5
7
With Sample Problems 531 621 663 579 451 10
Without Sample Problems 660 591 719 543 575
509 540 688 502 424 683 568
748 530 524
Test the null hypothesis, at the 0.05
increase scores by 50 points against the level of significance, that sample problems
less than 50 points. alternative hypothesis that the increase is
Solution: Let ij and i2 represent the median
with and without sample scores of all students taking the test in
problems, respectively. question
1. Ho: Ë - 2 = 50.
2. H;: i - 2
<50.
3. a= 0.05.
4. Critical
W S11,
region: Since n = 10, Table A.16 shows the
5. Computations: critical region to be

Pair
3 4
22 5 7 8 9 10
dË - do 81 -25
-28 31 77 27 -23 13 51
-75 23 -29
Ranks 5 6 27 -23 -73 -27 -79 -37 1
9 3.5 2
Now we find that 8 3.5 10 7 1
6. w4 =
Decision: Reject Ho and
6+3.5 +1=10.5.
increase one's conclude
graduate record that sample
score by as much
problems do not,
as 50 points.
on average.

736
Nonparametric Statistics
Normal Approximation for Large Samples
the normal
When n> 15, the sampling distribution of W (or W-) approaches
distribution with mean and variance given by
n(n + 1) n(n+ 1)(2n + 1)
4
and o. = 24

Therefore, when n exceeds the largest value in Table A.16, the statistic
Z= W+- W

can be used to determine the critical region for the test.

Exercises
Drying Time (hours)
1
The following data represent the time, in min Regular Additive
Panel New Additive
utes, that a patient has to wait during 12 visits to a 6.6
dortor's office before being seen by the doctor: 1 6.4
20 20 32 28 2 5.8 5.8
17 15
12 26 25 25 35 24 7.4 7.8
5.5 5.7
Ue the sign test at the O.05 level of significance to test 4
6.0
6.3
the doctor's claim that the median waiting time for her 5
8.4
patients is not more than 20 minutes. 6 7.8
7 8.6 8.8
8.2 8.4
2 The following data represent the number of 7.0 7.3
bours of fight training received by 18 student pilots
flight: 10 4.9 5.8
rom a certain instructor prior to their first solo
16 11 5.9 5.8
9 12 18 14 12 14 12 10
14 12 6.5 6.5
11 13 11 13 15 13
U'sing binomial probabilities from Table A.1, pertorm Use the sign test at the 0.05 level to test the null hy
e siga test at the 0.02 level of significance to test the pothesis that the new additive is no better than the
instructor's claim that the median time required before regular additive in reducing the drying time of this
zis students solo is 12 hours of flight training. kind of paint.
of a certain It is claimed that a new diet will reduce per
3 A food inspector examined 16 jars son's weight by 4.5 kilograms, on average, in a period
brand of jam to determine the percent of foreign im
Purities. The following data were recorded: of 2 weeks. The weights of 10 women were recorded
2.4 2.3 3.1 2.2 2.3 1.2 1.0 2.4 before and after a 2-week period during which they
1.7 3.6 1.6 2.3 followed this diet, yielding the following data:
1.1 4.2 1.9
StAg the normai approximation to0.05 the binomial dis Woman Weight Before Weight After
tibution, perform a sign test at the level of signif 1 58.5 60.0
*ADce to test the nul! hypothesis that the median per 2 60.3 54.9
is 2.5% against
et of iapurities in this brand of jam impurities
3 61.7 58.1
t aternative that the median percent of 69.0 62.1
64.0 58.5
6 62.6 59.9
new additive will
A paint supplier ciaims that a paint. To test this 7 56.7 54.4
reduoe the drying time of its painted, one-half of each
acrylic 63.6 60.2
laira, 12 panels of wood were regular additive and 68.2 62.3
th paint containing the new additive.
10 59.4 58.7
other half with paint containing the Use the sign test at the 0.05 level of significance to
as follows:
times, in hours. were recorded test the hypothesis that the diet reduces the median

737
Nonparamnetric Statistics

weight bN 4.5 kilograms against the alternative hypoth- 8 Analyze the data of Exercise 1by using the
esis that the median weight loss is less than 4.5 kilo- sigued-rank test.
grams.
9 Analyze the data of Exercise 2 by using the
T'wo types of inst ruments for measuring the signed-rank test.
amount of sulfur monoxide in the atmosphere are be
ing compared in an air-pollution experiment.. The fol- 10 The weights of 5 people before they stopped
lowing readings were recorded daily for a period of 2 smoking and 5 weeks after they stopped smoking, in
wrrks:
Sulfur Monoxide
kilograms, are as follows:
Individual
Day Instrument A Instrument B 1 2 5
1 0.96 0.87
2 0.82
Before 66
B 80 69 52 75
0.74 After 71 82 68 56 73
3 0.75 0.63
0.61 0.55
Use the signed-rank test for paired observations to test
5 0.89 0.76
the hypothesis, at the 0.05 level of significance, that
0.64 0.70 giving up smoking has no effect on a person's weight
7 0.81 0.69
against the alternative that one's weight increases if he
0.68 0.57 or she quits smoking.
0.65 0.53
10 0.84 0.88
11 Rework Exercise 5 by using the signed-rank
11 0.59 test.
0.51
12 0.94 0.79 12 The following are the numbers of prescriptions
13 0.91 0.84
14 0.77 0.63
flled by two pharmacies over a 20-day period:
Using the normal approximation to the binomial distri Day Pharmacy A Pharmacy B
1 19 17
bution, perform a sign test to determnine whether the
different instruments lead to different results. Use a 21 15
3 15 12
0.05 level of significance.
4 17 12
24 16
The following figures give the systolic blood 6 12 15
pressure of 16 joggers before and after an 8-kilometer 7 19
run: 1
Jogger Before After 8 14 13
9 20 14
158 164
10 18 21
149 158 11 23 19
3 160 163
12 21 15
4 155 160 13 17
5 164 172 11
14 12 10
6 138 147 15 16 20
7 163 167
16 15 12
159 169
17 20 13
165 173
18 18 17
10 145 147
19 14 16
150 156
20 22 18
12 161 164
13 132 133 Use the signed-rank test at the 0.01 level of significance
14 155 161 to determine whether the two pharmacies, on average.
15 146 154 hll the sane number of prescriptions against the alter
159 170 native that pharmacy A fills more prescriptions tha
Use the sign test at the 0.05 level of significance to test
pharmacy B.
the nul! hypothesis that jogging 8 kilometers increases 13 Rework Exercise 7 by using the signed-ralik
the uedian systolic blood pressure by 8 points against test
the alteDative that the increase in the medial is less
14 Rework Exercise 6 by using the signed-rank
test

738

You might also like