Lecture Notes
Chapter Fourteen: Nonparametric Statistics
Randall Miller
Key Symbols
o Population median
o S Test statistic for sign test
o
1
T Sum of ranks of observations in sample 1
o
2
T Sum of ranks of observations in sample 2
o
L
T Critical lower Wilcoxon rank sum value
o
U
T Critical upper Wilcoxon rank sum value
o T
+
Sum of ranks of positive differences of paired observations
o T
Sum of ranks of negative differences of paired observations
o
0
T Critical value of Wilcoxon signed ranks test
o
j
R Rank sum of observations in sample j
o H Test statistic for Kruskal Wallis test
o
r
F Test statistic for Friedman test
o
s
r Spearmans rank correlation coefficient
o Population correlation coefficient
Formulas
Sign Test for a Population Median
One-Tailed Test
| |
0 0
0 0
:
: or :
a a
H
H H
=
> <
Test statistic:
S = Number of sample measurements
greater than
0
[or S = number of
measurements less than
0
]
Two-Tailed Test
0 0
0
:
:
a
H
H
=
Test Statistic:
S = Larger of
1 2
and S S where
1
S is the
number of measurements less than
0
and
2
S is the number of measurements
greater than
0
[Note: Eliminate observation from the analysis that are exactly equal to the hypothesized median,
0
.]
Observed significance level:
p-value = ( ) P x S
Observed significance level:
p-value = ( ) 2P x S
where x has a binomial distribution with parameter n and p = .5. (Use Table II, Appendix A.)
Lecture Notes
Chapter Fourteen: Nonparametric Statistics
Randall Miller
Rejection region: z z
>
Rejection region:
/ 2
z z
>
Where tabulated z -values can be found in Table IV, Appendix A.
Large Sample Sign Test for a Population Median
One-Tailed Test
| |
0 0
0 0
:
: or :
a a
H
H H
=
> <
Two-Tailed Test
0 0
0
:
:
a
H
H
=
Test statistic:
( ) .5 .5
.5
S n
z
n
=
[Note: S is calculated as shown above. We subtract .5 from S as the correction for continuity.
The null-hypothesized mean value is .5 np n = , and the standard deviation is
( )( ) .5 .5 .5 npq n n = =
(See Chapter 5 for details on the normal approximation to the binomial distribution.)]
Rejection region: z z
> Rejection region:
/ 2
z z
>
where tabulated z-values can be found in Table IV, Appendix A.
Wilcoxon Rank Sum Test: Independent Samples
Let
1 2
and D D represent the probability distribution for populations 1 and 2, respectfully.
One-Tailed Test
| |
0 1 2
1 2
1 2
: and are identical
: is shifted to the right of
or : is shifted to the left of
a
a
H D D
H D D
H D D
Test statistic:
1 1 2 2 2 1
if : if T n n T n n < <
(Either rank sum can be used if
1 2
n n = .)
Rejection region:
| |
| |
1 1 1
2 2 2
: or
: or
U L
L U
T T T T T
T T T T T
Two-Tailed Test
0 1 2
1
2
: and are identical
: is shifted either to the left or to
the right of
a
H D D
H D
D
Test statistic:
1 1 2 2 2 1
if : if T n n T n n < <
(Either rank sum can be used if
1 2
n n = .)
We will denote this rank sum as T.
Rejection region:
or T T
L U
T T
Where and
L U
T T are obtained from Table XII of Appendix A.
Lecture Notes
Chapter Fourteen: Nonparametric Statistics
Randall Miller
Ties: Assign tied measurements the average of the ranks they would receive if they were unequal,
but occurred in successive order. To example, if the third-ranked and fourth-ranked
measurements are tied, assign each a rank of ( ) 3 4 / 2 3.5 + = .
The Wilcoxon Rank Sum Test for Large Sample
( )
and
1 2
n 10 n 10
Let
1 2
and D D represent the probability distribution for populations 1 and 2, respectfully.
One-Tailed Test
| |
0 1 2
1 2
1 2
: and are identical
: is shifted to the right of
or : is shifted to the left of
a
a
H D D
H D D
H D D
Two-Tailed Test
0 1 2
1
2
: and are identical
: is shifted either to the left or to
the right of
a
H D D
H D
D
Test statistic:
( )
( )
1 1 2
1
1 2 1 2
1
2
1
12
n n n
T
z
n n n n
+ +
=
+ +
Rejection region:
( ) or z z z z
> <
Rejection region:
/ 2
z z
>
Wilcoxon Signed Rank Test for a Paired Difference Experiment
Let
1 2
and D D represent the probability distribution for populations 1 and 2, respectfully.
One-Tailed Test
| |
0 1 2
1 2
1 2
: and are identical
: is shifted to the right of
or : is shifted to the left of
a
a
H D D
H D D
H D D
Two-Tailed Test
0 1 2
1
2
: and are identical
: is shifted either to the left or to
the right of
a
H D D
H D
D
Calculate the difference within each of the n matched pairs of observations. Then rank the
absolute value of the n differences from the smallest (rank 1) to the highest (rank n), and calculate
the rank sum T
of the negative differences and the rank sum T
+
of the positive differences.
[Note: Differences equal to zero are eliminated, and the number n of differences is reduced
accordingly.]
Test statistic:
T
, the rank sum of the negative
differences [or T
+
, the rank sum of the
positive differences]
Rejection region:
| |
0 0
or T T T T
+
Lecture Notes
Chapter Fourteen: Nonparametric Statistics
Randall Miller
Test statistic:
T , the smaller of or T T
+
Rejection region:
0
T T
Where
0
T is given in Table XIII in Appendix A.
Ties: Assign tied absolute differences the average of the ranks they would receive if they were
unequal, but occurred in successive order. For example, if the third-ranked and fourth-ranked
differences are tied, assign both a rank of ( ) 3 4 / 2 3.5 + = .
Wilcoxon Signed Rank Test for Large Samples
( )
n 25
Let
1 2
and D D represent the probability distribution for populations 1 and 2, respectfully.
One-Tailed Test
| |
0 1 2
1 2
1 2
: and are identical
: is shifted to the right of
or : is shifted to the left of
a
a
H D D
H D D
H D D
Two-Tailed Test
0 1 2
1
2
: and are identical
: is shifted either to the left or to
the right of
a
H D D
H D
D
Test statistic:
( )
( )( )
1 / 4
1 2 1 / 24
T n n
z
n n n
+
+ (
=
+ + (
Rejection region:
| | or z z z z
> <
Rejection region:
/ 2
z z
>
Assumptions: The sample size n is greater than or equal to 25. Differences equal to zero are
eliminated and the number n of differences is reduced accordingly. Tied absolute differences
receive ranks equal to the average of the ranks they would have received had they not been tied.
Kruskal Wallis H-Test for Comparing k Probability Distributions
0
: The probability distributions are identical
: At least two of the probability distributions differ in location
a
H k
H k
Test statistic:
( )
( )
2
1
12
3 1
1
n
j
j
j
R
H n
n n n
=
= +
+
Where
j
n = Number of measurements in sample j
Lecture Notes
Chapter Fourteen: Nonparametric Statistics
Randall Miller
j
R = Rank sum for sample j, where the rank of each measurement is computed according to it
relative magnitude in the totality of data for the k samples
n = Total sample size
1 2
...
k
n n n = + + +
Rejection region: ( )
2
with 1 degrees of freedom H k
>
Ties: Assign tied measurements the average of the ranks they would receive if they were unequal,
but occurred in successive order. For example, if the third-ranked and fourth-ranked
measurements are tied, assign both a rank ( ) 3 4 / 2 3.5 + = . The number of ties should be small
relative to the total number of observations.
Friedman
r
F -Test for a Randomized Block Design
0
: The probability distributions for the treatments are identical
H : At least two of the probability distributions differ in location
a
H p
Test statistic:
( )
( )
2
1
12
3 1
1
n
r j
j
F R b k
bk k
=
= +
+
Where
b = Number of blocks
k = Number of treatments
j
R = Rank sum of the jth treatment, where the rank of each measurement is computed relative to
its position within its own block.
Rejection region: ( )
2
with 1 degrees of freedom
r
F k
>
Ties: Assign tied measurements within a block the average of the ranks they would receive if they
were unequal, but occurred in successive order. For example, if the third-ranked and fourth-
ranked measurements are tied, assign each a rank of ( ) 3 4 / 2 3.5 + = . The number of ties should
be small relative to the total number of observations.
Spearmans Rank Correlation Coefficient
SS
SS SS
uv
s
uu vv
r =
Lecture Notes
Chapter Fourteen: Nonparametric Statistics
Randall Miller
Where
( )( )
( )
( )
1 1
1 1
2
2
1 2
1 1
2
2
1 2
1 1
ss
ss
ss
n n
i i
n n
i i
uv i i i i
i i
n
i
n n
i
uu i i
i i
n
i
n n
i
v i i
i i
u v
u u v v u v
n
u
u u u
n
v
v v v
n
= =
= =
=
= =
=
= =
| || |
| |
\ .\ .
= =
| |
|
\ .
= =
| |
|
\ .
= =
i
u = Rank of the ith observation in sample 1
i
v = Rank of the ith observation in sample 2
n = Number of pairs of observations (number of observations in each sample)
Shortcut Formula for
s
r
( )
2
1
2
6
1
1
n
i
i
s
d
r
n n
=
=
Where
i i i
d u v = (difference in the ranks of the ith observations for samples 1 and 2)
Spearmans Nonparametric Test for Rank Correlation
One-Tailed Test
| |
0
: 0
: 0 or : 0
a a
H
H H
=
> <
Two-Tailed Test
0
: 0
: 0
a
H
H
Test statistic:
s
r , the sample rank correlation (see formula above)
Rejection region:
, s s
r r
>
,
or when : 0
s s a
r r H
( < <
Where
, s
r
is the value form Table XIV
corresponding to the upper-tail area
and n pairs of observations
Rejection region:
, / 2 s s
r r
>
Where
, / 2 s
r
is the value form Table XIV
corresponding to the upper-tail area
/ 2 and n pairs of observations
Lecture Notes
Chapter Fourteen: Nonparametric Statistics
Randall Miller
Ties: Assign tied measurements the average of the ranks they would receive if they were
unequal, but occurred in successive order. For example, if the third-ranked and fourth-ranked
measurements are tied, assign each a rank of ( ) 3 4 / 2 3.5 + = . The number of ties should be small
relative to the total number of observations.