The Proportion Estimation Experiment

Description

The experiment is to select a random sample of size \(n\) from the Bernoulli distribution with parameter \(p\), and then to construct an approximate confidence interval for \(p\) at a specified confidence level. The true value of \(p\) can be varied with a scrollbar. The probability density function of the Bernoulli distribution and the value of \(p\) are shown in the first graph. Three different estimations methods can be used:

  1. The Wilson confidence interval is based on the pivot variable \[Z = \frac{M - p}{\sqrt{p (1 - p) / n}}\] where \(M\) is the sample mean (the proportion of successes in the sample). This variable has an approximate standard normal distribution if \(n\) is large (relative to \(p\)).
  2. The simplified confidence interval is based on the pivot variable \[Z = \frac{M - p}{\sqrt{M (1 - M) / n}}\] obtained by replacing \(p\) with \(M\) in the denominator of (a).
  3. The conservative confidence interval is based on the pivot variable \(Z = 2 \sqrt{n} (M - p)\) obtained by replacing \(p (1 - p)\) with its maximum value \(1 / 4\) in (a).

The standard normal distribution is shown in the second graph. The confidence level can be varied with a scrollbar and the adjacent label shows the corresponding critical values of the standard normal distribution. The type of interval—two sided, upper bound, or lower bound can be selected with a list box. Random variables \(L\) and \(R\) denote the left and right endpoints of the confidence interval, and \(I\) indicates the event that the confidence interval contains \(p\).

On each run, the sample density function and the confidence interval are shown in the first graph, and the computed value of \(Z\) in the second graph. Note that the confidence interval contains \(p\) in the first graph if and only if \(Z\) falls between the critical values in the second graph.