A Z-test is a statistical hypothesis test in which the test statistic can be approximated by a normal distribution under the null hypothesis.
The name “Z-test” comes from the standard normal distribution, which is also known as Z-distribution.
We can use Z-test for proportion or population mean.
Key Assumptions
- The samples are independent
- The population standard deviation is known
- The population closely follows a normal distribution
The sample size also needs to be large enough (e.g.
One Sample Proportion Test
A proportion test determine if the proportion of a certain outcome in a sample differs significantly from an expected proportion. We can either use Binomial test, which is more accurate, especially for small sample size, or z-test (which is a normal approximation)
The test statistic is
where
is the sample size is the observed proportion is the null hypothesis proportion (i.e. when ) - The standard error is
, as the population standard deviation is computed by
Example: A random sample found 13,173 boys were born among 25,468 newborn children. The sample proportion of boys was 0.5172. Is this sample evidence that the birth of boys is more common than the birth of girls in the entire population?
Here, we want to test
The test statistics is We are performing a one-tailed test and
, so .
Based on the very small p-value, we can conclude that this example is an evidence that baby boys are more common than girls. 1
Z-Test for Mean
To perform a Z-test for a population mean, the population standard deviation must be known from a prior large-sample study. Unlike tests for proportions, it is impossible to calculate the population standard deviation directly. In practice, this information on population mean is often unavailable, and Student’s T-test is often a better alternative.
The test statistic is very similar to the test-statistic of the proportion test, though we need to know the population standard deviation:
where
is the observed sample mean is the expected population mean is the population standard deviation
See Also
- Binomial test is more accurate to test proportion for small sample sizes
- Student’s T-test is more appropriate for testing mean when the population standard deviation is not known or when the sample size is small
- problems of the p-value