192
NONPARAMETRIC
METHODS
9.1 We use the sign test. We have
C
n 15, = 15 + 8 = 23. We use the normal theory test. The rejection
region is given by
C
c!2 or
C
c1, where
9.3 First rank the data by absolute value of the change score
di

as follows:
Periodontal change scores ranked by absolute value
diNegative
di
Frequency Positive
di
Frequency Total
frequency
Range of
ranks
Average
rank
332 3 4 6 1823 20.5
CHAPTER 9/NONPARAMETRIC METHODS 193
32.388 1.436 ~ N0, 1
The p-value is obtained from
9.4 Since the smallest sample size < 10, we must use exact critical values for the rank sum test, which are
9.6 The normal theory test can be used, since min
n
1
,n
2

12 t10.
The test statistic is given by
9.7 The distribution of length of stay in a hospital is notoriously very skewed and far from being normal.
9.8 The Wilcoxon rank sum test can instead be used to test if the median length of stay is significantly
different between the two hospitals. First rank the length of stay in the combined sample, as follows:
194 CHAPTER 9/NONPARAMETRIC METHODS
Data layout for length-of stay data for Wilcoxon rank sum test
Value
Frequency,
hospital 1
Frequency,
hospital 2
Total
frequency
Rank
range
Average
rank
5 1 0 1 1 1.0
8 1 0 1 2 2.0
Next compute the rank sum for hospital 1 as follows:
1
Thus, compute the test statistic
The twosided p-value is given by
9.9 The Wilcoxon rank sum test.
9.10 Referring to Table 2.11, we construct a stem-and-leaf plot of the white blood counts in the two subgroups
of patients. We have
CHAPTER 9/NONPARAMETRIC METHODS 195
Medical Surgical
0 4 0 43
We now rank the observations in the combined sample.
Value Medical Surgical Total
Range of
ranks
Average
rank
3 0 1 1 1 1.0
4 1 1 2 2-3 2.5
9.12 Using STATA, we get the following result:
drg_ord | obs rank sum expected
————-+———————————
1 | 44 2335.5 1958
196 CHAPTER 9/NONPARAMETRIC METHODS
Difference in duration of effusion between
breast-fed and bottle-fed babies
idiidi
1 213 13
2 24 14 1
Now separate the positive and negative differences and order the differences by absolute value.
Data layout for duration of effusion for Wilcoxon signed rank test
diNegative
di
f
iPositive
di
f
i
Number of
persons with same
absolute value
Range o
f
ranks
Average
rank
169 169 1 169 0 1 23 23.0
CHAPTER 9/NONPARAMETRIC METHODS 197
1325 160 1230 215
The expected value and variance of the rank sum are given as follows:
The test statistic is then obtained from
9.18 We have the test statistic
Value
Positive
di
Negative
diTotal Rank
8.89 1 0 1 16
7.77 1 0 1 15
7.05 1 0 1 14
198 CHAPTER 9/NONPARAMETRIC METHODS
9.21 A significant reduction in blood pressure after adopting the diet was found using both the paired t test in
9.23 We subtract the random zero readings from the standard cuff readings and order the differences by
absolute value as follows
di
Neg
di
f
i
Pos
di
f
iTotal
Rank
range
Average
rank
19 19 0 19 1 1 16 16.0
13 13 0 13 1 1 15 15.0
11 11 1 11 2 3 12-14 13.0
CHAPTER 9/NONPARAMETRIC METHODS 199
9.25 We subtract a
r
from a
s
for each person and order the absolute differences as follows
di
Neg
di
f
i
Pos
di
f
iTotal
Rank
range
Average
rank
12 12 1 12 0 1 16 16.0
10 10 1 10 0 1 15 15.0
9.26 Using the rank sum test in STATA we find no significant differences between males and females with
respect to days abstinent from smoking.
Two-sample Wilcoxon rank-sum (Mann-Whitney) test
gender | obs rank sum expected
————-+———————————
1 | 110 13271 12925
9.27 After calculating the median age to be 41, we create our new variable “lowAge” and then perform
the rank sum test. We find no significant relationship between age and days abstinent using this method.
200 CHAPTER 9/NONPARAMETRIC METHODS
9.28 Using the same procedure as in 9.29, we find no significant relationship between cigarettes/day smoked
and number of days abstinent from smoking.
. gen highSmoke = 0
9.29 Again using the same procedure as in 9.29, this time we do find a significant difference (p=0.038)
between the number of days abstinent from smoking among those with low “logcoadj” values compared
to those with high “logcoadj” values. Those with higher carbon monoxide values generally were
abstinent for fewer days.
CHAPTER 9/NONPARAMETRIC METHODS 201
9.30 The number of days since a person has stopped smoking is not likely to follow a normal distribution, and
9.31 Since each person is used as their own control, we use the Wilcoxon signed rank test to determine
significance. For this purpose, we rank the difference scores by absolute value as follows
di
Neg
di
f
i
Pos
di
f
iTotal
Rank
range
Average
rank
15.5 -15.5 0 15.5 1 1 10 10
We can also obtain the same results using the following R code:
9.32 For this question, we use the same procedure as in 8.82 to create our twenty variables. This time, we
perform a signed rank test on each variable, rather than a paired t-test. Significant p-values are in bold
202 CHAPTER 9/NONPARAMETRIC METHODS
Test of median = 0.000000 versus median not = 0.000000
N for Wilcoxon Estimated
N Test Statistic P Median
Dbilsec_1 30 25 146.0 0.667 -0.5000
9.33 As in Chapter 8, we need to perform 16 tests, comparing each of the 4 hormones to baseline, using each of
our 4 measurements. We will use the rank sum test for each comparison. Significant p-values are shown in
bold and underlined.
Mann-Whitney Test and CI: Dbilsec_1, Dbilsec_2
N Median
Mann-Whitney Test and CI: Dbilsec_1, Dbilsec_3
N Median
Mann-Whitney Test and CI: Dbilsec_1, Dbilsec_4
N Median
Mann-Whitney Test and CI: Dbilsec_1, Dbilsec_5
N Median
CHAPTER 9/NONPARAMETRIC METHODS 203
Mann-Whitney Test and CI: Dbilph_1, Dbilph_2
N Median
Dbilph_1 30 0.000
Mann-Whitney Test and CI: Dbilph_1, Dbilph_3
N Median
Dbilph_1 30 0.000
Mann-Whitney Test and CI: Dbilph_1, Dbilph_4
N Median
Dbilph_1 30 0.000
Mann-Whitney Test and CI: Dbilph_1, Dbilph_5
N Median
Dbilph_1 30 0.000
Mann-Whitney Test and CI: Dpansec_1, Dpansec_2
N Median
Dpansec_1 30 0.000
Mann-Whitney Test and CI: Dpansec_1, Dpansec_3
N Median
Dpansec_1 30 0.000
Mann-Whitney Test and CI: Dpansec_1, Dpansec_4
N Median
Dpansec_1 30 0.000
Mann-Whitney Test and CI: Dpansec_1, Dpansec_5
N Median
Dpansec_1 30 0.000
Mann-Whitney Test and CI: Dpanph_1, Dpanph_2