Probability of a type II error

160 Views Asked by At

To test the hypothesis that the nonconforming proportion p of a process is .20, a sample of 100 pieces was drawn at random. A) Letting alpha = 0.05, set up a critical region for the number of observed defectives to test this hypothesis against a two-sided alternative B) If the process now shifts to a 0.10 fraction nonconforming, find the probability of a type II error for the alternative in part a. C) Without repeating the work, would you expect the probability of a type II error to be the same if the process shifted to 0.30? Explain

How do I answer b? I'm drawing a complete blank here so please have a descriptive answer, if you don't mind.

1

There are 1 best solutions below

6
On

I think it is intended that you use a normal approximation to the null binomial distribution $\mathsf{Binom}(n=100,p=.2).$

For a test with significance level $\alpha=0.5,$ you need to reject when the number $X$ of nonconforming pieces in $n = 100$ is $X$ is lower than $E(X) = 20$ and $X$ is higher than 20 in just the right way. Specifically, you want critical values $L$ and $U$ so that $P(X \le L) + P(X \ge U) \le 0.05,$ but coming as close to the target significance level $\alpha = 0.5$ as possible.

Using R [where qbinom is a binomial quantile function (inverse CDF)], we explore how to cut about probability $0.025$ from each tail of $\mathsf{Binom}(100,0.2):

qbinom(c(.025,.975), 100, .2)
[1] 12 28

This suggests using $L \approx 12, U\approx 28.$ Let's see if these values work, by summing the tail probabilities. [In R, dbinom is a binomial PDF.] A little experimentation suggests using critical values $L = 12, U = 29.$

sum(dbinom(c(0:12, 28:100), 100, .2))
[1] 0.05948038                        # over 5%
sum(dbinom(c(0:12, 29:100), 100, .2))
[1] 0.04534896                        # just under 5%

So we are actually testing at the level $\alpha = 4.53\%.$ Because of the discreteness of the binomial distribution it is not possible to choose lower and upper critical values for a test at exactly the 5% level. (A) The critical region is $R=\{X \le 12\}\cup\{X \ge 29\}.$

For (B), for the probability of Type II Error, you want $$P(\mathrm{Fail\; to\; rej\;} H_0| p = 0.1) = P(R^c | p = 0.1)\\ = P(13 \le X \le 28\,|\, p = 0.1) = 9.1982.$$

sum(dbinom(13:28, 100, .1))
[1] 9.1981788

For (C): The probability of Type II error for $p = 0.3$ is $0.3768.$

sum(dbinom(13:28, 100, .3))
[1] 0.3767595

If you use normal approximations, then it may seem as if you can bet a test at exactly the 5% level, but that is because the normal distribution is continuous. Even so answers from normal approximation should not be much different.

The figure below show the null (blue), part B alternative (maroon) and part C alternative (dark green) binomial distributions. The critical region consists of integers outside the vertical dotted lines.)

enter image description here

x = 0:50;  pdf.0 = dbinom(x, 100, .2)
hdr="Null (blue) and Alternative Distn's"
plot(x, pdf.0, type="h", lwd=3, col="blue", ylim=c(0,.13), main=hdr)
pdf.b = dbinom(x, 100, .1)
 lines(x-.12, pdf.b, type="h", lwd=2, col="maroon")
pdf.c = dbinom(x, 100, .3)
 lines(x+.12, pdf.c, type="h", lwd=2, col="darkgreen")
  abline(h=0, col = "green2")
  abline(v=c(12.5, 28.5), lwd=3, col="orange", lty="dotted")