The one sample Z test is used to check whether the mean of a single population is equal to a particular value or not. The null hypothesis for our test is that the population mean is equal to the given value.

For example, suppose that we claim that the mean height of people of a given population is equal to 168cm. We will use the one sample Z test in order to test this hypothesis.

**Procedure to carry out the one sample Z test:**

- Formulate the null hypothesis as H_0: \mu=\mu_0.
- Depending on the situation formulate the alternative hypothesis H
_{1}as: \mu\neq \mu_0 \text{ (Two sided alternative hypothesis)} \mu\geq \mu_0 \text{ or }\mu\leq \mu_0 \text{ (One sided alternative hypothesis)} - Decide the level of significance \alpha for the test. We usually take \alpha = 5\%
- Calculate the value of the test statistic using the formula, \text{ Test Statistic Z} = \frac{|\bar{x}-\mu_0|}{\sigma/\sqrt{n}}
- Find the Z table value – Z_\alpha for one sided test and Z_{\alpha/2} for two sided test.
- If the value of the test statistic exceeds the table value we reject the null hypothesis and accept the alternative hypothesis.
- If the value of the test statistic is less than the table value we accept the null hypothesis and conclude that the population mean is equal to \mu_0

**Example of a one sample Z test:**

It is claimed that the mean height of people of a given population is equal to 168cm. If we draw a sample of size 100, the average height of people in the sample is 171cm with a standard deviation of 3cm. Test whether the mean height of the population is greater than 168cm or not at a 5% level of significance.

** Solution**: We have the null hypothesis H_0: \mu=168 vs alternative hypothesis H_1: \mu\geq 168

Given \bar{x}=171cm , \bar{\mu_0}=168cm, n=100, \sigma=3cm

We calculate the value of the test statistic using the above formula,

\text{ Test Statistic Z} = \frac{|171- 168|}{3/\sqrt{100}} = 10And, Z table value = Z_{α} = Z_{0.05} = 1.64 (Since the alternative hypothesis is one sided)

Since the test statistic is greater than the table value we reject the null hypothesis and conclude that the mean height of the population is greater than 168cm.

**One sample Z test using software:**

- We can carry out the one sample Z test in excel using the Z.TEST function in excel.
- We can also carry out the Z test in R software by using the z.test command.