# z test for a single proportion: overview

This page offers structured overviews of one or more selected methods. Add additional methods for comparisons by clicking on the dropdown button in the right-hand column. To practice with a specific method click the button at the bottom row of the table

$z$ test for a single proportion
Independent variable
None
Dependent variable
One categorical with 2 independent groups
Null hypothesis
$\pi = \pi_0$
$\pi$ is the population proportion of "successes"; $\pi_0$ is the population proportion of successes according to H0
Alternative hypothesis
Two sided: $\pi \neq \pi_0$
Right sided: $\pi > \pi_0$
Left sided: $\pi < \pi_0$
Assumptions
• Sample size is large enough for $z$ to be approximately normally distributed. Rule of thumb:
• Significance test: $N \times \pi_0$ and $N \times (1 - \pi_0)$ are each larger than 10
• Regular (large sample) 90%, 95%, or 99% confidence interval: number of successes and number of failures in sample are each 15 or more
• Plus four 90%, 95%, or 99% confidence interval: total sample size is 10 or more
• Sample is a simple random sample from the population. That is, observations are independent of one another
Test statistic
$z = \dfrac{p - \pi_0}{\sqrt{\dfrac{\pi_0(1 - \pi_0)}{N}}}$
$p$ is the sample proportion of successes: $\dfrac{X}{N}$, $N$ is the sample size
Sampling distribution of $z$ if H0 were true
Approximately standard normal
Significant?
Two sided:
Right sided:
Left sided:
Approximate $C\%$ confidence interval for $\pi$
Regular (large sample):
• $p \pm z^* \times \sqrt{\dfrac{p(1 - p)}{N}}$
where $z^*$ is the value under the normal curve with the area $C / 100$ between $-z^*$ and $z^*$ (e.g. $z^*$ = 1.96 for a 95% confidence interval)
With plus four method:
• $p_{plus} \pm z^* \times \sqrt{\dfrac{p_{plus}(1 - p_{plus})}{N + 4}}$
where $p_{plus} = \dfrac{X + 2}{N + 4}$ and $z^*$ is the value under the normal curve with the area $C / 100$ between $-z^*$ and $z^*$ (e.g. $z^*$ = 1.96 for a 95% confidence interval)
Equivalent to
When testing two sided: goodness of fit test, with categorical variable with 2 levels
Example context
Is the proportion smokers amongst office workers different from $\pi_0 = .2$? Use the normal approximation for the sampling distribution of the test statistic.
Pratice questions