how to perform One Sample Z-Test: Definition, Formula, and Example?

A one sample z-test is a statistical procedure that is used to test the mean of a single sample against a known population mean. This procedure is used to determine if there is a statistically significant difference between the sample mean and the population mean. The formula used for a one sample z-test is z = (x – µ) / (σ/√n), where x is the sample mean, µ is the population mean, σ is the population standard deviation, and n is the sample size. An example of this procedure would be to take a sample of 100 students and compare their average test scores for a certain class to the population average for that class.


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

  • H0μ = μ0 (population mean is equal to some hypothesized value μ0)
  • HA: μ ≠ μ0 (population mean is not equal to some hypothesized value μ0)

2. Left-Tailed Z-Test

  • H0μ ≥ μ0 (population mean is greater than or equal to some hypothesized value μ0)
  • HA: μ < μ0 (population mean is less than some hypothesized value μ0)

3. Right-Tailed Z-Test

  • H0μ ≤ μ0 (population mean is less than or equal to some hypothesized value μ0)
  • HA: μ > μ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
  • μ0: hypothesized population mean
  • σ: population standard deviation
  • n: sample size

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 from the population of interest.
  • The data in the population is approximately .
  • 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:

  • H0μ = 100
  • HAμ ≠ 100

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 , 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 .

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

 

x