# Worksheet24a

```Worksheet 24a - ph6450
Understanding Wilcoxon Sign-Rank Test
[example from: Rosner, Fundamentals of Biostatistics, page 351]
An instrument that is in fairly common use in blood-pressure epidemiology is the random-zero
device, whereby the zero point of the instrument is randomly set with each use and the observer
is not aware of the actual level of blood pressure at the time of measurement. This instrument is
intended to reduce observer bias. Before using such an instrument, it is important to check that
the readings are, on average, comparable to those of a standard cuff. Two measurements were
made on 20 children with each of the standard cuff and the random-zero instrument. Researchers
are reluctant to assume that the distribution of the blood pressure in this group is normal.
Person
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Mean SBP –
Cuff
79
112
103
104
94
106
103
97
88
113
98
103
105
117
94
88
101
98
91
105
Mean SBP –
Random Zero
84
99
92
103
94
106
97
108
77
94
97
103
107
120
94
87
97
93
87
104
Difference
5
-13
-11
-1
0
0
-6
11
-11
-19
-1
0
2
3
0
-1
-4
-5
-4
-1
Rank
Sign
Conduct a non-parametric test to see if the two measurement instruments are comparable.
A. What are the null and alternative hypotheses for this test?
B. What is the value of the test statistic?
C. What is the expected value under the null?
D. What is the standard error of the test statistic under the null?
E. What is the p-value for this test?
F. Draw a conclusion in the scientific context of this problem.
&gt; cuff =
c(79,112,103,104,94,106,103,97,88,113,98,103,105,117,94,88,101,98,91,105)
&gt; rz =
c(84,99,92,103,94,106,97,108,77,94,97,103,107,120,94,87,97,93,87,104)
&gt; wilcox.test(cuff,rz,paired=TRUE)
Wilcoxon signed rank test with continuity correction
data: cuff and rz
V = 102.5, p-value = 0.07793
alternative hypothesis: true location shift is not equal to 0
Warning messages:
1: In wilcox.test.default(cuff, rz,
cannot compute exact p-value with
2: In wilcox.test.default(cuff, rz,
cannot compute exact p-value with
paired = TRUE) :
ties
paired = TRUE) :
zeroes
&gt; wilcox.test(cuff,rz,paired=TRUE,correct=FALSE)
Wilcoxon signed rank test
data: cuff and rz
V = 102.5, p-value = 0.07366
alternative hypothesis: true location shift is not equal to 0
Warning messages:
1: In wilcox.test.default(cuff, rz,
cannot compute exact p-value with
2: In wilcox.test.default(cuff, rz,
cannot compute exact p-value with
paired = TRUE, correct = FALSE) :
ties
paired = TRUE, correct = FALSE) :
zeroes
data bp;
input obs cuff rz;
datalines;
1
79
84
2
112
99
3
103
92
4
104
103
5
94
94
6
106
106
7
103
97
8
97
108
9
88
77
10
113
94
11
98
97
12
103
103
13
105
107
14
117
120
15
94
94
16
88
87
17
101
97
18
98
93
19
91
87
20
105
104
;
data bp;
set bp;
x = cuff - rz;
run;
proc univariate data=bp;
var x;
run;
Relevant output:
Tests for Location: Mu0=0
Test
-Statistic-
-----p Value------
Student's t
Sign
Signed Rank
t
M
S
Pr &gt; |t|
Pr &gt;= |M|
Pr &gt;= |S|
1.84923
4
34.5
0.0800
0.0768
0.0756
Notice the p-value is not very different from the student’s T. This is because there are 20 data
points and the normality assumption is not greatly violated. Still, the nonparametric test is more
conservative because no specific underlying distribution is assumed.
```