Sei sulla pagina 1di 56

Chapter 11

Nonparametric Tests
§ 11.1
The Sign Test
Sign Test for a Population Median
A nonparametric test is a hypothesis test that does not
require any specific conditions concerning the shape of
the population or the value of any population parameters.
The sign test is a nonparametric test that can be used to
test a population median against a hypothesized value k.

The sign test for a population median can be left tailed,


right tailed, or two tailed.
Left-tailed test:
H0: median  k and Ha: median < k
Right-tailed test:
H0: median  k and Ha: median > k
Two-tailed test:
H0: median = k and Ha: median  k
Larson & Farber, Elementary Statistics: Picturing the World, 3e 3
Sign Test for a Population Median
To use the sign test, each entry is compared with the
hypothesized median. If the entry is below the median, a 
sign is assigned; if above the median, a + sign is assigned.

Test Statistic for the Sign Test


When n  25, the test statistic x for the sign test is the smaller
number of + or  signs.
When n > 25, the test statistic for the sign test is

z  (x  0.5)  0.5n
n
2
where x is the smaller number of + or  signs and n is the sample
size, i.e., the total number of + or  signs.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 4
Sign Test for a Population Median
Performing a Sign Test for a Population Median
In Words In Symbols
1. State the claim. Identify the State H0 and Ha.
null and alternative hypotheses.

2. Specify the level of significance. Identify .

3. Determine the sample size n by n = total number


assigning + signs and – signs to of + and – signs
the sample data .

4. Determine the critical value. If n  25, use Table 8. If


n > 25, use Table 4.
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 5
Sign Test for a Population Median
Performing a Sign Test for a Population Median
In Words In Symbols
5. Calculate the test statistic. If n  25, use x.
If n > 25, use
z  (x  0.5)  0.5n
n
2

6. Make a decision to reject or fail to If x or z is in the


reject the null hypothesis. rejection region,
reject H0.
7. Interpret the decision in the
Otherwise, fail to
context of the original claim.
reject H0.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 6


Sign Test for a Population Median
Example:
A college statistics professor claims that the median test
score for his students’ last test is 58. The scores for 18
randomly selected tests are listed below. At  = 0.01, can
you reject the professor’s claim?
58 62 55 55 53 52 52 59 55
55 60 56 57 61 58 63 63 55
H0: median = 58 (Claim)
Ha: median  58
Determine the values that are above and below the median of 58.
There are 6 + signs
0 +      + 
and 10  signs.
 +   + 0 + + 
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 7
Sign Test for a Population Median
Example continued:
Since there are 6 + signs and 10  signs, n = 6 + 10 = 16.
Using Table 8 with  = 0.01 (two tailed) and n = 16, the
critical value is 2.

Because n  25, the test statistic x is the smaller number


of + signs or  signs, so x = 6.

6 is greater than the critical value, so we fail to reject H0.

There is not enough evidence at the 1% level to reject the


professor’s claim that the median test score is 58.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 8


The Paired-Sample Sign Test
The paired-sample sign test is used to test the difference
between two population medians when the populations are
not normally distributed.

For the paired-sample sign test to be used, the following


must be true.
1. A sample must be randomly selected from each
population.
2. The samples must be dependent (paired).

The difference between corresponding data entries is


found and the sign of the difference is recorded.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 9


The Paired-Sample Sign Test
Performing a Paired-Sample Sign Test
In Words In Symbols
1. Identify the claim. State the null State H0 and Ha.
and alternative hypotheses.

2. Specify the level of significance. Identify .

3. Determine the sample size n by n = total number


finding the difference for each data of + and – signs
pair. Assign a + sign for a positive
difference, a – sign for a negative
difference, and a 0 for no difference.

Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 10
The Paired-Sample Sign Test
Performing a Paired-Sample Sign Test
In Words In Symbols
4. Determine the critical value. Use Table 8 in
Appendix B.

5. Find the test statistic. x = lesser number of


+ and – signs

6. Make a decision to reject or fail to If the test statistic is


reject the null hypothesis. less than or equal to
the critical value,
7. Interpret the decision in the
reject H0. Otherwise,
context of the original claim.
fail to reject H0.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 11


The Paired-Sample Sign Test
Example:
Students at a certain school are required to take the SAT twice.
The table shows both verbal SAT scores for 12 students. At  =
0.05, can you conclude that the scores improved the second time
they took the SAT?
Student 1 2 3 4 5 6
Score on first SAT 308 456 352 433 306 471
Score on second SAT 300 524 409 419 304 483
Sign  + +   + There are 8
+ signs and
Student 7 8 9 10 11 12 4  signs.
Score on first SAT 538 207 205 351 360 251
Score on second SAT 708 253 399 350 480 303
Sign + + +  + + Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 12
The Paired-Sample Sign Test
Example continued:
H0: The SAT scores have not improved.
Ha: The SAT scores have improved. (Claim)

Since there are 8 + signs and 4  signs, n = 8 + 4 = 12.


Using Table 8 with  = 0.05 (one tailed) and n = 12, the
critical value is 2.

The test statistic x is the smaller number of + signs or 


signs, so x = 4.
4 is greater than the critical value, so we fail to reject H0.
There is not enough evidence at the 5% level to support
the claim that verbal SAT scores improved.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 13
§ 11.2
The Wilcoxon Tests
The Wilcoxon Signed-Rank Test
The Wilcoxon signed-rank test is a nonparametric test
that can be used to determine whether two dependent
samples were selected from populations having the same
distribution.

Performing a Wilcoxon Signed-Rank Test


In Words In Symbols
1. Identify the claim. State the State H0 and Ha.
null and alternative hypotheses.

2. Specify the level of significance. Identify .

3. Determine the sample size n.


Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 15
The Wilcoxon Signed-Rank Test
Performing a Wilcoxon Signed-Rank Test
In Words In Symbols
4. Determine the critical value. Use Table 9 in
Appendix B.
5. Calculate the test statistic ws.
a. Complete a table with the Headers: Sample 1,
following headers: Sample 2, Difference,
b. Find the sum of the positive Absolute value, Rank,
ranks and the sum of the and Signed rank.
negative ranks.
c. Select the smaller of
absolute values of the sums.
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 16
The Wilcoxon Signed-Rank Test
Performing a Wilcoxon Signed-Rank Test
In Words In Symbols
6. Make a decision to reject or If ws is less than or
fail to reject the null equal to the critical
hypothesis. value, reject H0.
Otherwise, fail to
7. Interpret the decision in the
reject H0.
context of the original claim.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 17


The Wilcoxon Signed-Rank Test
Example:
A medical researcher want to determine whether a new drug affects
the number of headache hours experienced by headache sufferers. To
do so, he selects seven patients and asks each to give the number of
headache hours (per day) each experiences before and after taking
the drug. The results are shown in the table. At  = 0.05, can the
researcher conclude that the new drug affects the number of hours?
Patient 1 2 3 4 5 6 7
Headache Hours (before) 0.8 2.4 2.8 2.6 2.7 0.9 1.2
Headache Hours (after) 1.6 1.3 1.6 1.4 1.5 1.6 1.7
H0: The drug does not affect the number of headache hours.
Ha: The drug does affect the number of headache hours. (Claim)
This is a two-tailed signed-rank test with  = 0.05 and n = 7.
From Table 9, the critical value is 2.
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 18
The Wilcoxon Signed-Rank Test
Example continued:
Hours Hours Absolute Signed
Difference Rank
(before) (after) value rank
0.8 1.6 0.8 0.8 3 3
2.4 1.3 1.1 1.1 4 4
2.8 1.6 1.2 1.2 6 6
2.6 1.4 1.2 1.2 6 6
2.7 1.5 1.2 1.2 6 6
0.9 1.6 0.7 0.7 2 2
1.2 1.7 0.5 0.5 1 1

The sum of the negative ranks is 6.


The average of rank 5, 6,
The sum of the positive ranks is 22.
and 7 is used for these.
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 19
The Wilcoxon Signed-Rank Test
Example continued:
The test statistic is the smaller of the absolute value of
the two sums.

|6| = 6 |22| = 22

ws = 6 which is greater than the critical value of 2.

Fail to reject H0.

There is not enough evidence at the 5% level to support


the claim that the drug affects the number of headache
hours.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 20


The Wilcoxon Rank Sum Test
The Wilcoxon rank sum test is a nonparametric test that
can be used to determine whether two independent samples
were selected from populations having the same
distribution.

A requirement for the Wilcoxon rank sum test is that


the sample size of both samples must be at least 10.
n1 represents the size of the smaller sample and n2
represents the size of the larger sample.
When calculating the sum of the ranks R, use the
ranks for the smaller of the two samples.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 21


The Wilcoxon Rank Sum Test
Test Statistic for the Wilcoxon Rank Sum Test
Given two independent samples, the test statistic z for the
Wilcoxon rank sum test is
R  μR
z
σR
where
R = sum of the ranks for the smaller sample,
n1 n1  n2  1
μR  ,
2
and
n1n2 n1  n2  1
σR  .
12

Larson & Farber, Elementary Statistics: Picturing the World, 3e 22


The Wilcoxon Rank Sum Test
Performing a Wilcoxon Rank Sum Test
In Words In Symbols
1. Identify the claim. State the State H0 and Ha.
null and alternative hypotheses.
2. Specify the level of significance. Identify .
3. Determine the critical value. Use Table 4 in
Appendix B.

4. Determine the sample sizes. n1  n 2

Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 23
The Wilcoxon Rank Sum Test
Performing a Wilcoxon Rank Sum Test
In Words In Symbols
5. Find the sum of the ranks for the R
smaller sample.
a. List the combined data in
ascending order.
b. Rank the combined data.
c. Add the sum of the ranks for
the smaller sample.
6. Calculate the test statistic. R  μR
z
σR
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 24
The Wilcoxon Rank Sum Test
Performing a Wilcoxon Rank Sum Test
In Words In Symbols
7. Make a decision to reject or If z is in the
fail to reject the null rejection region,
hypothesis. reject H0.
Otherwise, fail to
reject H0.
8. Interpret the decision in the
context of the original claim.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 25


The Wilcoxon Rank Sum Test
Example:
An industry analyst claims that there is no difference in the
salaries earned by workers in the manufacturing and
construction industries. A random sample of 10
manufacturing and 10 construction workers and their
salaries is shown below. At  = 0.10, can you reject the
analyst’s claim? (Adapted from US Bureau of Labor Statistics)

Industry Salary (in thousands of dollars)


Manufacturing 31 38 33 33 35 47 33 29 38 45
Construction 31 30 27 32 28 34 30 33 26 35
H0: There is no difference between the salaries. (Claim)
Ha: There is a difference between the salaries.
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 26
The Wilcoxon Rank Sum Test
Example continued:
Because the test is a two-tailed test with  = 0.10, the
critical values are
z0 = 1.645 and z0 = 1.645.

The rejection regions are


z  1.645 and z  1.645.

To find the values of R, μR, andR, construct a table that


shows the combined data in ascending order and the
corresponding ranks.

Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 27
The Wilcoxon Rank Sum Test
Example continued:

Ordered Sample Rank Ordered Sample Rank


data data
26 C 1 33 M 11.5
27 C 2 33 M 11.5
28 C 3 33 M 11.5
29 M 4 34 C 14
30 C 5.5 35 M 15.5
30 C 5.5 35 C 15.5
31 M 7.5 38 M 17.5
31 C 7.5 38 M 17.5
32 C 9 45 M 19
33 C 11.5 47 M 20

Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 28
The Wilcoxon Rank Sum Test
Example continued:
Because the samples are the same size, n1 can be associated with
either sample. If we let n1 be the sample of the construction
workers, then R is the sum of the construction rankings.
R = 1 + 2 + 3 + 5.5 + 5.5 + 7.5 + 9 + 11.5 + 14 + 15.5
= 74.5

Using n1 = 10 and n2 = 10, we can find μR, andR.

n1 n1  n2  1 10 10  10  1
μR    105
2 2

n1n2 n1  n2  1 10  10 10  10  1


σR    13.23
12 12

Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 29
The Wilcoxon Rank Sum Test
Example continued:
When R = 74.5, μR = 105 andR = 13.23, the test statistic is

R  μR 74.5  105
z   2.31.
σR 13.23

Since 2.31 is less than the critical value of 1.645,


H0 is rejected.

There is enough evidence at the 10% level to reject the


claim that there is no difference in the salaries earned by
workers in the manufacturing and construction industries.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 30


§ 11.3
The Kruskal-Wallis
Test
The Kruskal-Wallis Test
The Kruskal-Wallis test is a nonparametric test that can
be used to determine whether three or more independent
samples were selected from populations having the same
distribution.
The null and alternative hypotheses for the Kruskal-Wallis
test are as follows.
H0: There is no difference in the distribution of the populations.
Ha: There is a difference in the distribution of the populations.

Two conditions for using the Kruskal-Wallis test are that


each sample must be randomly selected and the size of each
sample must be at least 5. If these conditions are met, the
test is approximated by a chi-square distribution with k – 1
degrees of freedom where k is the number of samples.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 32
The Kruskal-Wallis Test
Test Statistic for the Kruskal-Wallis Test
Given three or more independent samples, the test statistic
H for the Kruskal-Wallis test is
12  R12 R 22 R k2 
H     ...    3(N  1)
n
N (N  1)  1 n2 nk 

where
k represent the number of samples,
ni is the size of the ith sample,
N is the sum of the sample sizes,
and
Ri is the sum of the ranks of the ith sample.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 33


The Kruskal-Wallis Test
Performing a Kruskal-Wallis Test
In Words In Symbols
1. Identify the claim. State the State H0 and Ha.
null and alternative hypotheses.

2. Specify the level of significance. Identify .

3. Identify the degrees of freedom d.f. = k – 1

4. Determine the critical value and Use Table 6 in


the rejection region. Appendix B.

Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 34
The Kruskal-Wallis Test
Performing a Kruskal-Wallis Test
In Words In Symbols
5. Find the sum of the ranks for each
sample.
a. List the combined data in
ascending order.
b. Rank the combined data.
12
6. Calculate the test statistic. H  
N (N  1)
 R12 R 22 R k2 
 n  n  ...  n 
 1 2 k 

 3(N  1)
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 35
The Kruskal-Wallis Test
Performing a Kruskal-Wallis Test
In Words In Symbols
7. Make a decision to reject or fail to If H is in the
reject the null hypothesis. rejection region,
reject H0.
8. Interpret the decision in the
Otherwise, fail to
context of the original claim.
reject H0.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 36


The Kruskal-Wallis Test
Example:
An insurance agent want to determine whether there is a difference
in the annual premiums for home insurance in three states. He
randomly selects homes from each state and records the annual
premium for each state as shown below. At  = 0.05, can he
conclude that the distributions of the annul premiums are different?

State Annual Premium (in dollars)


New Jersey 441 420 474 411 371 470
New York 753 684 869 719 1036 613 663
Pennsylvania 653 405 380 484 383 382 387
H0: There is no difference in the premiums in the three states.
Ha: There is a difference in the premiums in the three states.
(Claim)
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 37
The Kruskal-Wallis Test
Example continued:
This is a right-tailed test with  = 0.05 and d.f. = k – 1 = 3 – 1 = 2.
From Table 6, the critical value is χ02 = 5.991.

Ordered Sample Rank Ordered Sample Rank


data data
371 NJ 1 474 NJ 11
380 PA 2 484 PA 12 The table
382 PA 3 613 NY 13 shows the
383 PA 4 653 PA 14 order and
387 PA 5 663 NY 15 rank of the
405 PA 6 684 NY 16 data.
411 NJ 7 719 NY 17
420 NJ 8 753 NY 18
441 NJ 9 869 NY 19
470 NJ 10 1036 NY 20
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 38
The Kruskal-Wallis Test
Example continued:
The sum of the ranks for each sample is as follows.
R1 = 1 + 7 + 8 + 9 + 10 + 11 = 46
R2 = 13+ 15 + 16 +17 + 18 + 19 + 20 = 118
R3 = 2 + 3 + 4 + 5 + 6 + 12 + 14 = 46
The test statistic is
12  R12 R 22 R32 
H     3(N  1)
N (N  1)  n1 n2 n3 
12  462 1182 462 
    3(20  1)
20(20  1)  6 7 7 
 12.55. Because 12.55 is greater than the critical
value of 5.991, reject H0.
There is enough evidence at the 5% level to support the claim
that the annual premiums are different in the three states.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 39
§ 11.4
Rank Correlation
The Spearman Rank Correlation Coefficient

The Spearman rank correlation coefficient rs is a measure


of the strength of the relationship between two variables.
The Spearman rank correlation coefficient is calculated
using the ranks of paired sample data entries. The
formula for the Spearman rank correlation coefficient is
6 d 2
rs  1 
n(n 2  1)
where
n is the number of paired data entries,
and
d is the difference between the ranks of a paired
data entry.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 41
The Spearman Rank Correlation Coefficient
The values of rs range from 1 to 1, inclusive. If the ranks
of corresponding data pairs are identical, rs is equal to +1.
If the ranks are in “reverse” order, rs is equal to 1. If
there is no relationship, rs is equal to 0.

To determine whether the correlation between variables is


significant, you can perform a hypothesis test for the
population correlation coefficient ρs.

The null and alternative hypotheses for this test are as


follows.
H0: ρs = 0 (There is no correlation between the variables.)
Ha: ρs  0 (There is a significant correlation between the
variables.)
Larson & Farber, Elementary Statistics: Picturing the World, 3e 42
The Spearman Rank Correlation Coefficient

Testing the Significance of the Correlation Coefficient


In Words In Symbols
1. State the null and alternative State H0 and Ha.
hypotheses.

2. Specify the level of significance. Identify .

3. Determine the critical value. Use Table 10 in


Appendix B.

Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 43
The Spearman Rank Correlation Coefficient

Testing the Significance of the Correlation Coefficient


In Words In Symbols
4. Find the test statistic.
6 d 2
rs  1 
n n2  1 
5. Make a decision to reject or fail If rs is greater than
to reject the null hypothesis. the critical value,
reject H0.
6. Interpret the decision in the
Otherwise, fail to
context of the original claim.
reject H0.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 44


The Spearman Rank Correlation Coefficient
Example:
A Consumer Report article claims that the price of a portable CD
player is related to its quality. To test this claim, you randomly
select 11 portable CD players and determine the overall score and
price of each. The overall score represents the error correction,
locate speed, battery life, and headphone quality of a CD player.
The results are in the table below. At  = 0.01, can you conclude
that there is a correlation between the overall score and the price?
(Adapted from Consumer Reports)
Overall Score Price (in dollars) Overall Score Price (in dollars)
82 150 60 150
78 100 58 80
68 120 57 200
67 140 55 80
61 145 49 75
60 100
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 45
The Spearman Rank Correlation Coefficient
Example continued:
H0: ρs = 0 (There is no correlation between score and price.)
Ha: ρs  0 (There is significant correlation between score and
price.) (Claim)
Overall Score Rank Price (in dollars) Rank d d2
82 11 150 9.5 1.5 2.25
78 10 100 4.5 5.5 30.25
68 9 120 6 3 9
67 8 140 7 1 1
61 7 145 8 -1 1
60 5.5 100 4.5 1 1
60 5.5 150 9.5 -4 16
58 4 80 2.5 1.5 2.25
57 3 200 11 -8 64
d 2  127
55 2 80 2.5 -0.5 0.25
49 1 75 1 0 0 Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 46
The Spearman Rank Correlation Coefficient
Example continued:
From Table 10 with  = 0.01 and n = 11, the critical value is 0.818.

When n = 11 and ∑d 2 = 127, the test statistic is


6  d 2  1  6(127)  0.423.
rs  1 

n n2  1  11 112  1  
Because 0.423 < 0.818, we fail to reject H0.

At the 1% level, there is not enough evidence to conclude that


there is a significant correlation between the overall score of a
CD player and its price.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 47


§ 11.5
The Runs Test
The Runs Test for Randomness
A run is a sequence of data having the same characteristic.
Each run is preceded by and followed by data with a
different characteristic or by no data at all. The number of
data in a run is called the length of the run.
Example:
The gender of babies born in a hospital in one month was
recorded in order of birth, where F represents a female and M
represents a male. Determine the number of runs and the length
of each run.
FFFMMFFMFMMMFFFMMMM
There are 8 runs.

Length FFF MM FF M F MMM FFF MMMM


of runs: 3 2 2 1 1 3 3 4

Larson & Farber, Elementary Statistics: Picturing the World, 3e 49


The Runs Test for Randomness
The runs test for randomness is a nonparametric test that
can be used to determine whether a sequence of sample
data is random.
Test Statistic for the Runs Test
When n1  20 and n2  20, the test statistic for the runs test
is G, the number of runs.

When n1 > 20 or n2 > 20, the test statistic for the runs test is
G  μG
z
σG
where
2n1n2 2n1n2(2n1n2  n1  n2 )
μG  +1 and σ G  .
n1  n2 2
(n1  n2 ) (n1  n2  1)

Larson & Farber, Elementary Statistics: Picturing the World, 3e 50


The Runs Test for Randomness
Performing a Runs Test for Randomness
In Words In Symbols
1. Identify the claim. State the State H0 and Ha.
null and alternative hypotheses.
2. Specify the level of significance. Identify .
(Use  = 0.05 for the runs test.)
3. Determine the number of data Determine n1, n2, and G.
that have each characteristic
and the number of runs.
If n1  20 and n2  20, use
4. Determine the critical value. Table 12. If n1 > 20 or n2
> 20, use Table 4.
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 51
The Runs Test for Randomness
Performing a Runs Test for Randomness
In Words In Symbols
5. Calculate the test statistic. If n1  20 and n2  20,
use G.
If n1 > 20 or n2 > 20, use
G  μG
z .
σG
6. Make a decision to reject or If G  the lower
fail to reject the null critical value, or if
hypothesis. G  the upper
critical value, reject
7. Interpret the decision in the
H0. Otherwise, fail
context of the original claim.
to reject H0.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 52


The Runs Test for Randomness
Example:
An English professor at Smithville College is usually late for
class. Students in his morning class record whether he is late (L)
or on time (T ) for class each day. The results are shown below. At
 = 0.05, can you conclude that the sequence is not random?
TTLTTLTTLTTLTTLTTLTTTTTT
LTTLTTLTTLTTLTLTTLTTTTTL
TTTTTLTTTL
H0: The sequence of arrivals is random.
Ha: The sequence of arrivals is not random. (Claim)
n1 = the number of Ts = 42 n2 = the number of Ls = 16
G = the number runs = 32
Because n1 > 20, use Table 4 to find the critical values of
z0 = 1.96 and z0 = 1.96. Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 53
The Runs Test for Randomness
Example continued:
Find the test statistic by first calculating μG and G.
2n n 2(42)(16)
μG  1 2  1   1  24.1724
n1  n2 42  16

2n1n2(2n1n2  n1  n2 ) 2(42)(16)[2(42)(16)  42  16)


σG  2  2
 3.002
(n1  n2 ) (n1  n2  1) (42  16) (42  16  1)

G  μG 32  24.1724
z   2.61
σG 3.0023
Because 2.61 > 1.96, reject H0.

At the 5% level, there is enough evidence to support the claim


that the sequence of arrivals is not random.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 54


The Runs Test for Randomness
Example:
Students in the English professor’s afternoon class also record
whether he is late (L) or on time (T ) for class each day. The
results are shown below. At  = 0.05, can you conclude that this
sequence is not random?
T T L T L L L L L T T T L L L
L L L L T L T L L L T L L L

H0: The sequence of arrivals is random.


Ha: The sequence of arrivals is not random. (Claim)
n1 = the number of Ts = 9 n2 = the number of Ls = 20
G = the number runs = 12

Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 55
The Runs Test for Randomness
Example continued:
Because n1  20 and n2  20, use Table 12 to find the lower
critical value 8 and the upper critical value 18.

The test statistic is the number of runs G = 12.

Because 12 is between the critical values of


8 and 18, we fail to reject H0.

At the 5% level, there is not enough evidence to support


the claim that the sequence of arrivals is not random.

Larson & Farber, Elementary Statistics: Picturing the World, 3e 56

Potrebbero piacerti anche