next up previous
Next: Mean of a single Up: Summary of Methods Previous: Summary of Methods

Proportions

Notation:
$\widehat{p}$ denotes a sample proportion from a sample randomly selected from the population.

\begin{displaymath}
z_\alpha = qnorm(1-\alpha).
\end{displaymath}

Confidence interval.

\begin{displaymath}
\widehat{p} \pm z_{\alpha/2}\sqrt{\widehat{p}(1-\widehat{p})/n}
\end{displaymath}

We can say that the probability this interval does not contain the true population proportion is approximately $\alpha$, so it gives a range of plausible values for the population proportion. However, confidence intervals should not be used to answer specific questions about a population proportion; use hypothesis tests instead.

Sample size for confidence intervals. Our goal is to obtain a confidence interval of the form

\begin{displaymath}
\widehat{p} \pm e.
\end{displaymath}

We have two cases:
1) with no prior bound on the population proportion

\begin{displaymath}
n = \left(\frac{z_{\alpha/2}}{2e}\right)^2;
\end{displaymath}

2) with prior bound $p_0$

\begin{displaymath}
n = p_0(1-p_0)\left(\frac{z_{\alpha/2}}{e}\right)^2.
\end{displaymath}

Hypothesis tests.

First step in hypothesis testing is to identify which hypothesis has the burden of proof. That hypothesis becomes the alternative hypothesis and the opposite is the null hypothesis. The level of significance must be specifed next. This represents what is considered to be an acceptably risk of making a Type I error.
Test statistic:

\begin{displaymath}
T = \frac{\widehat{p} - \pi_0}{\sqrt{\pi_0(1-\pi_0)/n}}
\end{displaymath}

where $\pi_0$ is the boundary between null and alternative hypotheses.

One-sided test:

\begin{eqnarray*}
H_0\!&:& \pi\le \pi_0\\
H_A\!&:& \pi > \pi_0
\end{eqnarray*}

pvalue is given by

\begin{displaymath}
{\rm pvalue} = 1 - pnorm(T).
\end{displaymath}

The pvalue represents the risk of making a Type I error if you reject the null hypothesis based on the this data. Make the decision to reject the null hypothesis if the pvalue is less than or equal to the level of significance of the test.

Power represents the probability a test will reject the null hypothesis if the population proportion is equal to a specific value. Note that

\begin{displaymath}
{\rm Power}(\pi_0) = \alpha,
\end{displaymath}

where $\alpha$ denotes the level of significance of the test. In general, first we must find the critical value of the test. For this one-sided test,

\begin{displaymath}
c = \pi_0 + z_\alpha\sqrt{\pi_0(1-\pi_0)/n}
\end{displaymath}

The power function is given by

\begin{displaymath}
{\rm Power}(\mu_1) = 1 - pnorm(c,\pi_1,\sqrt{\pi_1(1-\pi_1)/n}).
\end{displaymath}

One-sided test:

\begin{eqnarray*}
H_0\!&:& \pi\ge \pi_0\\
H_A\!&:& \pi < \pi_0
\end{eqnarray*}

pvalue is given by

\begin{displaymath}
{\rm pvalue} = pnorm(T).
\end{displaymath}

Reject null hypothesis if

\begin{displaymath}
{\rm pvalue} \le \alpha
\end{displaymath}

Critical value:

\begin{displaymath}
c = \pi_0 - z_\alpha\sqrt{\pi_0(1-\pi_0)/n}
\end{displaymath}

Reject null hypothesis if

\begin{displaymath}
\widehat{p} \le c
\end{displaymath}

Power:

\begin{displaymath}
{\rm Power}(\mu_1) = pnorm(c,\pi_1,\sqrt{\pi_1(1-\pi_1)/n}).
\end{displaymath}

Two-sided test:

\begin{eqnarray*}
H_0\!&:& \pi = \pi_0\\
H_A\!&:& \pi \ne \pi_0
\end{eqnarray*}

pvalue is given by

\begin{displaymath}
{\rm pvalue} = 2(1 - pnorm(abs(T))).
\end{displaymath}

Reject null hypothesis if

\begin{displaymath}
{\rm pvalue} \le \alpha
\end{displaymath}

Critical values:

\begin{eqnarray*}
c_l &=& \pi_0 - z_{\alpha/2}\sqrt{\pi_0(1-\pi_0)/n}\\
c_u &=& \pi_0 + z_{\alpha/2}\sqrt{\pi_0(1-\pi_0)/n}
\end{eqnarray*}

Reject null hypothesis if

\begin{displaymath}
\widehat{p} \le c_L\ {\rm or}\ \widehat{p} \ge c_U
\end{displaymath}

Power:

\begin{displaymath}
{\rm Power}(\pi_1) = 1 - pnorm(c_u,\pi_1,\sqrt{\pi_1(1-\pi_1)/n}) + pnorm(c_l,\pi_1,\sqrt{\pi_1(1-\pi_1)/n})
\end{displaymath}


next up previous
Next: Mean of a single Up: Summary of Methods Previous: Summary of Methods
ammann
2017-11-16