You are on page 1of 28
Yr oe) SOME TESTS BASED ON THE ‘BINOMIAL DISTRIBUTION PRELIMINARY REMARKS ‘The binomial probability distribution was introduced in Chapter 1 to describe the probabilities associated with the number of heads when a coin is tossed n times, In its more general form each of m independent trials results either in “success,” with probability p, or “failure,” with probability q = 1 ~ p. The binomial distribution describes the probability of obtaining exactly k successes. Table A3 presents some of the binomial distribution functions. Many experimental situations in the applied sciences may be modeled this way. Several customers enter a store and independently decide to buy or not to buy a particular product. Several animals are given a certain medicine and either they are cured or not cured. Examples can be found in almost any field. Data obtained in these situations may be analyzed using some of the simplest statistical methods known, those based on the binomial distribution. In this chapter we present a few of the available methods. The literature abounds with other procedures based on the binomial distribution. After studying the variety of tests presented in this chapter, the reader should be | able to invent variations to match a given experimental situation. * Review Problems for Chapter 3 are included in the Review Problems for Chapter 4 123 124 3 ‘SOME TESTS BASED ON THE BINOMIAL DISTRIBUTION, THE BINOMIAL TEST AND ESTIMATION OF p (One example of the binomial test has already been presented. In Example 2.3.1 the binomial test was applied to a quality control problem. This entire chapter (Chapter 3) is little more than an elaboration of Example 2.3.1, showing the many uses and amazing versatility of that simple little binomial test. With a little ingenuity the binomial test may be adapted to test almost any hypothesis, with almost any type of data amenable to statistical analysis. In some situations the binomial test is the most powerful test; in those situations the test is claimed by both parametric and nonparametric statistics. In other situations more powerful tests are available, and the binomial test is claimed only by nonparametric statis- tics. However, even in situations where more powerful tests are available, the binomial test is sometimes preferred because it is usually simple to perform, simple to explain, and sometimes powerful enough to reject the null hypothesis when it should be rejected. We will now formally present the binomial test and, at the same time, introduce the format for presenting tests. We feel that there is a need for some format in presenting tests both for the convenience of the reader and for ready review by the users of nonparametric techniques. D> The Binomial Test Data The sample consists of the outcomes of n independent trials. Each outcome is in either “class 1” or “class 2,”" but not both. The number of observations in class 1 is O, and the number of observations in class 2 is O; = 1 ~ O ‘Assumptions 1. The n trials are mutually independent. 2. Each trial has probability p of resulting in the outcome “class 1,” where p is the same for all n trials. ‘Test Statistic Since we are concerned with the probability of the outcome “class 1," we will let the test statistic T be the number of times the outcome is “class 1.” That is, T=0; a Null Distribution Let p* be the probability specified in the null hypothesis. The null distribution of T is the binomial distribution with parameters p = p* and n = the sample size. The null distribution of T is tabulated in Table A3 for n = 20 and selected values of p. | | i 3.1 THE BINOMIAL TEST AND ESTIMATION OF p 125 For other values of and p the normal approximation is used. That is, approximate quantiles x, for T are given by sn-p+ag Vir O-P) 2 where 2, is the qth quantile of a standard normal random variable, given in Table Al Hypotheses Let p* be some specified probability, 0 = p* < 1. The hypotheses may take one of the following three forms. A, (Two-Tailed Test) Hop =p Hyp # p* The rejection region of desired size a corresponds to the two tails of the null distribution of T, where the size of the lower tail is denoted by a, approximately half of a, and the size of the upper tail is denoted by a, also approximately half of a. The true level of significance is a + 2, which is seldom a nice round number due to the discrete nature of T. That is, from Table A3 for the particular values p* and n, find the number & such that P(Ysh)=ar ° and find the number fy such that P(Ysh)=1-a2 ® where Y is a binomial random variable with parameters p* and n. If m is greater than 20 use the normal approximation. That is, use Equation 2 to approximate t,, the a/2 quantile, and fy, the (1 - a/2) quantile, of a binomial random variable with parameters p” and 1, by letting q = a/2 and q = 1 ~ a/2 respectively. Reject Hp if Tis less than or equal to hor if Tis greater than fy. Otherwise accept the null hypothesis. The p-value is twice the smaller of the probabilities that Y is less than or equal to the observed value of T, or greater than or equal to the observed 126 SOME TESTS BASED ON THE BINOMIAL DISTRIBUTION value of T, which are found from Table A3 for 1 = 20, using p = p*, or from Table Al for n > 20, using fn p05) Va pr =p") Porstay=P(z ® PUY = tees) ©) which incorporates 0.5 as a “correction for continuity” that improves the normal approximation to the binomial. B, (Lower-Tailed Test) Hop =p* Hyp 20, using Porta.)

p* 3.1 THE BINOMIAL TEST AND ESTIMATION OF p 127 Because large values of T indicate Ho is false, the rejection region of size « corresponds to all values of T greater than f, where f is obtained from Table A3, using p* and n, so that P(Ys)= ® where Y is a binomial random variable with parameters p* and 1. If m is greater than 20 use the normal approximation. That is, use Equation 2 to approximate f, the (1 ~ a) quantile of a binomial random variable with parameters p* and m, by letting q = 1 — a Reject Hy if T is greater than 1. Otherwise accept the null hypothesis. The p-value is the probability that Y is greater than or equal to the observed value of T, which is found from Table A3 for n = 20, using p = p*, or from Table Al for n > 20, using veretayer-o(ee 0 Vir ) which incorporates 0.5 as a “correction for continuity” that improves the normal approximation to the binomial. Computer Assistance Computer packages that will perform this test include Minitab, S-Plus, and StatXact, which finds exact p-values. Minitab also finds the power, and the sample size required to achieve a given level of power. 4 EXAMPLE I Itis estimated that at least half of the men who currently undergo an operation to remove prostate cancer suffer from a particular undesirable side effect. In an effort to reduce the likelihood of this side effect the FDA studied a new method of performing the operation. Out of 19 operations only 3 men suffered the unpleas- ant side effect. Is it safe to conclude the new method of operating is effective in reducing the side effect? Let p equal the probability of the patient experiencing the side effect. Then this is a lower-tailed test of Fh: p = 0.5 versus Hy: p < 0.5. If the target a is 0.05, the critical region consists of T = 5, with an actual a = 0.0318. (See Table A3, n= 19, p = 05.) The observed value of T is 3, so Hp is rejected, and it is concluded the new operation is effective in reducing the likelihood of the side effect. The p-value is PCT =3) = 0.0022 which is quite small, indicating that the sample data are in strong disagreement with the null hypothesis. a 128 SOME TESTS BASED ON THE BINOMIAL DISTRIBUTION ‘One should always use exact methods when exact methods are available, but to illustrate how well the normal approximation works, consider Example 1. ‘The approximate 0.05 quantile is found from Equation 2, qqs = 19(05) + (1.6449) VIBOSVOS) resulting in the same rejection region as before. The exact a is estimated from, Equation 5. P58) which is close to the exact a, 0.082, The exact p-value is also estimated from i Equation 5 ; 3=19005) 403 pyrs3=r(z= ors) ( Vin(05\05) ) ‘Again, this is close to the exact p-value, 0.002. EXAMPLE 2 Under simple Mendelian inheritance a cross between plants of two particular genotypes may be expected to produce progeny one-fourth of which are “dwarf” and three-fourths of which are “tall.” In an experiment to determine if the assump- tion of simple Mendelian inheritance is reasonable in a certain situation, a cross results in progeny having 243 dwarf plants and 682 tall plants. If “class 1” denotes “all,” then p® = 3/4 and T equals the number of tall plants. The null hypothesis of simple Mendelian inheritance is equivalent under the model to the hypothesis Hyp =3/4 ‘The alternative of interest is two-sided, Hyp 3/4 Since m = 925, (243 + 682), the critical region of approximate size a = 0.05 may bbe obtained using the large sample approximation given by Equation 2. Thus the critical region corresponds to all values of T less than or equal to f1, where t= mp" + Zonas Vip PD) (925) + (-1.960) VOZVNOD = 667.94 a 3.1 THE BINOMIAL TEST AND ESTIMATION OF p 129 and all values of T greater than f, where t= np + zosys Vap™ =p) = (025)() + (1.960) VOZIHH 19.56 (12) The value of T obtained is 682 in this experiment. Therefore the null hypothesis is accepted. The p-value may be found from Equation 5. nvaeaya (z= 0.8542) = 0.196 a3) where Z has the standard normal distribution as given in Table Al. This one- tailed p-value is doubled to find the two-tailed p-value 0.392. A level of significance of at least 0.392 would be required to reject Hy. Thus the data are in good agreement with the null hypothesis. a The previous example illustrates the two-tailed form of the binomial test. ‘The one-tailed binomial test was also illustrated in Example 2.3.1 OTheory That the test statistic in the binomial test has a binomial distribution is easily seen by comparing the assumptions in the binomial test with the assump- tions in Examples 13.5 and 1.2.8. That is, if T equals the number of trials that result in the outcome “class 1,” where the trials are mutually independent and where each trial has probability p of resulting in that outcome (as stated by the assumptions), then T has the binomial distribution with parameters p and 1. The size of the critical region is a maximum when p equals p*, under the null hypothe- sis, and so Table A3 is entered with m and p* to determine the exact value of ao As mentioned earlier, hypothesis testing is only one branch of statistical inference. We will now discuss another branch, interval estimation. If we are at- tempting to make some inferences regarding an unknown parameter associated with some population, it is reasonable to examine a random sample from that population and, on the basis of that sample, to make some statement regarding the population parameter. Such a statement might be “the population parameter lies between @ and b,” where @ and b are two real numbers obtained from the sample. The numbers a and b are computed from the sample and are therefore realizations of two statistics. The two statistics that furnish us with the lower and upper boundary points for the interval will be denoted by L and U, respectively, for “lower” and “upper.” The interval from L to U is called the interoal estimator. ‘The probability that the unknown population parameter lies within its interval estimate is called the confidence coeficient. The interval estimator together with the confidence coefficient provide us with the confidence interval. 130 SOME TESTS BASED ON THE BINOMIAL DISTRIBUTION ‘A method for finding a confidence interval for p, the unknown probability of any particular event occurring, is closely related to the binomial test. > Confidence Interval for a Probal ity or Population Proportion _ Data A sample consisting of observations on 1 independent trials is examined, and the number Y of times the specified event occurs is noted. Assumptions 1. The n trials are mutually independent. 2, The probability p of the specified event occurring remains constant from cone trial to the next. Method A For 1 less than or equal to 30, and confidence coefficients of 0.90, 095, or 0.99, use Table Ad. Simply enter the table with sample size n and the observed Y. Reading across gives the exact lower and upper bounds in the columns for the desired confidence interval. Method B For 1 greater than 30, or confidence coefficients not covered in Table Ad, use the normal approximation. tan an Vien ay) and tear V¥(n= YJ a5) where 2;-4/2 is the quantile of a normally distributed random variable, obtained from Table A1. The confidence coefficient is approximately 1 ~ a Computer Assistance Computer packages that find confidence intervals for the binomial parameter p, or population proportion p, include Minitab, S-Plus, CEN E?2 fy Spsssaaaseansansnadasssalesasiaiasesanssansssasensnsasnessasana”) For the sake of illustration, both methods of computing confidence intervals are used in the following example. EXAMPLE 3 In a certain state 20 high schools were selected at random to see if they met the standards of excellence proposed by a national committee on education. It was found that 7 schools did qualify and accordingly were designated “excellent.” 3.1 THE BINOMIAL TEST AND ESTIMATION OF p 131 What is a 95% confidence interval for p, the proportion of all high schools in the state that would qualify for the designation “excellent”? First, we assume that the number of high schools in the state is large enough $0 the high schools are classified “excellent” or “not excellent” independently of one another. Because we assumed the selection was random, p is the same for all schools and represents the probability ofa randomly selected school being designated “ex- cellent.” Because 1 equals 20 and Y equals 7, Table A4 can be used. The exact 95% confidence interval is given in Table A4 as the interval from 0.154 to 0.592, ‘Method B, the use of the normal approximation based on the central limit theorem, gives ~2s8 V¥(n~Y)/ 0.35 ~ (1.960) VIS) / De 0.35 ~ 0.209 oat a6) and an The confidence interval furnished by the normal approximation is from 0.141 to 0.559, which is close to the exact confidence interval, but still different enough to show the clear advantage of using exact intervals when they are available. a OTheory For the exact Method A just described, the confidence interval con- sists of all values of p* such that the data obtained in the sample would result in acceptance of Hyp =p" if one were using the two-tailed binomial test. More precisely, if we want to form a (I ~ a) confidence interval, we observe the sample and determine Y. Then we ask, “For the given value of Y, which values may we use for p* in the hypothesis, Hyp =p" such that a two-tailed binomial test (at level a) would result in acceptance of H?”” Those values of p* would be in our confidence interval. The values of p* that ‘would result in rejection of Hy would not be in the confidence interval. Since each tail of the binomial test has probability «/2, the value of L is selected as the value 132 SOME TESTS BASED ON THE BINOMIAL DISTRIBUTION, of p* that would barely result in rejection of Hs, for the given value of Y, say y, ora larger value. Thus p;* is selected so that Peylp " &((ose—nor" 7 and then L = p;*. Next, another value of p* is selected so the same value y is barely in the lower tail. That is, p:* is selected so Porsylp=ps)=$= (‘Jove py as) and we set U = p,*. Equations 18 and 19 are impossible to solve algebraicaily, ‘They were solved using a search procedure on a computer to obtain Table Ad. ‘More information on confidence intervals for the binomial parameter p may be found in Clopper and Pearson (1934). ‘The large sample approximations for Land Umay be obtained by considering Example 15.6, which states that if Y is a binomially distributed random variable with parameters p and large n, then Y-mp 2° 9) is a random variable whose distribution may be approximated by the standard normal distribution. Then, if z,-. is the (1 — /2) quantile from Table Al, and because 24/2 = —Zi-sy2, We have a=P (-.0 < Xo <0) 7 Toney 1p < 1-0/2 V9) Multiplication by (~1) reverses the sense of the inequalities 1 = @= Pei-ey2 Ving > np ~ ¥ > —21-a2V0p) and reversal of the reading order gives 1 = = P(-21-4/2 Vip 0.3, and 3 successes are observed in 25 independent trials. Twenty Texas Tech law school graduates took the bar exam and 18 of them passed. If this represents a random sample of all Texas Tech law school graduates, is this proof that the probability of a Texas Tech law school graduate passing the law exam is higher than the state average, which is 70%? ‘Twenty torpedoes are released in an underwater war exercise, Fifteen of them it thei target. Find a 90% confidence interval for the probability of a torpedo hitting the target. (@) Use Table A4 to solve this problem, (b) Use the large sample approximation to solve this problem. (6) Discuss the assumptions you are making in this problem. Seventy chemical detection kits of one type are placed in a gas chamber together, for a fixed period of time, and a measured amount ofa lethal gas is introduced into the chamber. Fifty-six kits register positive for the lethal gas, while the other 14 fail to register positive Find a 90% confidence interval for the probability of registering positive under these conditions. 3.2 m & a I 3.2, THE QUANTILE TEST AND ESTIMATION OF 1 135 proBLEMS Eo The continuity correction. It is obvious that if Y has a binomial distribution, then POY =A) = POY 34.1) = ++ = PCY = 4.999) because Y takes on only integer values, such as 4 oF 5, but no values between integers. ‘Therefore, which number should be used in the normal approximation to the binomial distribution: 4, of 4.1, or what? The continuity correction (because we are trying to use a ‘continuous distribution such as the normal to approximate a discrete distribution such as the binomial) says to use the number midway between two adjacent values in the discrete distribution. That is, in the binomial distribution estimate P(Y = 4), with 4405- 2) Vege where Z has a normal distribution, because 4.5 is halfway between 4 and 5. Usually the continuity correction works well when using the normal distribution to approximate binomial probabilities. (a) For n = 20, p = 0.1 find the exact value of P(Y = 1) from Table A3, Use the normal approximation to estimate P(Y = 1), first without the continuity correction and then with the continuity correction, Which estimate is closer? (b) Repeat part a, but change from p = 0.1 to p = 0:3. Now which estimate is closer? 2. Let Y; and Y; be independent binomial random variables with parameters 1 and p, and nn, and pz, respectively. (a) Show that Y;/im ~ Yo/ has mean py ~ ps : (b) Show that ¥i/m, ~ Yo/m has variance ps(l ~ py)/m, + ps(l — ps)/1. ©) Justify the use of Yi(m ~ Ys)/m? + Yn; ~ Y.)/1m? as an estimate of the variance of Ya/m — Ya/ ma. (@) If ¥:/14 — Y/m is approximately normal, show how an approximate 1 ~ @ confidence interval for (p; ~ p2) is given by NY rorsome(es Nn_v ~ Fan 20 or values of p* not covered by Table A3, use Equation 1 to aiaby letting q = a/2and q = 1 ~ «/2, respectively, ‘The p-value is twice the smaller of the probabilities that a binomial random variable Y is less than or equal to the observed value of T,, or greater than or equal to the observed value of Tz, which are found from Table A3 for n = 20, using p = p, or from Table Al for n > 20, using rary en(zuBaseeots) 7 Vn pp") and 6 pore nye -p(zs3=E a0) Va =P which incorporates 0.5 as a “correction for continuity” that improves the normal approximation to the binomial. B. (Lower-Tailed Test) Ho: The p* population quantile is no greater than x* [Or Ho: P(X = x*) = p*] Hy: The p* population quantile is greater than x* [Or Hi: P(X = x4) 20 let q = ain Equation 1 to find f, = x. i 3.2 THE QUANTILE TEST AND ESTIMATION OF x, 139 The p-value is the probability that a binomial random variable Y is less than or equal to the observed value of T,, which is found from Table A3 for n = 20, using p = p*, or from Table Al for n > 20, using Equation 4. . (Upper-Tailed Test) ‘Hy: The p*th population quantile is at least as great as x* [This is equivalent to Hy: P(X < x*) < p*] Hy: The p*th population quantiles less than x* [This is the same as Hy: P(X < x*) > p*] Since large values of T; indicate that Ha is false, enter Table A3 with the sample size n and the hypothesized p* as p. Find the number !; such that PU>h)aa which is the same as P(sh)= ~a ” for some acceptable level of significance a, Then reject Ho if T; exceeds ‘Accept Hy if Tz is less than or equal to f,. For n> 20 let q = 1 — ain Equation 1 to find hy = Xj... ‘The p-value is the probability that a binomial random variable Y is greater than or equal to the observed value of Ts, which is found from Table A3 for n 20, using p = p*, or from Table Al for m > 20, using Equation 5. Computer Assistance Minitab tests the null hypothesis when p = 1/2 under the name Median Test. 4 EXAMPLE I Entering college freshmen have taken a particular high school achievement exami- nation for many years, and the upper quartile is well established at a score of 198. A particular high school sends 15 of its graduates to college, where they take the exam and get the following scores 189 233195 16022 176 231 «18519923 202-193 17k 16688, 140 SOME TESTS BASED ON THE BINOMIAL DISTRIBUTION, It is assumed that these 15 students represent 2 random sample of all students from that high school who go on to college. One way of comparing college students from that high school with other college students is by testing the hypothesis that the above scores come from a population whose upper quartile is 193. That is, Ho: The upper quartile is 193 is tested against the alternative Hi: The upper quartile is not 193 where we are referring to the upper quartile ofthe test scores ofall college students from that high school, past, present, or future, ‘The two-tailed quantile test is applied. A critical region of approximate size 005 is obtained by entering Table A3 with = 15 and p = 0.75. There it is seen that, for the binomial random variable Y, POY =7) = 0.0173 8) and P(Y = 14) = 0.9866 © The critical region of size = 00173 + 0.0134 = 0.0307 (1) corresponds to values of T; less than or equal to fy = 7, and values of T; greater than f= 14. In this example 7, = 7, the number of observations less than or equal to 193, and T = 6, since one observation exactly equals 193. Therefore T; is too small, and Hp is rejected. The upper quartile for students from that high school does not seem to be 193, The p-value is 2 - P(Y = 7) = 2(0.0173) = 0.0346. B ‘The one-tailed quantile test, with the large sample approximation, is illus- trated in the following example. EXAMPLE 2 The time interval between eruptions of Old Faithful geyser is recorded 112 times to see whether the median interval is less than or equal to 60 minutes (cull hypothesis) or whether the median interval is greater than 60 minutes (alter- native hypothesis). If the median interval is 60, 60 is Xx, or the median, If the median interval is less than 60, 60 is a p quantile for some p = 0.50. Thus Ho's P(X = 60) = 0.50, and Fh is P(X = 60) < 0.50, where X is the time interval between eruptions, Assuming that the various intervals are independent and identically distributed, the lower-tailed quantile test may be used. The test statistic T; equals 3.2. THE QUANTILE TEST AND ESTIMATION OF x, 41 the number of intervals that are less than or equal to 60 minutes, and the critical region of size 0.05 corresponds to values of T; less than or equal to fy = np* + 2005 Va" =P) = (112)(0.50) ~ (1.645) VTI2O50}(OSO) =473 ay Of the 112 time intervals, 8 are 60 minutes or less, so T; = 8, and Hy is soundly rejected in favor of the alternative “the median time interval between eruptions is greater than 60 minutes.” The p-value is found using Equation 4. rors e)ap[z<8 GOs +05 =PZ=-8977 Tes | a eee which is read “much less than 0.0001.” 5 Theory First we will explain why the hypotheses within the parentheses in A, B, and C are equivalent to the hypotheses not in parentheses. Perhaps this is most easily seen by referring to the graph of an arbitrary distribution function, as in Figure 1. The distribution function at x* may be in one of three phases: it may be rising vertically, as at x; it may be in a horizontal segment, as at xj or it may be rising gradually, as at x3. Hy in the second set of hypotheses (set B) states that the p*th population quantile (x) is no greater than x*, of % 5 x*, Because every value of x* is some sort of a quantile, we can say that x* is the pth quantile for some p, say py. (We are temporarily ignoring our convention of choosing only the midpoint of the horizontal segments as the quantile and adhering directly to the definition of quantile.) Because the graph of the distribution function never descends as x gets larger, x, = x* implies that p* = po, which may be seen by imaging x* as being in each of the three phases typified by x, %, and x; in Figure 1. Any value of x, to the left of ieee eee HEE ae 3 FIGURE | lan SOME TESTS BASED ON THE BINOMIAL DISTRIBUTION x* implies that the ordinate p* at x,. is no greater than the ordinate py of x*, From the definition of quantile, Definition 1.4.1, P(X>a*)=1-po (13) which is the same as post P(X> 24) (Xx) ay Since p* < po, this implies pis P(xsx4) as) which is the equivalent form of Hp in set B of hypotheses. The negation of Hy is H,, and the negation of Equation 15 is p> Pik sx") 6) as stated in the alternative hypotheses. The same reasoning is used to show the other hypotheses to be equivalent. Briefly, Figure 1 is used to visualize that x,, = xp (Hp in C) implies that po = p*. If x* = x,, then by Definition 1.4.1, P(X Confidence Interval for a Quantile Data The data consist of observations on X,, X,. . . , X,, whichare independent and identically distributed random variables. X" = X® = =xXos s Xs +++ =X represents the ordered sample, where 1 = r ap) =1-p* @ where the distribution function of X is the same as that of the random sample. The order statistic of rank 1, X", will assume a value larger than some specified constant only if the smallest value in the sample is larger than the constant, Therefore X"is greater than the constant only ifall n values in the sample are greater than the constant. Choosing 2, as the constant, we may conclude Play (") (rya- With the aid of the binomial distribution function given by Equation 13.8, the preceding argument may be extended as follows. Ply < X") = Platleast n — r + 1 of the X,exceed xp) = P(r— Lor fewer ofthe Xiare $2) = S(t) wya-py ey The confidence coefficient is given by 1 = PK 5 ye 5X) = Play SX) — Pla ay) S1—p* 9) / f | } | | PE zy) B1—p* (40) First we will consider how Equation 39 affects Equation 34 and, therefore, our method for finding r in Equation 37. Because Equation 39 is true, the probability of each observation exceeding x, may be smaller than it was when X was continuous, Therefore there may be less of a tendency for each of the order statistics to exceed, | xp than was formerly the case. That is, the probability P(x». < X") may be smaller than it was in the continuous case, which was then given by Equation 34. So, in general, the following holds true instead of Equation 34. et Ply Tolerance Limits Data The data consist of a random sample X;, %,.. . ,X, from a large popula- tion. Choose a confidence coefficient 1 — a and a pair of positive integers 7 and m, Bither we wish to determine the required sample size n after selecting a desired population proportion q (see Method A), or we wish to determine the population

You might also like