1-Sample Z Test (known population σ)

When the population σ is already known - for example the long-term standard deviation of a process - check with a Z test whether the sample mean differs from the target (μ0). The result is shown on 5 panels - results table, confidence interval of the mean, dot plot, histogram and Z rejection region - each with its own interpretation.

1Data Table

Paste a table copied from Excel into a cell (Ctrl+V). Click a column header (A, B…) before pasting to use the first line as column names. Double-click a header to rename it, right-click to insert/delete rows and columns, and formulas such as =A1*2 work too.

21-Sample Z Test Options

How to run a 1-sample Z test

  1. Copy the measurement column to test together with the header and paste it into the sheet.
  2. Select the measurement column and enter the reference mean (μ0) and the known population standard deviation (σ, greater than 0). Change the alternative hypothesis and confidence level if needed.
  3. Press Analyze and check the Z statistic, p-value and decision in the results table and the interpretation of each chart.

Worked example with sample data

The sample data are the fill weights of 25 bottles taken from a filling line (497.5 to 505.6 g). The target is 500 g, and the standard deviation σ = 2 g known from the long-term process record is used (loading the sample fills in μ0=500 and σ=2).

Z rejection region chart from the 1-sample Z test of 25 fill weights (observed Z = 2.880)
Z rejection region chart from the 1-sample Z test of 25 fill weights (observed Z = 2.880)

The sample mean is 501.152 g, 1.152 g above the target. The standard error is σ/√n = 2/5 = 0.4, so Z = 1.152 / 0.4 = 2.88, and the two-sided p-value of 0.003977 is below 0.05, giving 'Significant (reject H0)'.

The 95% confidence interval of the mean is 500.4 to 501.9 g and does not contain the 500 g target. In the Z rejection region chart, the observed Z (2.880, blue line) also falls inside the red rejection region on the right (Z > 1.96).

Overfilling by about 1 g turns into material loss at high volumes, so adjust the filler setting and take a new sample to confirm. The sample standard deviation of these 25 bottles is 2.324 g, a little above the assumed σ (2 g), so it is worth checking whether σ still fits the current process.

How it is calculated

Z = (sample mean - μ0) / (σ/√n), and the p-value comes from the standard normal distribution (two-sided 2×(1-Φ(|Z|)), one-sided the tail in that direction). The confidence interval is the sample mean ± z·σ/√n; with a one-sided test the interval is one-sided with one end at ±∞.

Z test vs t test

If σ has to be estimated from the sample, use the 1-sample t test instead. The Z test is only for cases where σ is reliably known, such as a long process history or a specification. Because a known σ uses the thinner-tailed normal distribution, the p-value is slightly smaller than a t test on the same data.

Result panels

The results table, mean and confidence interval (with the reference line), dot plot, histogram with a normal fit and Z rejection region appear in turn. In the rejection region chart, the null hypothesis is rejected when the blue vertical line (observed Z) falls inside the red shaded area.

How to read the Z test result

  • A p-value below the significance level (1 - confidence level, 0.05 by default) gives 'Significant (reject H0)': the sample mean is statistically different from the reference.
  • If the confidence interval does not contain the reference, the difference can be considered significant. It is the same conclusion as the table, but you can see the size of the difference on the chart.
  • 'Not significant' does not prove the mean equals the reference - it means there is not enough evidence of a difference. With a small sample a real difference can be missed.

Frequently asked questions

What if the population standard deviation is unknown?

Use the 1-sample t test. It estimates σ from the sample standard deviation and uses the t distribution.

When should I use a one-sided test?

When only one direction matters, such as 'greater than the target'. Choosing μ > reference or μ < reference makes the p-value and confidence interval one-sided.

Is it the same as Excel's Z.TEST?

Excel's Z.TEST(range, μ0, σ) returns the one-sided p-value for the μ > μ0 direction. Choose 'μ > reference' here to get the same value.

Other chart tools