Virtual Laboratories > Hypothesis Testing > 1 2 3 [4] 5 6 7
Suppose that I1, I2, ..., In is a random sample from the Bernoulli distribution with unknown parameter p in (0, 1). Thus, these are independent indicator variables taking the values 1 and 0 with probabilities p and 1 - p respectively. Usually, this model arises in one of the following contexts:
In this section, we will construct hypothesis tests for the parameter p. This section parallels the section on Estimation in the Bernoulli Model in the Chapter on Interval Estimation.
The parameter space is {p: 0 < p < 1}, and all hypotheses define subsets of this space. Recall that
N = I1 + I2 + ··· + In
has the binomial distribution with parameters n and p and has mean and variance given by
E(N) = np, var(N) = np(1 - p).
Moreover, N is sufficient for p, so it is natural to construct a test statistic from N. For r in (0, 1), let br(n, p) denote the quantile of order r for the binomial distribution with parameters n and p. Since the binomial distribution is discrete, only certain (exact) quantiles are possible.
1. Show that the
following tests have significance level r:
When n is large, the distribution of N is approximately normal, by the central limit theorem. Thus, an approximate normal test can be constructed using the test statistic
Z0 = (N - np0) / [np0(1 - p0)]1/2.
Note that Z0 is the standard score of N, under the null hypothesis. As usual, for r in (0, 1), let zr denote the quantile of order r for the standard normal distribution.
2. Show that if n
is large, the following tests have approximate significance level r:
3. In the
proportion test experiment, set H0: p = p0,
n = 10, significance level 0.1, and p0 = 0.5.
4.
In the
proportion test experiment, repeat the
previous exercise with n = 20.
5. In the
proportion test experiment, set H0: p
p0, n = 15, significance level
0.05, and p0 = 0.3.
6.
In the
proportion test experiment, repeat the
previous exercise with n = 30.
7. In the
proportion test experiment, set H0: p
p0, n = 20, significance level
0.01, and p0 = 0.6.
8.
In the
proportion test experiment, repeat the
previous exercise with n = 50.
Suppose now that we have a basic random experiment with a random variable X of interest. We assume that X has a continuous distribution. Let p0 be a specified number in (0, 1), and let m denote quantile of order p0 for the distribution of X. Thus, by definition,
p0 = P(X < m).
Suppose that m is unknown and that we want to construct hypothesis tests for m. For a given test value m0, let
p = P(X < m0).
9. Show that
As usual, we repeat the basic experiment n times to generate a random sample of size n from the distribution of X:
X1, X2, ..., Xn.
Let Ii be the indicator variable of the event {Xi < m0} for i = 1, 2, ..., n.
10. Show that I1,
I2, ..., In is a random sample of size n
from the Bernoulli distribution with parameter p.
From Exercises 9 and 10, tests of the unknown quantile m can be converted to tests of the Bernoulli parameter p, and thus the tests developed in the previous subsections apply. This procedure is known as the sign test, because essentially, only the sign of Xi - m0 is recorded for each i. This procedure is also an example of a nonparametric test, because no assumptions about the distribution of X are made (except for continuity). In particular, we do not need to assume that the distribution of X belongs to a particular parametric family.
The most important special case of the sign test is the case where p0 = 1/2; this is the sign test of the median. If the distribution of X is known to be symmetric, the median and the mean agree. In this case, sign tests of the median are also tests of the mean.
11. In the
sign test experiment, set the sampling distribution to normal with mean
0 and standard deviation 2. Set the sample size to 10 and the significance level to 0.1.
For each of the 9 values of m0, run the simulation 1000 times,
updating every 10 runs.
12. In the
sign test experiment, set the sampling distribution to uniform on the
interval [0, 5]. Set the sample size to 20 and the significance level to 0.05. For each of
the 9 values of m0, run the simulation 1000 times, updating every 10
runs.
13.
In the
sign test experiment, set the
sampling distribution to gamma with shape parameter a = 2 and scale parameter r
= 1 . Set the sample size to 30 and the significance level to 0.025. For each of the 9
values of m0, run the simulation 1000 times, updating every 10 runs.
14. In a pole of
1000 registered voters in a certain district, 427 prefer candidate X. At the 0.1 level, is
the evidence sufficient to conclude that more that 40% of the registered voters prefer X?
15. A coin is
tossed 500 times and results in 302 heads. At the 0.05 level, test to see if the coin is
unfair.
16. A sample of
400 memory chips from a production line are tested, and 30 are defective. At the 0.05
level, test to see if the proportion of defective chips is less than 0.1.
17. A new drug is
administered to 50 patients and the drug is effective in 42 cases. At the 0.1 level, test
to see if the success rate for the new drug is greater that 0.8.
18.
Using the M&M
data, test the following alternative
hypotheses at the 0.1 significance level:
19.
Using the M&M
data, test to see if the median weight
exceeds 47.9 grams, at the 0.1 level.
20.
Using Fisher's iris
data, perform the following tests, at
the 0.1 level: