Perform a one-sample Z-test for population mean when population standard deviation (σ) is known. Compute z-score, exact p-value, and visualize the test statistic on the standard normal distribution. Now with tabbed input: manual summary statistics or raw data (supports tab, comma, space, newline, semicolon).
The Z-test is a parametric hypothesis test used to determine whether the mean of a population differs from a hypothesized value when the population variance (or standard deviation) is known. It relies on the central limit theorem, assuming the sampling distribution of the sample mean is approximately normal. This calculator performs a one-sample Z-test, providing the z-statistic, p-value, and visual feedback on the standard normal curve.
Z = (x̄ - μ₀) / (σ / √n)
Where x̄ is the sample mean, μ₀ is the hypothesized population mean, σ is the known population standard deviation, and n is the sample size.
A pharmaceutical company tests a new antihypertensive drug. Historical data shows that the population mean systolic blood pressure (SBP) in untreated adults is 130 mmHg (σ = 12 mmHg). In a randomized sample of 40 patients treated with the drug, the mean SBP is 125 mmHg. Using a one-tailed Z-test (H₁: μ < 130, α = 0.01):
Z = (125-130) / (12/√40) = -5 / 1.897 ≈ -2.636. P-value = Φ(-2.636) ≈ 0.0042. Since p < 0.01, we reject H₀ and conclude the drug significantly reduces blood pressure. The effect size Cohen's d = -5/12 = -0.417 (small-to-moderate). This interactive curve shades the left tail, helping visualize the critical region.
A factory produces metal rods that should have a mean length of 200 mm (known σ = 4 mm). A quality inspector measures a random sample of 40 rods and computes a sample mean of 202 mm. Using our Z-test: H₀: μ = 200, H₁: μ ≠ 200, α = 0.05. The Z-score = (202-200)/(4/√40) ≈ 3.162, p-value ≈ 0.0016. Since p < 0.05, we reject H₀ and conclude the rods are significantly longer than specification. This interactive graph illustrates the extreme z-score far in the tail.
The p-value is calculated using the cumulative distribution function (CDF) of the standard normal distribution, Φ(z). For two-tailed tests, p = 2·(1 - Φ(|z|)). For right-tailed, p = 1 - Φ(z); for left-tailed, p = Φ(z). Our implementation uses a high-precision approximation of the error function (Abramowitz & Stegun, 1964) ensuring accuracy to 1e-7. The shaded region on the normal curve visualizes the rejection area consistent with the p-value, helping researchers intuitively understand tail probability.