Numeric Forest logo
One-Sample Z-Test Calculator
Input type
Alternative Hypothesis (H1)
Significance Level (α)
Decimal Places:
Clear Reset

Introduction

In hypothesis-testing scenarios where population variability is known, the one-sample z-test provides a precise framework for inference. This calculator determines whether a significant difference exists between a sample mean x¯ and a hypothesised population mean μ. It is essential for researchers conducting parametric analysis when the population standard deviation σ is known, enabling accurate hypothesis testing across a range of academic disciplines.

What this calculator does

The calculator processes either raw numerical datasets or summary statistics, including the sample mean, known population standard deviation, and sample size n. It computes the standard error, the z-statistic, and the associated p-value. Users can specify significance levels α and select between left-tailed, right-tailed, or two-tailed alternative hypotheses to generate a formal decision on the null hypothesis.

Formula used

The primary calculation determines the z-statistic by dividing the difference between the sample mean x¯ and the hypothesised mean μ by the standard error σx¯. The standard error is derived from the known population standard deviation σ and the square root of the sample size n.

z=x¯-μσ/n
SE=σn

How to use this calculator

1. Select the input type by choosing either raw data or summary statistics.
2. Enter the sample values or provide the sample mean, population standard deviation, and sample size.
3. Define the hypothesised mean, significance level, and the direction of the alternative hypothesis.
4. Execute the calculation to view the z-statistic, p-value, and confidence interval.

Example calculation

Scenario: A researcher in environmental science analyses the pH levels of a local water source to determine if the mean differs from a standardised neutral value.

Inputs: Sample mean x¯=7.2, hypothesised mean μ=7.0, population standard deviation σ=0.5, and sample size n=100.

Working:

Step 1: SE=σ/n

Step 2: SE=0.5/100

Step 3: SE=0.05

Step 4: z=(7.2-7.0)/0.05=4.0

Result: z = 4.00

Interpretation: The calculated z-statistic of 4.00 indicates the sample mean is four standard errors above the hypothesised mean.

Summary: This result leads to a rejection of the null hypothesis at standard significance levels.

Understanding the result

The z-statistic indicates how many standard errors the sample mean deviates from the hypothesised mean. A p-value lower than the chosen significance level α suggests that the observed data is statistically significant, leading to the rejection of the null hypothesis in favour of the alternative hypothesis.

Assumptions and limitations

This test assumes that the population standard deviation is known and that the data follows a normal distribution. For smaller sample sizes, the normality of the underlying population is a critical requirement for valid results.

Common mistakes to avoid

A frequent error is applying this test when the population standard deviation is unknown, in which case a t-test is more appropriate. Additionally, misidentifying the tail type can lead to incorrect p-values and flawed conclusions regarding the null hypothesis.

Sensitivity and robustness

The z-test is highly sensitive to the sample size; as n increases, the standard error decreases, making the test more likely to detect small differences. Large outliers in a small raw dataset can significantly skew the sample mean and the resulting z-statistic.

Troubleshooting

If the result displays an error, ensure that the population standard deviation is a positive value and that the sample size exceeds one. Verify that raw data entries are numeric and separated correctly by commas to ensure accurate processing.

Frequently asked questions

When should I use a z-test instead of a t-test?

A z-test is appropriate when the population standard deviation is known and the sample size is typically large.

What does the confidence interval represent?

It provides a range of values within which the true population mean is expected to fall with a specific level of probability.

Can this calculator handle negative values?

Yes, the calculator accepts negative values for both the raw data and the hypothesised mean as long as they are within the supported numeric range.

Where this calculation is used

This statistical method is widely utilised in academic research to validate experimental results against known population parameters. In social research, it helps compare regional survey means against national averages. In sports analysis, researchers use it to determine if a specific group's performance metrics deviate significantly from established historical standards. It is also a fundamental component of probability theory and introductory statistics curricula, helping students grasp the relationship between standard normal distributions and hypothesis testing.

Results are based on standard mathematical and statistical methods and may involve rounding or approximation. If precise accuracy is required, please verify results independently. See full disclaimer.