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

How to Easily Perform a One Sample Z-Test: A Step-by-Step Guide

Introduction to the One Sample Z-Test

The one sample z-test is a fundamental statistical procedure utilized to determine if the mean of a single sample differs significantly from a known or hypothesized population mean. This test is crucial for drawing inferences about a large population based on data collected from a smaller, representative subset.

Specifically, the procedure assesses whether the observed discrepancy between the sample mean and the hypothesized population mean is large enough to be considered a statistically significant difference, rather than merely the result of random chance. A key requirement for employing the z-test is that the population standard deviation must be known.

Consider an scenario where we measure the average test scores of 100 students from a particular class and compare them against the established historical average (the population mean) for that specific course. The z-test provides the statistical rigor necessary to confirm if the sample of 100 students truly performs differently from the general population.


The one sample z-test is used to formally test whether the true mean of a population is either less than, greater than, or precisely equal to some predetermined specific value. Understanding this procedure involves mastering its formula, recognizing its necessary assumptions, and applying it through practical examples.

This comprehensive guide will detail the following core elements:

  • The fundamental formula required to calculate the z test statistic.
  • The critical assumptions that must be satisfied for the test results to be valid.
  • A detailed, step-by-step example illustrating how to execute a one sample z-test.

The Mathematical Framework: The One Sample Z-Test Formula

Before calculating the z-statistic, we must first establish the null and alternative hypotheses. The structure of these hypotheses depends entirely on the nature of the research question—specifically, whether we are testing for any difference (two-tailed), a decrease (left-tailed), or an increase (right-tailed).

1. Two-Tailed Z-Test (Testing for Difference)

A two-tailed test is used when the researcher is interested only in whether the population mean is different from the hypothesized value, regardless of direction.

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

2. Left-Tailed Z-Test (Testing for Decrease)

A left-tailed test is employed when the researcher hypothesizes that the true population mean is less than the specified value.

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

3. Right-Tailed Z-Test (Testing for Increase)

Conversely, a right-tailed test is used when the hypothesis suggests the true population mean is greater than the specified value.

  • H0: μ ≤ μ0 (The population mean is less than or equal to the hypothesized value μ0)
  • HA: μ > μ0 (The population mean is strictly greater than the hypothesized value μ0)

Once the hypotheses are defined, the core calculation involves the z test statistic formula. This formula measures how many standard errors the sample mean is away from the hypothesized population mean.

The formula used to calculate the z test statistic is:

z = (x̅ – μ0) / (σ/√n)

Where the variables represent the following components:

Essential Assumptions for Validity

The validity and reliability of the results obtained from a one sample z-test are contingent upon meeting several crucial statistical assumptions. Failure to meet these assumptions may lead to incorrect conclusions or require the use of alternative statistical methods.

The following conditions must generally be satisfied for the z-test results to be considered statistically sound:

  • The data collected must be continuous (interval or ratio scale data), not discrete or categorical.
  • The sample must be a simple random sample drawn accurately from the population of interest.
  • The data in the population must be approximately normally distributed, or the sample size (n) must be sufficiently large (typically n > 30) to rely on the Central Limit Theorem.
  • The population standard deviation (σ) must be known. If the population standard deviation is unknown, the appropriate test to use is the one sample t-test, which uses the sample standard deviation instead.

Practical Application: A Step-by-Step Example

To demonstrate the application of the one sample z-test, consider a study investigating the effect of a new medication on intelligence quotient (IQ) levels. It is a well-established fact that the standard IQ in the general population is normally distributed with a mean (μ) of 100 and a standard deviation (σ) of 15.

A scientist administers the new medication to 20 patients over one month and records their IQ scores afterward. She seeks to determine if the medication has caused a statistically significant difference in the average IQ of this group, using a significance level (α) of 0.05.

Step 1: Gather the Sample Data

The scientist collects a simple random sample and summarizes the following data:

  • n (Sample Size) = 20
  • (Observed Sample Mean IQ) = 103.05
  • μ (Known Population Mean IQ) = 100
  • σ (Known Population Standard Deviation) = 15

Step 2: Define the Hypotheses

Since the scientist wants to know if the medication “affects” IQ levels (i.e., causes a change in either direction), a two-tailed test is appropriate:

  • H0: μ = 100 (The medication has no effect; the mean IQ remains 100)
  • HA: μ ≠ 100 (The medication significantly changes the mean IQ)

Step 3: Calculate the Z Test Statistic

Using the defined formula, we substitute the values to compute the z test statistic:

  1. Formula: z = (x̅ – μ0) / (σ/√n)
  2. Substitution: z = (103.05 – 100) / (15/√20)
  3. Result: z ≈ 0.90933

Step 4: Determine the P-Value

The next crucial step involves determining the likelihood of observing a sample mean this extreme (or more extreme) if the null hypothesis were true. This likelihood is quantified by the p-value.

By consulting a standard Z-table or using statistical software, the two-tailed p-value associated with a calculated z-score of 0.90933 is found to be 0.36318.

Step 5: Draw a Conclusion

The final step requires comparing the calculated p-value to the predefined significance level (α = 0.05). The decision rule is: if p-value < α, we reject H0.

In this case, since the p-value (0.36318) is substantially larger than the significance level (0.05), the scientist must fail to reject the null hypothesis (H0).

Therefore, based on the statistical evidence gathered from the sample, there is not sufficient evidence at the α = 0.05 level to conclude that the new medication significantly affects the population’s IQ level. The observed increase (103.05 vs. 100) is likely due to sampling variability.

Note: While performing these calculations manually aids in understanding the underlying principles, researchers often use statistical software to compute the entire one sample z-test quickly and accurately.

Further Exploration and Software Implementation

Understanding the theoretical framework of the z-test allows for a deeper appreciation of inferential statistics. For practical application with large datasets, utilizing specialized statistical software is highly recommended.

The following tutorials explain how to perform a one sample z-test using different statistical software packages, simplifying the calculation steps detailed above:

 

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.

Cite this article

stats writer (2025). How to Easily Perform a One Sample Z-Test: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/one-sample-z-test-definition-formula-and-example/

stats writer. "How to Easily Perform a One Sample Z-Test: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 28 Nov. 2025, https://scales.arabpsychology.com/stats/one-sample-z-test-definition-formula-and-example/.

stats writer. "How to Easily Perform a One Sample Z-Test: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 2025. https://scales.arabpsychology.com/stats/one-sample-z-test-definition-formula-and-example/.

stats writer (2025) 'How to Easily Perform a One Sample Z-Test: A Step-by-Step Guide', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/one-sample-z-test-definition-formula-and-example/.

[1] stats writer, "How to Easily Perform a One Sample Z-Test: A Step-by-Step Guide," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, November, 2025.

stats writer. How to Easily Perform a One Sample Z-Test: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. 2025;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top