Estimating and testing proportions

So far, we have mostly relied on normality of observations or, at least approximately, on normality of the sample mean for large samples. However, there are cases in which we should be a bit more specific and devise approaches which are in tune with the kind of observations we are taking. Such a case occurs when dealing with a property that may or may not hold for each observed element of a population. In Example 9.6 we considered sampling a population and estimating the fraction of its members that enjoy a generic property. Conceptually, we are sampling a Bernoulli population with unknown parameter p. Letting Xi = 1 if observation i is “yes,” 0 otherwise, a natural estimator of p is

images

Since images has binomial distribution, we should use quantiles from the binomial distribution to build confidence intervals and to test hypotheses about p. This is not difficult, as these quantiles have been tabulated. However, if the sample is large enough, we may rely on the central limit theorem to conclude that

images

at least approximately. An alternative view is that, essentially, we are approximating a binomial distribution by a normal, but we are relating both its expected value and variance to parameters p and n; since n is known, we are relating two features to one unknown parameter, without losing sight of the structure of the binomial distribution. Then, for a large sample, we have

images

where z1−α/2 is the usual quantile of the standard normal. Note that the familiar drill for the normal distribution does not work in this case. The problem is that the unknown parameter p occurs in a complicated way, since it also gives variance. To find a confidence interval in the usual form, we should substitute images for p in the denominator of the ratio above. This yields the approximate confidence interval

images

This confidence interval looks much like the confidence interval for the mean of a normal population, with sample variance S2 substituted by images(l − images), which is an estimate of the variance of a Bernoulli random variable. This is so natural that one tends to forget that there are two approximations involved here. The first one has distributional nature and is justified by the central limit theorem; the second one relies on the estimate of variance of a Bernoulli random variable.

Using the same machinery, we may run hypothesis tests. A natural hypothesis that we may wish to test is

images

Under the null hypothesis, we may argue that the test statistic

images

has approximately standard normal distribution. We have to rely on the central limit theorem here, too; however, since we are plugging the number p0 from the null hypothesis, there is no other trouble. Clearly, we are inclined to reject H0 if the count of “yes” answers in the sample is too large, i.e., if

images

for a significance level α.

Example 9.20 According to process specifications, a certain machine should produce no more than 5% defective parts. Then, if we take a sample of 300 parts, the fraction of defective items should be something like 300 × 0.05 = 15. Now assume that, as a matter of fact, we observe 19 defective items. Is this finding compatible with the above percentage? We should test the null hypothesis

images

against the alternative hypothesis Hap > 0.05. Using the normal approximation, the test statistic (9.22) is

images

Comparing this value against the quantile z0.95 = 1.6449, we see that we cannot reject the null hypothesis at 5% significance level. If we use suitable software, we find that the quantile at 95% for the binomial distribution with parameters n = 300 and p = 0.05 is b = 21. So, we should observe at least 22 defective items to reject the null hypothesis. We may check the quality of the normal approximation by finding this threshold number with normal quantiles. Using (9.23) we find

images

which is compatible with the exact quantile of the binomial distribution.

The example suggests that the normal approximations works fairly well, but care must be exercised when dealing with small sample sizes and probabilities. We should stress that common wisdom suggests that a sample size should be at least 30 to use normal approximations, but this rule of thumb does not apply here as it disregards the impact of p. It is often suggested that the product np should be at least 20 to rely on the normal approximation.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *