*52*

AÂ **one sample z-test** is used to test whether the mean of a population is less than, greater than, or equal to some specific value.

This test assumes that the population standard deviation is known.

This tutorial explains the following:

- The formula to perform a one sample z-test.
- The assumptions of a one sample z-test.
- An example of how to perform a one sample z-test.

Letâ€™s jump in!

**One Sample Z-Test: Formula**

A one sample z-test will always use one of the following null and alternative hypotheses:

**1. Two-Tailed Z-Test**

**H**Î¼ =Â Î¼_{0}:Â_{0}(population mean is equal to some hypothesized value Î¼_{0})**H**Î¼Â â‰ Î¼_{A}:_{0}(population mean is not equal to some hypothesized value Î¼_{0})

**2. Left-Tailed Z-Test**

**H**Î¼ â‰¥Â Î¼_{0}:Â_{0}(population mean is greater than or equal to some hypothesized value Î¼_{0})**H**Î¼ 0 (population mean is less than some hypothesized value Î¼_{A}:_{0})

**3. Right-Tailed Z-Test**

**H**Î¼ â‰¤ Î¼_{0}:Â_{0}(population mean is less than or equal to some hypothesized value Î¼_{0})**H**Î¼ > Î¼_{A}:_{0}(population mean is greaer than some hypothesized value Î¼_{0})

We use the following formula to calculate the z test statistic:

**z = (****x â€“ Î¼ _{0}) / (Ïƒ/âˆšn)**

where:

**x:**sample mean**Î¼**hypothesized population mean_{0}:**Ïƒ:**population standard deviation**n:Â**sample size

If the p-value that corresponds to the z test statistic is less than your chosen significance level (common choices are 0.10, 0.05, and 0.01) then you can reject the null hypothesis.

**One Sample Z-Test: Assumptions**

For the results of a one sample z-test to be valid, the following assumptions should be met:

- The data are continuous (not discrete).
- The data is a simple random sample from the population of interest.
- The data in the population is approximately normally distributed.
- The population standard deviation is known.

**One Sample Z-Test****: Example**

Suppose the IQ in a population is normally distributed with a mean of Î¼ = 100 and standard deviation of Ïƒ = 15.

A scientist wants to know if a new medication affects IQ levels, so she recruits 20 patients to use it for one month and records their IQ levels at the end of the month:

To test this, she will perform a one sample z-test at significance level Î± = 0.05 using the following steps:

**Step 1: Gather the sample data.**

SupposeÂ she collects a simple random sample with the following information:

**n**(sample size) = 20- Â
**x**(sample mean IQ) = 103.05

**Step 2: Define the hypotheses.**

She will perform the one sample z-test with the following hypotheses:

**H**Î¼ = 100_{0}:Â**H**Î¼ â‰ 100_{A}:Â

**Step 3: Calculate the z test statistic.**

The z test statistic is calculated as:

- z = (x â€“ Î¼) / (Ïƒâˆšn)
- z = (103.05 â€“ 100) / (15/âˆš20)
- z = 0.90933

**Step 4: Calculate the p-value of the z test statistic.**

According to the Z Score to P Value Calculator, the two-tailed p-value associated with z = 0.90933 is **0.36318**.

**Step 5: Draw a conclusion.**

Since the p-value (0.36318) is not less than the significance level (.05), the scientist will fail to reject the null hypothesis.

There is not sufficient evidence to say that the new medication significantly affects IQ level.

**Note:Â **You can also perform this entire one sample z-test by using the One Sample Z-Test Calculator.

**Additional Resources**

The following tutorials explain how to perform a one sample z-test using different statistical software:

How to Perform Z-Tests in Excel

How to Perform Z-Tests in R

How to Perform Z-Tests in Python