$z$ test for a single proportion
This page offers all the basic information you need about the $z$ test for a single proportion. It is part of Statkat’s wiki module, containing similarly structured info pages for many different statistical methods. The info pages give information about null and alternative hypotheses, assumptions, test statistics and confidence intervals, how to find p values, SPSS howto’s and more.
To compare the $z$ test for a single proportion with other statistical methods, go to Statkat's or practice with the $z$ test for a single proportion at Statkat's
Contents
 1. When to use
 2. Null hypothesis
 3. Alternative hypothesis
 4. Assumptions
 5. Test statistic
 6. Sampling distribution
 7. Significant?
 8. Approximate $C\%$ confidence interval for $\pi$
 9. Equivalent to
 10. Example context
 11. SPSS
 12. Jamovi
When to use?
Deciding which statistical method to use to analyze your data can be a challenging task. Whether a statistical method is appropriate for your data is partly determined by the measurement level of your variables. The $z$ test for a single proportion requires one variable of the following type:
One categorical with 2 independent groups 
Note that theoretically, it is always possible to 'downgrade' the measurement level of a variable. For instance, a test that can be performed on a variable of ordinal measurement level can also be performed on a variable of interval measurement level, in which case the interval variable is downgraded to an ordinal variable. However, downgrading the measurement level of variables is generally a bad idea since it means you are throwing away important information in your data (an exception is the downgrade from ratio to interval level, which is generally irrelevant in data analysis).
If you are not sure which method you should use, you might like the assistance of our method selection tool or our method selection table.
Null hypothesis
The $z$ test for a single proportion tests the following null hypothesis (H_{0}):
H_{0}: $\pi = \pi_0$$\pi$ is the population proportion of 'successes'; $\pi_0$ is the population proportion of successes according to the null hypothesis
Alternative hypothesis
The $z$ test for a single proportion tests the above null hypothesis against the following alternative hypothesis (H_{1} or H_{a}):
H_{1} two sided: $\pi \neq \pi_0$H_{1} right sided: $\pi > \pi_0$
H_{1} left sided: $\pi < \pi_0$
Assumptions
Statistical tests always make assumptions about the sampling procedure that's been used to obtain the sample data. So called parametric tests also make assumptions about how data are distributed in the population. Nonparametric tests are more 'robust' and make no or less strict assumptions about population distributions, but are generally less powerful. Violation of assumptions may render the outcome of statistical tests useless, although violation of some assumptions (e.g. independence assumptions) are generally more problematic than violation of other assumptions (e.g. normality assumptions in combination with large samples).
The $z$ test for a single proportion makes the following 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
The $z$ test for a single proportion is based on the following 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, and $\pi_0$ is the population proportion of successes according to the null hypothesis.
Sampling distribution
Sampling distribution of $z$ if H_{0} were true:Approximately the standard normal distribution
Significant?
This is how you find out if your test result is significant:
Two sided: Check if $z$ observed in sample is at least as extreme as critical value $z^*$ or
 Find two sided $p$ value corresponding to observed $z$ and check if it is equal to or smaller than $\alpha$
 Check if $z$ observed in sample is equal to or larger than critical value $z^*$ or
 Find right sided $p$ value corresponding to observed $z$ and check if it is equal to or smaller than $\alpha$
 Check if $z$ observed in sample is equal to or smaller than critical value $z^*$ or
 Find left sided $p$ value corresponding to observed $z$ and check if it is equal to or smaller than $\alpha$
Approximate $C\%$ confidence interval for $\pi$
Regular (large sample):
$p \pm z^* \times \sqrt{\dfrac{p(1  p)}{N}}$
where the critical value $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)

$p_{plus} \pm z^* \times \sqrt{\dfrac{p_{plus}(1  p_{plus})}{N + 4}}$
where $p_{plus} = \dfrac{X + 2}{N + 4}$ and the critical value $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
The $z$ test for a single proportion is equivalent to:
 When testing two sided: goodness of fit test, with categorical variable with 2 levels
 When $N$ is large, the $p$ value from the $z$ test for a single proportion approaches the $p$ value from the binomial test for a single proportion. The $z$ test for a single proportion is just a large sample approximation of the binomial test for a single proportion.
Example context
The $z$ test for a single proportion could for instance be used to answer the question:
Is the proportion of smokers amongst office workers different from $\pi_0 = .2$? Use the normal approximation for the sampling distribution of the test statistic.SPSS
How to perform the $z$ test for a single proportion in SPSS:
Analyze > Nonparametric Tests > Legacy Dialogs > Binomial... Put your dichotomous variable in the box below Test Variable List
 Fill in the value for $\pi_0$ in the box next to Test Proportion
Jamovi
How to perform the $z$ test for a single proportion in jamovi:
Frequencies > 2 Outcomes  Binomial test Put your dichotomous variable in the white box at the right
 Fill in the value for $\pi_0$ in the box next to Test value
 Under Hypothesis, select your alternative hypothesis