Statistics Lesson 27 – Z-Tests | Dataplexa

One-Sample Z Tests for Means

So far, we have learned the concepts behind hypothesis testing, including null and alternative hypotheses and possible errors.

Now we move from concepts to actual statistical testing. The one-sample Z test is one of the simplest and most important hypothesis tests.


What Is a One-Sample Z Test?

A one-sample Z test is used to determine whether the mean of a population is significantly different from a known or claimed value.

It compares:

  • The sample mean
  • The population mean (claimed value)

This test is used when the population standard deviation is known and the sample size is sufficiently large.


When Can We Use a Z Test?

A one-sample Z test is appropriate when:

  • The population standard deviation is known
  • The sample size is large (usually n ≥ 30)
  • The sample is randomly selected

If these conditions are not met, other tests (like the t-test) are more appropriate.


Setting Up the Hypotheses

Before performing the test, we clearly define the hypotheses.

Hypothesis Meaning
H₀ (Null) Population mean equals the claimed value
H₁ (Alternative) Population mean differs from the claimed value

Depending on the problem, the alternative hypothesis can be:

  • Two-tailed (≠)
  • Left-tailed (<)
  • Right-tailed (>)

The Z Test Statistic

The Z test statistic measures how far the sample mean is from the population mean, in standard deviation units.

The formula is:

Z = ( x̄ − μ ) ÷ ( σ / √n )

  • x̄ = sample mean
  • μ = population mean (claimed)
  • σ = population standard deviation
  • n = sample size

Deep Numerical Example (Step-by-Step)

A company claims that the average weight of its product is 500 grams.

A random sample of 36 products is taken.

  • Sample mean (x̄) = 492 grams
  • Population standard deviation (σ) = 12 grams
  • Significance level (α) = 0.05

Step 1: State the Hypotheses

H₀: μ = 500
H₁: μ ≠ 500


Step 2: Calculate the Z Value

First calculate the standard error:

σ / √n = 12 / √36 = 12 / 6 = 2

Now calculate Z:

Z = (492 − 500) ÷ 2 = −8 ÷ 2 = −4


Step 3: Determine the Critical Value

For a two-tailed test at α = 0.05:

  • Critical Z values = ±1.96

Step 4: Make the Decision

The calculated Z value is −4.

Since −4 lies beyond −1.96, it falls in the rejection region.

Decision: Reject the null hypothesis


Interpretation in Plain English

There is strong statistical evidence that the average product weight is different from 500 grams.

The company’s claim is not supported by the data.


Using the P-Value Approach

Instead of critical values, we can use the p-value.

The p-value represents the probability of observing a result as extreme as the sample, assuming H₀ is true.

Decision rule:

  • If p-value ≤ α → Reject H₀
  • If p-value > α → Fail to reject H₀

Common Mistakes to Avoid

  • Using a Z test when σ is unknown
  • Confusing sample mean with population mean
  • Ignoring test direction (one-tailed vs two-tailed)
  • Claiming H₀ is proven true

Quick Check

When do we reject the null hypothesis using the Z-value method?


Practice Quiz

Question 1:
What happens if |Z| < critical value?


Question 2:
What does the Z statistic measure?


Question 3:
Is a Z test valid for small samples when σ is known?


Mini Practice

A factory claims its average daily output is 200 units.

  • x̄ = 195
  • σ = 10
  • n = 25
  • α = 0.05

Perform a one-sample Z test and decide whether to reject H₀.


What’s Next

In the next lesson, we will study One-Sample Tests for Proportions, which apply similar logic to percentages instead of means.