]>
Suppose that is a random sample from the Bernoulli distribution with unknown success parameter . Thus, these are independent random variables taking the values 1 and 0 with probabilities and respectively. Usually, this model arises in one of the following contexts:
In this section, we will construct hypothesis tests for the parameter . The parameter space for is the interval , and all hypotheses define subsets of this space. This section parallels the section on Estimation in the Bernoulli Model in the Chapter on Interval Estimation.
Recall that the number of successes
has the binomial distribution with parameters and and has mean and variance . Moreover, recall that is sufficient for . For , let denote the quantile of order for the binomial distribution with parameters and . Since the binomial distribution is discrete, only certain (exact) quantiles are possible.
Show that for any and , the following tests have significance level :
As usual, of the two-sided tests in part (a), the unbiased test with is most commonly used:
Reject versus if and only if or .
When is large, the distribution of is approximately normal, by the central limit theorem. Thus, an approximate normal test can be constructed using the test statistic
Note that is the standard score of if . As usual, for , let denote the quantile of order for the standard normal distribution. For selected values of , can be obtained from the last row of the table of the distribution, from the table of the standard normal distribution, from the quantile applet, or from most statistical software packages. Recall also by symmetry that
Show that for any and , the following tests have significance level :
As usual, of the two-sided tests in part (a), the unbiased test with is most commonly used:
Reject versus if and only if or
In the proportion test experiment, set , and select sample size 10, significance level 0.1, and . For each , run the experiment 1000 times, updating every 10 runs, and then note the relative frequency of rejecting the null hypothesis. Graph the empirical power function.
In the proportion test experiment, repeat the previous exercise with sample size 20.
In the proportion test experiment, set , and select sample size 15, significance level 0.05, and . For each , run the experiment 1000 times, updating every 10 runs, and then note the relative frequency of rejecting the null hypothesis. Graph the empirical power function.
In the proportion test experiment, repeat the previous exercise with sample size 30.
In the proportion test experiment, set , and select sample size 20, significance level 0.01, and . For each , run the experiment 1000 times, updating every 10 runs, and then note the relative frequency of rejecting the null hypothesis. Graph the empirical power function.
In the proportion test experiment, repeat the previous exercise with sample size 50.
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?
A coin is tossed 500 times and results in 302 heads. At the 0.05 level, test to see if the coin is unfair.
A sample of 400 memory chips from a production line are tested, and 32 are defective. At the 0.05 level, test to see if the proportion of defective chips is less than 0.1.
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.
Using the M&M data, test the following alternative hypotheses at the 0.1 significance level:
Suppose now that we have a basic random experiment with a real-valued random variable of interest. We assume that has a continuous distribution with support on an interval of . Let , and let denote quantile of order for the distribution of . Thus, by definition,
Suppose that is unknown and that we want to construct hypothesis tests for . For a given test value , let
Show that
As usual, we repeat the basic experiment times to generate a random sample of size from the distribution of . Let be the indicator variable of the event for .
Show that is a random sample of size from the Bernoulli distribution with parameter .
From Exercises 14 and 15, tests of the unknown quantile can be converted to tests of the Bernoulli parameter , and thus the tests developed in the previous subsections apply. This procedure is known as the sign test, because essentially, only the sign of is recorded for each . This procedure is also an example of a nonparametric test, because no assumptions about the distribution of are made (except for continuity). In particular, we do not need to assume that the distribution of belongs to a particular parametric family.
The most important special case of the sign test is the case where ; this is the sign test of the median. If the distribution of 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.
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 , run the simulation 1000 times, updating every 10 runs.
In the sign test experiment, set the sampling distribution to uniform on the interval . Set the sample size to 20 and the significance level to 0.05. For each of the 9 values of , run the simulation 1000 times, updating every 10 runs.
In the sign test experiment, set the sampling distribution to gamma with shape parameter 2 and scale parameter 1. Set the sample size to 30 and the significance level to 0.025. For each of the 9 values o , run the simulation 1000 times, updating every 10 runs.
Using the M&M data, test to see if the median weight exceeds 47.9 grams, at the 0.1 level.
Using Fisher's iris data, perform the following tests, at the 0.1 level: