The Essentials of Biostatistics for Physicians, Nurses, and Clinicians

(Ann) #1
20 CHAPTER 2 Sampling from Populations

We then use a table of uniform random numbers, or on the computer,
generate a uniform pseudorandom number. A computer pseudorandom
number generator is an algorithm that will generate a sequence of
numbers between 0 and 1 that have properties approximating those of
a sequence of independent uniform random numbers. To assign a
random index to the random number we generate, we do the following:
We fi rst break up the interval [0, 1) * into 15 disjointed (i.e., nonover-
lapping) intervals of equal length 1/15. So the intervals are [0, 1/15),
[1/15, 2/15) [2/15, 3/15),... , [14/15, 1). Let U denote the random
number selected by the table or the computer generated value. Then

I f 0 ≤ U < 0.0667, then the index is 1 (0.0667 is a decimal
approximation to 1/15).
If 0.0667 ≤ U < 0.1333, then the index is 2.
If 0.1333 ≤ U < 0.2000, then the index is 3.
If 0.2000 ≤ U < 0.2667, then the index is 4.
If 0.2667 ≤ U < 0.3333, then the index is 5.
If 0.3333 ≤ U < 0.4000, then the index is 6.
If 0.4000 ≤ U < 0.4667, then the index is 7.
If 0.4667 ≤ U < 0.5333, then the index is 8.
If 0.5333 ≤ U < 0.6000, then the index is 9.
If 0.6000 ≤ U < 0.6667, then the index is 10.
If 0.6667 ≤ U < 0.7333, then the index is 11
If 0.7333 ≤ U < 0.8000, then the index is 12.
If 0.8000 ≤ U < 0.8667, then the index is 13.
If 0.8667 ≤ U < 0.9333, then the index is 14.
If 0.9333 ≤ U < 1.0000, then the index is 15.

For example, suppose the computer generated the number 04017
corresponding to 0.4017. Since 0.4000 ≤ 0.4017 < 0.4667, the index is


* “ [0, 1) ” means all values x such that is greater than or equal to 0 but less than 1, “ (0, 1) ”
means all x greater than 0 but less than 1, “ (0, 1] ” means all x greater then 0 bur less than
or equal to 1, and “ [0,1] ” means all x greater than or equal to 0 but less than or equal to 1.
Free download pdf