Anda di halaman 1dari 26

ONE-SAMPLE RUNS TEST

FOR RANDOMNESS

LEARNING OUTCOME
After study this topic, student will be
able to decide whether a sequence of
events, items, or symbols is the result
of a random process.
HOW DOES ONE KNOW IF THE DATA OBTAINED
FROM A SAMPLE ARE TRULY RANDOM?
Procedures for investigating randomness are based on
the number and nature of the runs present in the data of
interest.
A run is a sequence of like events, items or symbols that
is preceded and followed by an event, item or symbol of
a different type, or by none at all.
We doubt the randomness of a series when there appear
to be either too many or too few runs.
We can use runs test to determine the randomness.
It helps us to decide whether a sequence of events, items,
or symbols is the result of a random process.

IS THIS RANDOM?
A researcher interviewing 10 people for a survey. Let the
genders be denoted by M for male and F for female.
Suppose the participants were chosen as follows :
Situation 1 :
M M M M M F F F F F F
Situation 2 :
F M F M F M F M F M
Situation 3 :
F F F M M F M M F F

ASSUMPTIONS
The data available for analysis consist of a sequence of
observations, recorded in the order of occurrence, which
we can categorize into two mutually exclusive types.
We let
n = the total sample size
n
1
= the number of observation of one type
n
2
= the number of observation of the other type
HYPOTHESES
A. TWO-SIDED
H
0
: The pattern of occurrences of the two types of
observation is determined by a random process.
H
1
: The pattern of occurrences is not random
B. ONE-SIDED
H
0
: The pattern of occurrences of the two types of
observation is determined by a random process.
H
1
: The pattern is not random (because there are too
few runs to be attributed to chances)
C. ONE-SIDED
H
0
: The pattern of occurrences of the two types of
observation is determined by a random process.
H
1
: The pattern is not random(because there are too
many runs to be attributed to chances)
TEST STATISTIC AND DECISION RULE
The test statistic is r , the total number of runs.
A. TWO-SIDED B. ONE-SIDED
( H
1
has few runs
)
C. ONE-SIDED
( H
1
has many
runs)
Reject H
0
:
r lower critical
value
OR
r upper critical
value
Reject H
0
:

r lower critical
value
Reject H
0
:

r upper critical
value
CRITICAL VALUE
Lower critical value can be determine from Table A.5
(Wayne W. Daniel, Applied nonparametric Statistics)
with n
1
and n
2
Upper critical value can be determine from Table A.6
(Wayne W. Daniel, Applied nonparametric Statistics)
with n
1
and n
2
OR
Both Lower and Upper critical value can be
determine from Table M (Bluman, Elementary
Statistics) with n
1
and n
2

EXAMPLE 1
On a commuter train, the conductor wishes to see whether the
passengers enter the train at random. He observes the first 25
people, with the following sequence of males(M) and females(F).

F F F M M F F F F M F M M M F F F F M M F F F M M

Test for randomness at = 0.05
SOLUTION
Step 1 : State the hypotheses and identify the claim
H
0
: The pattern of occurrences of males and females
enter the train is determine by a random process.(claim)
H
1
: The pattern of occurrences of males and females
enter the train is not random

Step 2 : Find the numbers of runs (test statistic).
FFF MM FFFF M F MMM FFFF MM FFF MM
Test statistic, r = 10
n
1
= the numbers of female = 15
n
2
= the numbers of male = 10
SOLUTION (CONT)
Step 3 : Find the critical value
n
1
= 15, n
2
= 10
Lower critical value = 7.
Upper critical value =18.

Step 4 : Make the decision
Since r = 10 which is between 7 and 18, do not reject H
0.

Step 5 : Make a conclusion
There is not enough evidence to reject the claim that the
pattern of occurrences of males and females enter the
train is determined by a random process.

EXAMPLE 2
20 people enrolled in a drug abuse program. Test the claim that
the ages of the people, according to the order in which they enroll,
occur at random, at = 0.05. The data as follows :

18, 36, 19, 22, 25, 44, 23, 27, 27, 35, 19, 43, 37, 32, 28, 43, 46, 19,
20, 22

SOLUTION
Step 1 : State the hypotheses and identify the claim
H
0
: The pattern of occurrences of ages of the people
enrolled in a drug abuse program is determined by a
random process. (claim)
H
1
: The pattern of occurrences of ages of the people
enrolled in a drug abuse program is not random.

SOLUTION (CONT)
STEP 2 : Find the number of runs (test statistic)
Find the median of the data. First, arrange the data in
ascending order.
18 19 19 19 20 22 22 23 25 27 27 28 32 35 36 37 43 43 44 46
Median is (27+27)/2 = 27.
Compare the original data with the median. Then, replace
each number in the original sequence with an A if it is
above the median and with B if it is below the median.
Eliminate any numbers that are equal to the median.
8 36 19 22 25 44 23 27 27 35 19 43 37 32 28 43 46 19 20 22
B A B B B A B A B A A A A A A B B B
Test statistic, r = 9 , n
1
= # of B = 9, n
2
= # of A = 9
SOLUTION (CONT)
Step 3 : Find the critical value
n
1
= 9, n
2
= 9
Lower critical value = 5.
Upper critical value =15.

Step 4 : Make the decision
Since r = 9 which is between 5 and 15, do not reject H
0.

Step 5 : Make a conclusion
There is not enough evidence to reject the claim that the
pattern of occurrences of ages of the people enrolled in a
program is determined by a random process.

EXAMPLE 3 (PG65)
Table in next page shows the departures from normal of daily
temperatures recorded at Atlanta, Georgia, during November
1974*. We wish to know whether we may conclude that the
pattern of departures above and below normal is the result of a
nonrandom process.
Departures from normal of daily temperatures recorded at Atlanta,
Georgia, during November, 1974.
*Local Climatological Data, U.S. Department of Commerce, National Oceanci
and Atmospheric Administration, Environmental Data Service, National Climatic
Center, Federal Buliding, Asheville, Notrh Caronlina, November 1974.
DATA
Day 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Departure
from normal
12 13 12 11 5 2 -1 2 -1 3 2 -6 -7 -7 -12
Day 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Departure
from normal
-9 6 7 10 6 1 1 3 7 -2 -6 -6 -5 -2 -1
SOLUTION
Step 1 : State the hypotheses and identify the claim
H
0
: The pattern of occurrences of negative and positive
departures from normal is determined by a random
process.
H
1
: The pattern of occurrences of negative and positive
departures from normal is not random.( claim )

Step 2 : Find the numbers of runs (test statistic).
Replace the positive departures with A and the negative
departures with B. So, the new data as follows :
AAAAAA B A B AA BBBBB AAAAAAAA BBBBBB
Test statistic, r = 8, n
1
= # of A = 17, n
2
= # of B =13
SOLUTION (CONT)
Step 3 : Find the critical value
n
1
= 17, n
2
= 13
Lower critical value = 10.
Upper critical value = 22.

Step 4 : Make the decision
Since r = 8 is less than lower critical value, reject H
0.


Step 5 : Make a conclusion
There is enough evidence to support the claim that the
pattern of occurrences of positive and negative
departures from normal is not random.

LARGE SAMPLE APPROXIMATION
Use when either n
1
or n
2
is greater than 20.
Compare the computed z with Table A.2.

( )
( ) ( ) 1
2 2
1
2
2 1
2
2 1
2 1 2 1 2 1
2 1
2 1
+ +

|
|
.
|

\
|
+
+

=
n n n n
n n n n n n
n n
n n
r
z
EXAMPLE 4
On a commuter train, the conductor wishes to see whether the
passengers enter the train at random. He observes the first 30
people, with the following sequence of males (M) and females
(F).

FFFF MM FFFF M F MM FFFFFF MM FFFFFF MM

Test for randomness at = 0.05
SOLUTION
Step 1 : State the hypotheses and identify the claim
H
0
: The pattern of occurrences of males and females
enter the train is determine by a random process.(claim)
H
1
: The pattern of occurrences of males and females
enter the train is not random

SOLUTION (CONT)
Step 2 : Find the numbers of runs and test value.
r = 10 , n
1
= 21, n
2
= 9
( )
( ) ( )
( )
( ) ( )
6036 . 1
1 9 21 9 21
9 21 ) 9 )( 21 ( 2 ) 9 )( 21 ( 2
1
9 21
) 9 )( 21 ( 2
10
1
2 2
1
2
2
2 1
2
2 1
2 1 2 1 2 1
2 1
2 1
=
+ +

|
.
|

\
|
+
+

=
+ +

|
|
.
|

\
|
+
+

=
z
z
n n n n
n n n n n n
n n
n n
r
z
SOLUTION (CONT)
Step 3 : Find the critical value
=0.05, z = 1.96, CV = 1.96

-1.6036
SOLUTION (CONT)
Step 4 : Make the decision
Since -1.6036 fall in the non-critical zone, do not reject
H
0.

Step 5 : Make a conclusion
There is not enough evidence to reject the claim that the
pattern of occurrences of males and females is determine
by a random process.


Q2
Q1
Q3

Anda mungkin juga menyukai