Chapter 18 - Nonparametric methods. After mastering the material in this chapter, you will be able to: Use the sign test to test a hypothesis about a population median, compare the locations of two distributions using a rank sum test for independent samples, compare the locations of two distributions using a signed ranks test for paired samples,...
Nonparametric Methods
18.1 The Sign Test: A Hypothesis Test about
the Median
18.2 The Wilcoxon Rank Sum Test
18.3 The Wilcoxon Signed Ranks Test
18.4 Comparing Several Populations Using
the KruskalWallis H Test
18.5 Spearman’s Rank Correlation Coefficient
182
LO18-1: Use the sign
test to test a hypothesis
about a population
median. 18.1 Sign Test: A Hypothesis Test about
the Median
Define…
◦S = the number of sample measurements
(less/greater) than M0
◦x to be a binomial random variable with p = 0.5
We can reject H0: Md = M0 at the level of
significance (probability of Type I error
equal to ) by using the appropriate pvalue
183
LO18-1
Sign Test: A Hypothesis Test about the
Median Continued
Alternative Test Statistic pValue
Ha: Md > Mo S=number of The probability that x
measurements is greater than or equal
greater than Mo to S
Ha: Md
LO18-2: Compare the
locations of two
distributions using a
18.2 The Wilcoxon Rank Sum Test
rank sum test for
independent samples.
Given two independent samples of sizes n1 and n2
from populations 1 and 2 with distributions D1 and
D2
Rank the (n1+ n2) observations from smallest to
largest (average ranks for ties)
◦ T1 = sum of ranks, sample 1
◦ T2 = sum of ranks, sample 2
◦ T = T1 if n1 n2 and T = T2 if n1> n2
We can reject H0: D1 and D2 are identical
probability distributions at the level of
significance if and only if the test statistic T satisfies
the appropriate rejection condition
185
LO18-2
The Wilcoxon Rank Sum Test Continued
Alternative Reject H0 if
Ha: D1 is shifted right of D2 T ≥ Tu if n1 ≤ n2
T ≤ Tu if n1 > n2
Ha: D1 is shifted left of D2 T ≤ TL if n1 ≤ n2
T ≥ TL if n1 > n2
Ha: D1 is shifted right or left of D2 T ≤ Tu or T ≥ Tu
186
LO18-3: Compare the
locations of two
distributions using a
signed ranks test for
paired samples.
18.3 The Wilcoxon Signed Rank
Test
Given two matched pairs of n observations, selected at
random from populations 1 and 2 with distributions D1
and D2 compute the n differences (D1 – D2)
Rank the absolute value of the differences from
smallest to largest
◦Drop zero differences from sample
◦Assign average ranks for ties
◦T = sum of ranks, negative differences
◦T+ = sum of ranks, positive differences
We can reject H0: D1 and D2 are identical probability
distributions at the level of significance if and only
if the appropriate test statistic satisfies the
corresponding rejection point condition
187
LO18-3
The Wilcoxon Signed Rank Test Continued
Alternative Test Statistic Reject H0 if
Ha: D1 is shifted right of T T ≤ T0
D2
Ha: D1 is shifted left of T+ T+ ≤ T0
D2
Ha: D1 is shifted right or T=smaller of T T ≤ T0
left of D2 or T+
188
LO18-4: Compare the
locations of three or
more distributions using
a Kruskal–Wallis test for
independent samples.
18.4 Comparing Several Populations
Using The KruskalWallis H Test
Given p independent samples
(n1, …, np 5) from p populations
Rank the (n1+ … + np) observations from
smallest to largest (average ranks for ties)
Let T1 equal sum of ranks, sample 1,
continuing until Tp equals sum of ranks,
sample p
189
LO18-4
The KruskalWallis H Test Continued
To test…
H0: The p populations are identical
Ha: At least two of the populations differ in location
Test statistic
p 2
12 Ti
H= 3(n 1 )
n(n 1 ) i 1 ni
Reject H
0 if H > 2
or if pvalue
LO18-5: Measure and
test the association
between two variables
by using Spearman’s
rank correlation
18.5 Spearman’s Rank Correlation
coefficient.
Coefficient
Given n pairs of measurements on two variables, rank
each separately, assigning average ranks for ties
The Spearman rank correlation coefficient, rs is given
by rs = corr[xrank, yrank] is the standard Pearson
correlation coefficient
If there are no ties, the Spearman correlation
coefficient can be calculated as
6 di2
rs=1
n(n 2 1 )
Where di is the difference between the xrank and the
yrank for the ith observation
1811
LO18-5
Spearman’s Rank Correlation Test
Critical Value Rule
Alternative Hypothesis Reject H0 if
Ha: ps > 0 rs > r
Ha: Ha: ps