Professional Documents
Culture Documents
Chapter13 Statistika Nonparametrik
Chapter13 Statistika Nonparametrik
Elementary Statistics
Eleventh Edition
by Mario F. Triola
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 1
Chapter 13
Nonparametric Statistics
13-1 Review and Preview
13-2 Sign Test
13-3 Wilcoxon Signed-Ranks Test for
Matched Pairs
13-4 Wilcoxon Rank-Sum Test for Two
Independent Samples
13-5 Kruskal-Wallis Test
13-6 Rank Correction
13-7 Runs Test for Randomness
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 2
Section 13-1
Review and Preview
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 3
Review
In the preceding chapters, we presented a
variety of different methods of inferential
statistics. Many of those methods require
normally distributed populations and are
based on sampling from a population with
specific parameters, such as the mean ,
standard deviation , or population
proportion p.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 4
Preview
Definitions
Parametric tests have requirements about the
nature or shape of the populations involved.
Nonparametric tests do not require that
samples come from populations with normal
distributions or have any other particular
distributions. Consequently, nonparametric
tests are called distribution-free tests.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 5
Advantages of Nonparametric Methods
1. Nonparametric methods can be applied to a
wide variety of situations because they do not
have the more rigid requirements of the
corresponding parametric methods. In
particular, nonparametric methods do not
require normally distributed populations.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 7
Efficiency of Nonparametric Methods
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 8
Definitions
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 9
Handling Ties in Ranks
Find the mean of the ranks involved and assign
this mean rank to each of the tied items.
Sorted Data Preliminary Ranking Rank
4 1 1
5 2 3
5 3 Mean is 3. 3
5 4 3
10 5 5
11 6 6
12 7 7.5
Mean is 7.5.
12 8 7.5
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 10
Section 13-2
Sign Test
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 11
Key Concept
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 12
Definition
The sign test is a nonparametric (distribution
free) test that uses plus and minus signs to test
different claims, including:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 13
Basic Concept of the
Sign Test
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 14
Figure 13-1 Sign Test Procedure
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 15
Figure 13-1 Sign Test Procedure
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 16
Figure 13-1 Sign Test Procedure
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 17
Requirements
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 18
Notation for Sign Test
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 19
Test Statistic
n
(x + 0.5) – 2
For n > 25: z =
n
2
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 20
Critical Values
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 21
Caution
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 22
Claims Involving Matched Pairs
When using the sign test with data that are
matched pairs, we convert the raw data to
plus and minus signs as follows:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 24
Example:
Table 13-3 includes some of the weights listed
in Data Set 3 in Appendix B. Those weights
were measured from college students in
September and April of their freshman year.
Use the sample data in Table 13-3 with a 0.05
significance level to test the claim that there is
no difference between the September weights
and the April weights. Use the sign test.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 25
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 26
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 27
Example:
We conclude that the September and April
weights appear to be about the same. (If we
use the parametric t test for matched pairs
(Section 9-4), we conclude that the mean
difference is not zero, so the September
weights and April weights appear to be
different.)
The conclusion should be qualified with the
limitations noted in the article about the study.
Only Rutgers students were used, and study
subjects were volunteers instead of being a
simple random sample.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 28
Claims Involving
Nominal Data
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 29
Example:
The Genetics and IVF Institute conducted a clinical
trial of its methods for gender selection. As of this
writing, 668 of 726 babies born to parents using the
XSORT method of gender selection were girls. Use
the sign test and a 0.05 significance level to test the
claim that this method of gender selection is
effective in increasing the likelihood of a baby girl.
The procedures are for cases in which n > 25.
Note that the only requirement is that the sample
data are randomly selected.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 31
Example:
Since n = 726 (> 25), the test statistic x = 58 is
converted to the test statistic x as follows:
n
(x + 0.5) – 2
z=
n
2
726
(58 + 0.5) – 2 = –22.60
z=
726
2
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 32
Example:
With = 0.05 in a left-tailed test, the critical
value is z = – 1.645.
The test statistic z = –22.60 is in the critical
region bounded by z = –1.645.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 33
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 34
Claims About the Median
of a Single Population
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 35
Example: Body Temperature
Data Set 2 in Appendix B includes measured
body temperatures of adults. Use the 106
temperatures listed for 12 A.M. on Day 2 with
the sign test to test the claim that the median is
less than 98.6ºF. Of the 106 subjects, 68 had
temperatures below 98.6ºF, 23 had
temperatures above 98.6ºF, and 15 had
temperatures equal to 98.6ºF.
H0: Median is equal to 98.6°F.
H1: Median is less than 98.6°F.
Since the claim is that the median is less than
98.6°F, the test involves only the left tail.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 36
Example: Body Temperature
So n = 91 and x = 23
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 37
Example: Body Temperature
n
(x + 0.5) – 2
z=
n
2
91
(23 + 0.5) – 2 = – 4.61
z=
91
2
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 38
Example: Body Temperature
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 40
Recap
In this section we have discussed:
Sign tests where data are assigned plus or
minus signs and then tested to see if the
number of plus and minus signs is equal.
Sign tests can be performed on claims
involving:
Matched pairs
Nominal data
The median of a single population
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 41
Section 13-3
Wilcoxon Signed-Ranks
Test for Matched Pairs
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 42
Key Concept
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 43
Definition
The Wilcoxon signed-ranks test is a
nonparametric test that uses ranks for these
applications:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 44
Objective
Use the Wilcoxon signed-ranks test with
matched pairs for the following null and
alternative hypotheses:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 45
Wilcoxon Signed-Ranks Test
Requirements
1. The data consist of matched pairs that have
been randomly selected.
2. The population of differences (found from the
pairs of data) has a distribution that is
approximately symmetric, meaning that the
left half of its histogram is roughly a mirror
image of its right half. (There is no
requirement that the data have a normal
distribution.)
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 46
Notation
T = the smaller of the following two
sums:
1. The sum of the positive ranks of the
nonzero differences d
2. The absolute value of the sum of the
negative ranks of the nonzero
differences d
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 47
Test Statistic for the
Wilcoxon Signed-Ranks Test
for Matched Pairs
T – n(n + 1)
4
For n > 30, the test statistic is z =
n(n +1) (2n +1)
24
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 48
Critical Values for the
Wilcoxon Signed-Ranks Test
for Matched Pairs
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 49
Procedure for Finding the
Value of the Test Statistic
Step 1: For each pair of data, find the difference
d by subtracting the second value from
the first. Keep the signs, but discard any
pairs for which d = 0.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 51
Procedure for Finding the
Value of the Test Statistic
Step 6: Let n be the number of pairs of data for
which the difference d is not 0.
Step 7: Determine the test statistic and critical
values based on the sample size, as
shown above.
Step 8: When forming the conclusion, reject the
null hypothesis if the sample data lead
to a test statistic that is in the critical
region that is, the test statistic is less
than or equal to the critical value(s).
Otherwise, fail to reject the null
hypothesis.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 52
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 53
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 55
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 56
Example: Freshman Weight Gain
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 59
Example: Freshman Weight Gain
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 61
Recap
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 62
Section 13-4
Wilcoxon Rank-Sum Test
for Two Independent
Samples
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 63
Key Concept
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 64
Key Concept
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 65
Basic Concept
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 66
Caution
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 67
Definition
The Wilcoxon rank-sum test is a nonparametric
test that uses ranks of sample data from two
independent populations. It is used to test the
null hypothesis that the two independent
samples come from populations with equal
medians.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 68
Notation
n1 = size of Sample 1
n2 = size of Sample 2
R1 = sum of ranks for Sample 1
R2 = sum of ranks for Sample 2
R = same as R1 (sum of ranks for Sample 1)
R = mean of the sample R values that is
expected when the two populations have
equal medians
R = standard deviation of the sample R values
that is expected when the two populations
have equal medians
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 69
Requirements
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 70
Test Statistic
R – R
z= R
n1 (n1 + n2 + 1)
where R
=
2
R = n1 n2 (n1 + n2 + 1)
12
n1 = size of the sample from which the rank
sum R is found
n2 = size of the other sample
R = sum of ranks of the sample with size n1
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 71
Critical and P-Values for the
Wilcoxon Rank-Sum Test
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 72
Procedure for Finding the
Value of the Test Statistic
1. Temporarily combine the two samples into
one big sample, then replace each sample
value with its rank.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 73
Example:
Table 13-5 lists the braking
distances (in ft) of samples of
4-cylinder cars and 6-cylinder
cars Use a 0.05 significance
level to test the claim that 4-
cylinder cars and 6-cylinder
cars have the same median
braking distance.
The numbers in parentheses
are their ranks beginning with
a rank of 1 assigned to the
lowest value of 122.
R1 and R2 at the bottom
denote the sum of ranks.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 74
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 75
Example:
Procedure
1. Rank all 25 BMI measurements combined.
This is done in Table 13-5.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 76
Example:
Procedure (cont.)
3. Calculate the value of the z test statistic.
n1 (n1 n2 1) 13(13 12 1)
R 169
2 2
R R 180.5 169
z 0.63
R 18.385
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 77
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 78
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 80
Section 13-5
Kruskal-Wallis Test
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 81
Key Concept
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 82
Kruskal-Wallis Test
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 83
Definition
The Kruskal-Wallis test (also called the H test) is
a nonparametric test that uses ranks of simple
random samples from three or more independent
populations.
It is used to test the null hypothesis that the
independent samples come from populations
with the equal medians.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 85
Kruskal-Wallis Test
Requirements
1. We have at least three independent
random samples.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 86
Kruskal-Wallis Test
Test Statistic
12 2
R1 R22
Rk
2
H ... 3( N 1)
N ( N 1) n1 n2 nk
Critical Values
1. Test is right-tailed.
2. df = k – 1 (Because the test statistic H can be
approximated by the 2 distribution, use
Table A-4).
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 87
Procedure for Finding the
Value of the Test Statistic H
1 Temporarily combine all samples into
one big sample and assign a rank to
each sample value.
2. For each sample, find the sum of the
ranks and find the sample size.
3. Calculate H by using the results of Step
2 and the notation and test statistic.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 88
Procedure for Finding the
Value of the Test Statistic H
The test statistic H is basically a measure of
the variance of the rank sums R1 , R2 , … , R k.
If the ranks are distributed evenly among the
sample groups, then H should be a relatively
small number.
If the samples are very different, then the
ranks will be excessively low in some groups
and high in others, with the net effect that H
will be large.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 89
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 90
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 91
Example:
n1 = 10, n2 = 10, n3 = 10
N = 30
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 93
Example:
5.774
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 94
Example:
df = k – 1 = 3 – 1 = 2
α = 0.05 (right-tail)
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 96
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 98
Section 13-6
Rank Correlation
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 99
Key Concept
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 100
Definition
The rank correlation test (or Spearman’s rank
correlation test) is a non-parametric test that
uses ranks of sample data consisting of
matched pairs.
It is used to test for an association between
two variables.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 101
Advantages
Rank correlation has these advantages
over the parametric methods discussed
in Chapter 10:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 102
Objective
Compute the rank correlation coefficient r1
and use it to test for an association between
two variables.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 103
Notation
rs = rank correlation coefficient for sample paired
data
(rs is a sample statistic)
s = rank correlation coefficient for all the
population data
(s is a population parameter)
n = number of pairs of sample data
d = difference between ranks for the two values
within a pair
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 104
Requirements
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 105
Rank Correlation
Test Statistic
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 106
Rank Correlation
Test Statistic
Ties: After converting the data in each sample
to ranks, if either variable has ties among its
ranks, the exact value of the test statistic rs can
be found by using Formula 10-1 with the ranks:
nxy (x)(y )
rs
n ( x ) ( x )2 2
n ( y ) ( y )
2 2
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 107
Rank Correlation
Critical values:
If n ≤ 30, critical values are found in Table A-9.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 109
Figure 13-4 Rank Correlation for Testing H0: s = 0
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 110
Figure 13-4 Rank Correlation for Testing H0: s = 0
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 111
Example:
Table 13-1 lists overall quality scores and
selectivity rankings of a sample of national
universities (based on data from U.S. News and
World Report). Find the value of the rank
correlation coefficient and use it to determine
whether there is a correlation between the overall
quality scores and the selectivity rankings. Use a
0.05 significance level. Based on the result, does it
appear that national universities with higher
overall quality scores are more difficult to get into?
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 112
Example:
Requirement is satisfied: paired data are a
simple random sample
H 0: s = 0 H 1: s 0
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 113
Example:
6d 2 6(156)
rs 1 1
n(n 1)
2
8(8 1)
2
936
1 0.857
504
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 114
Example:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 116
Example: Detecting a Nonlinear
Pattern
Requirement is satisfied: date are from a simple
random sample
The hypotheses are:
H 0: s = 0 H 1: s 0
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 117
Example: Detecting a Nonlinear
Pattern
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 120
Recap
In this section we have discussed:
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 122
Key Concept
This section introduces the runs test for
randomness, which can be used to
determine whether the sample data in a
sequence are in a random order.
This test is based on sample data that have
two characteristics, and it analyzes runs of
those characteristics to determine whether
the runs appear to result from some random
process, or whether the runs suggest that
the order of the data is not random.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 123
Definition
A run is a sequence of data having the
same characteristic; the sequence is
preceded and followed by data with a
different characteristic or by no data at
all.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 124
Fundamental Principles
of the Run Test
Reject randomness if the number of runs
is very low or very high.
Example: The sequence of genders FFFFFMMMMM is
not random because it has only 2 runs, so the number
of runs is very low.
Example: The sequence of genders FMFMFMFMFM is
not random because there are 10 runs, which is very
high.
It is important to note that the runs test for
randomness is based on the order in which the
data occur; it is not based on the frequency of
the data.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 125
Caution
The runs test for randomness is based
on the order in which the data occur; it is
not based on the frequency of the data.
For example, a sequence of 3 men and
20 women might appear to be random,
but the issue of whether 3 men and 20
women constitute a biased sample (with
disproportionately more women) is not
addressed by the runs test.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 126
Figure 13-6 Procedure for
Runs Test for Randomness
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 127
Figure 13-6
Procedure for Runs
Test for Randomness
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 128
Objective
Apply the runs test for randomness to a
sequence of sample data to test for
randomness in the order of the data.
Use the following null and alternative
hypotheses.
H0: The data are in a random sequence.
H1: The data are in a sequence that is not
random.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 129
Notation
G = number of runs
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 130
Requirements
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 131
Runs Test for Randomness
Test Statistic
Test statistic is the number of runs G
Critical Values
Critical values are found in Table A-10.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 132
Runs Test for Randomness
Decision criteria
Reject randomness if the number of runs G is:
• less than or equal to the smaller critical
value found in Table A-10.
• or greater than or equal to the larger
critical value found in Table A-10.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 133
Runs Test for Randomness
(2n1n2 )(2n1n2 n1 n2 )
and G
(n1 n2 ) 2 (n1 n2 1)
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 134
Runs Test for Randomness
For Large Samples (n1 > 20 or n2 > 20) or
≠ 0.05:
Critical Values
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 135
Runs Test for Randomness
Decision criteria
Reject randomness if the test statistic z is:
• less than or equal to the negative critical z
score (such as –1.96).
• or greater than or equal to the positive
critical z score (such as 1.96).
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 136
Example: Small Sample: Genders of
Study Participants
Listed below are the genders of the first 15
subjects participating in the “Freshman 15”
study with results listed in Data Set 3 in
Appendix B. Use a 0.05 significance level to test
for randomness in the sequence of genders.
MMMMFMFFFFFMMFF
Requirements are satisfied, so separate the
runs as shown below.
MMMM F M FFFFF MM FF
3rd run
1st run 2nd run 4th run 5th run 6th run
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 137
Example: Small Sample: Genders of
Study Participants
MMMM F M FFFFF MM FF
1st run 2nd run 3rd run 4th run 5th run 6th run
1st run 2nd run 3rd run 4th run 5th run 6th run
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 139
Example: Large Sample: Global
Warming
Listed below are the global mean temperatures
(in ºC) of the earth’s surface (based on data from
the Goddard Institute for Space Studies). The
temperatures each represent one year, and they
are listed in order by row. Use a 0.05
significance level to test for randomness above
and below the mean. What does the result
suggest about the earth’s temperature?
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 140
Example: Large Sample: Global
Warming
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 142
Example: Large Sample: Global
Warming
Since n1 > 20, calculate z using the formulas:
2n1n2 2(68)(58)
G 1 1 63.6032
n1 n2 68 58
(2n1n2 )(2n1n2 n1 n2 )
G
(n1 n2 ) (n1 n2 1)
2
(2)(68)(58)[(2(68)(58) 68 58]
5.55450
(68 58) (68 58 1)
2
G G 32 63.6032
z 5.69
G 5.55450
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 143
Example: Large Sample: Global
Warming
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 13.1 - 146