Non Paramteric Test 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Wilcoxon Match-Pairs Signed Ranks Test

Dr.E.S.Jeevanand,
Associate Professor
Union Christian College. Aluva
What is Signed Rank Test
The Wilcoxon signed-ranks test is a non-
parametric equivalent of the paired t-test. It is
most commonly used to test for a difference in
the median of paired observations - whether
measurements on pairs of units or before and
after measurements on the same unit. It can
also be used as a one-sample test to test
whether a particular sample came from a
population with a specified median.
Wilcoxon Match-Pairs Signed Ranks Test
In paired sample sign test we have considered only the signs of
the difference of pair of observations. The magnitude of the
paired differences were not taken into account, result in
reduction of the power of the test very much. Wilcoxon Match-
Pairs Signed Ranks Test is also based on the paired differences
but it takes account of magnitudes of the differences also. So it
is much more powerful and accurate than sign test.
Wilcoxon Match-Pairs Signed Ranks Test

• In this case we test the equality of the location parameters of two population
based on paired Samples
• That is, we'll be interested in testing the null hypothesis:
𝐻 :𝑀 = 𝑀

• against any of the possible alternative hypotheses


𝐻 :𝑀 < 𝑀 𝐻 :𝑀 > 𝑀 𝐻 :𝑀 ≠ 𝑀

One-tailed One-tailed Two-tailed


(lower-tail) (upper-tail)
Wilcoxon Match-Pairs Signed Ranks Test
Steps in testing the hypothesis
Let , i =1, 2, …, n be the paired sample.
1. Calculate for i =1, 2, …, n.
2. Rank the differences in order of absolute size with a rank of 1 assigned to the
smallest difference.
Differences of zero are (usually) dropped from the analysis. The rank
assigned to tied ranks is the mean of the ranks that would have been given if
the observations had not been tied.
3. Define W− = the absolute sum of negative ranks.
4. Define W+ = the absolute sum of positive ranks.
5. W = Minimum of (W−, W+)
6. calculate N= number of non zero
Wilcoxon Match-Pairs Signed Ranks Test
Critical Region
For a one tailed test with H1 that the median of population two is greater
than that of population one reject H0 if W+ is less than the tabulated one-
tailed value
For the Alternative Hypothesis 𝑯𝟏 :𝑴𝟏 < 𝑴𝟐 (𝒍𝒐𝒘𝒆𝒓 𝒕𝒂𝒊𝒍)
The rejection rule is: Reject H0 if W+ ≤ 𝑇
For a one tailed test with H1 that the median of population one is greater
than that of population two reject H0 if W− is greater than the tabulated
one-tailed value.
For the Alternative Hypothesis𝑯𝟏 :𝑴𝟏 > 𝑴𝟐 (𝒖𝒑𝒑𝒆𝒓 𝒕𝒂𝒊𝒍)
The rejection rule is: Reject H0 W- < 𝑇
• Where for a given , 𝑇 is obtained from the Wilcoxon table
corresponding to N.
Wilcoxon Match-Pairs Signed Ranks Test
Critical Region
For the Alternative Hypothesis 𝟏: 𝟏 𝟐
The rejection rule is:
• Reject H0 if W < T
• Where for a given , is obtained from the Wilcoxon table
corresponding to N.
• The above test is used when the non zero pairs is small. That
is when N is less than or equalt0 20. A large sample
approximation is used for N> 20.
Example I
To study the effectiveness of a certain diet in increasing the weight of a
person 10 persons of more or less the same age, heritage etc. were selected
and the diet administered. Their weights before and after administering the
diet are given below. Use the sign test to examine whether the diet is
effective
Pearson A B C D E F G H I J
Wt before 91 95 81 83 76 88 89 97 88 92
Wt after 79 101 85 88 81 92 90 99 97 97
In this case we want to test the hypothesis 𝑯𝟎 :𝑴𝟏 = 𝑴𝟐 against 𝑯𝟏 :𝑴𝟏 < 𝑴𝟐
Let y represent the weight before and X represent the weight after
Example I

Person x y d=x-y Rank Signed rank


A 79 91 -12 10 -10
B 101 95 6 8 +8
C 85 81 4 3.5 +3.5
D 88 83 5 6 +6
E 81 76 5 6 +6
F 92 88 4 3.5 +3.5
G 90 89 1 1 +1
H 99 97 2 2 +2
I 97 88 9 9 +9
J 87 92 -5 6 -6
Example I
For the Alternative Hypothesis 𝟏: 𝟏 𝟐

The rejection rule is: Reject H0 if W+


Here W+ = 39 and N =10

From the Wilcoxon for a =0.05, =8


Since we accept H0 and conclude that the diet is not
effective.
Example II

• Is there any difference Group Treatme Treatme Group Treatme Treatme


between the median values
No nt I nt II No nt I nt II

for the sets of treatment 1 2.5 4 7 4.9 6.7


data for the twelve groups
2 3.5 5.6 8 6.6 6
given in the next column?
3 2.9 3.2 9 2 3.5

4 2.1 1.9 10 2 4
• In this case we want to test
the hypothesis 𝟎 : 𝟏 𝟐 5 6.9 9.5 11 5.8 8.1
against 𝟏 : 𝟏 𝟐
6 2.4 2.3 12 7.5 19.9
Example II
Group No x y d=x-y Rank Signed rank
1 2.5 4 -1.5 5.5 -5.5
2 3.5 5.6 -2.1 9 -9
3 2.9 3.2 -0.3 3 -3
4 2.1 1.9 0.2 2 +2
5 6.9 9.5 -2.6 11 -11
6 2.4 2.3 0.1 1 +1
7 4.9 6.7 -1.8 7 -7
8 6.6 6 0.6 4 +4
9 2 3.5 -1.5 5.5 -5.5
10 2 4 -2 8 -8
11 5.8 8.1 -2.3 10 -10
12 7.5 19.9 -12.4 12 -12
Example II
For the Alternative Hypothesis 𝟏: 𝟏 𝟐
The rejection rule is:
• Reject H0 if W < T
Here W+ = 7, and W- =71

So W =min(W+,W-) = 7
From the Wilcoxon Table for N=12 and =0.05, = 17
Since we reject H0 and conclude that the median value of the two
treatment differs.
Normal Approximation with Wilcoxon
Match-Pairs Signed Ranks Test
If the number of observations N is greater than 20, we can use
a normal approximation. In this case W follows normal
distribution or Z distribution with
• The mean, μ = N(N+1)/4.

( )( )
• And the standard deviation σ =

• If you have tied ranks, you must reduce σ by C=


where mi is the number of times the ith tied rank repeats.
That is new standard deviation is
( )( )
Normal Approximation with Wilcoxon
Match-Pairs Signed Ranks Test
In this case the test statistic is

Which has standard normal distribution. If tied rank appears


then
Normal Approximation with Wilcoxon Match-
Pairs Signed Ranks Test Critical Region

 The rejection rule is:


• Lower tail: Reject H0 if Actual z < Critical -z
• Upper tail: Reject H0 if Actual z > Critical z
• Two tail: Reject H0 if Actual z > Critical z/2
• Where z and z/2 are obtained from the standard Normal
Table
Example III
• Traffic conjunction on roads and highways costs industry loss
of billions of dollars annually as workers to get to and from
work. In order to over coms this company decided to
introduce flextime, which involve workers to determine their
own schedules (provided they work a full shift). A 32
workers are selected for testing the effectiveness of the new
pattern. Their travel time for normal shift of 8 A.M is
recorded on a Wednesday and on the next Wednesday they
are allowed to opt the flexi time and the travel time is
recorded. These results are listed in the following table. Use
Wilcoxon Match-Pairs Signed Ranks Test to test whether the
travel time under the flextime program are different from
times to arrive at work at 8 A.M.?
Example III
Worker Arrival 8AM flexitime d=x-y Rank Signed rank
1 34 31 3 21 21
2 35 31 4 27 27
3 43 44 -1 4.5 -4.5
4 46 44 2 13 13
5 16 15 1 4.5 4.5
6 26 28 -2 13 -13
7 68 63 5 31 31
8 38 39 -1 4.5 -4.5
9 61 63 -2 13 -13
10 52 54 -2 13 -13
11 68 65 3 21 21
12 13 12 1 4.5 4.5
Example III
Worker Arrival 8AM flexitime d=x-y Rank Signed rank
13 69 71 -2 13 -13
14 18 13 5 31 31
15 53 55 -2 13 -13
16 18 19 -1 4.5 -4.5
17 41 38 3 21 21
18 25 23 2 13 13
19 17 14 3 21 21
20 26 21 5 31 31
21 44 40 4 27 27
22 30 33 -3 21 -21
23 19 18 1 4.5 4.5
24 48 51 -3 21 -21
Example III
Worker Arrival 8AM flexitime d=x-y Rank Signed rank
25 29 33 -4 27 -27
26 24 21 3 21 21
27 51 50 1 4.5 4.5
28 40 38 2 13 13
29 26 22 4 27 27
30 20 19 1 4.5 4.5
31 19 21 -2 13 -13
32 42 38 4 27 27
d value 1 2 3 4 5
No of times
value repeats 8 9 7 5 3
mi

𝑚 −𝑚 504 720 336 120 24


Example III
• In this case we want to test the hypothesis 𝟎: 𝟏 𝟐
against 𝟏 : 𝟏 𝟐

• N = 32, W+= 367.5, W- = 160.5 W =min(W+,W-) = 160.5


( ) ×
• μ= = = 264 C= = = 35.5

( )( ) × ×
• σ= = = 53.146

( )
.
• = = -1.947
( )( ) .

• Since 𝜶 we accept H0 and conclude that the travel time under the
flextime program and times to arrive at work at 8 A.M are same.
The End
In the next section we will discuss about the Goodness of fit
test
esjmaths@gmail.com
9847915101, 8089684892

You might also like