Advertisement
Hypothesis Testing

One Sample Z Test Calculator

Use this one sample z test calculator to test a claim about a population mean when the population standard deviation is known. Enter summary data or raw data, choose the alternative hypothesis, and get the z statistic, p-value, critical value, and a complete 6-step hypothesis testing solution.

The alternative hypothesis determines whether the test is two-tailed, right-tailed, or left-tailed.
This value is used in H₀: μ = μ₀.
Use summary data when you already know x̄ and n. Use raw data when you want the calculator to find x̄ and n from the data values.
Separate values with commas, spaces, or new lines. The calculator will find x̄ and n from the raw data.

Required. A one sample z test needs the known population standard deviation.
Enter α as a decimal. For example, use 0.05 for 5%.
Important: This calculator should be used only when the population standard deviation, σ, is known. If σ is unknown, use a one sample t test instead.

Step-by-Step Solution

How to Use the One-Sample Z-Test Calculator

This calculator helps you conduct a one-sample z-test either using summary or raw data. Therefore, if you only have the summary statistics data and want to quickly perform the one-sample z-test, follow these steps:

  1. Select the alternative hypothesis (H1) and enter the hypothesized population mean (μ0)
  2. Select the Summary Data Option
  3. Enter summary data values (the sample mean (x̄) and Sample size (n))
  4. Enter the known population standard deviation (σ) and the significance level (α)
  5. Click calculate

However, if you have the raw sample data and a known population standard deviation (σ), follow these steps:

  1. Select the alternative hypothesis (H1) and enter the hypothesized population mean (μ0)
  2. Select the Raw Data Option
  3. Enter the raw data values. You can copy and paste values directly from Excel, Google Sheets, or text documents. The raw data input field also accepts values separated using commas, spaces, tabs, or line breaks.
  4. Enter the known population standard deviation (σ) and the significance level (α)
  5. Click calculate

In each case, the calculator will instantly return the z-test statistic, p-value, and z-critical value for your test. It will also provide a clear, step-by-step solution that shows you how to apply the 6 steps of hypothesis testing.

What Is a One-Sample Z-Test?

A one-sample z test is a hypothesis test used to compare a sample mean with a hypothesized population mean when the population standard deviation (σ) is known.

In summary, you should only use a one-sample z-test if the following conditions are met:

  • Population standard deviation (σ) is known
  • Large sample size (n > 30). In this case, the Central Limit Theorem ensures the sampling distribution is normal, even if the underlying population is not.
  • The data are normally distributed, and the population standard deviation is known. This means that you can still use a one-sample z-test even for smaller sample sizes (n ≤ 30) as long as the underlying population is strictly normally distributed with a known population standard deviation.

However, if the population standard deviation is unknown, use the one-sample t-test calculator instead.

One-Sample Z-Test Formula

The one-sample z-test statistic formula is:

one-sample z-test statistic formula

Where:

  • x̄ is the sample mean
  • μ₀ is the hypothesized population mean
  • σ is the known population standard deviation
  • n is the sample size

The denominator, σ / √n, is called the standard error. It measures how much the sample mean is expected to vary from sample to sample. To quickly find this value, you can use the standard error calculator.

How to do a One-Sample z-test

To perform a one-sample z-test manually, follow the 6 steps of hypothesis testing, which include:

  1. State the hypothesis
  2. State the significance level
  3. Compute the test statistic
  4. Find the p-value/critical value
  5. Make Decision
  6. State the conclusion

Example

Scenario: An energy drink company claims its bottles have an average volume of 500 ml. Historical data shows the population standard deviation is σ = 5 ml. You suspect the true average is different. You randomly sample 36 bottles and find a sample mean of x̄ = 498 ml. Is the company’s claim correct at a 5% significance level (α = 0.05)?

Solution

Since the population standard deviation is known and we want to test whether the sample mean is different from the claimed population mean, the appropriate test is a one-sample z-test.

To perform the test by hand, follow these steps:

Step 1: State the hypotheses

We want to test whether the average volume is different from 500 ml. Thus, this is a two-tailed test.

The correct hypotheses for the test are:

H₀: μ = 500

H₁: μ ≠ 500

Step 2: State the significance level

From the question, the significance level is α = 0.05

Step 3: Calculate the test statistic

By definition, the one-sample z-test statistic formula is: z = (x̄-μ₀)/(σ/√n)

From the question, we know that:

  • x̄ = 498
  • μ₀ = 500
  • σ = 5
  • n = 36

Substituting the values into the formula, we have:

z = (498-500)/(5/√36)

= -2/0.8333

= -2.40

Thus, the test statistic is: z = -2.40

Step 4: Find the p-value and critical value

Using the z to p-value calculator, the p-value for the two-tailed test with z = -2.40 is 0.016395. Additionally, the two-tailed critical values for the test using the z-critical value calculator are ±1.96.

Step 5: Make the decision

We can now use the p-value and the critical values to make the right decision as follows:

  • Since the p-value (0.016395) is less than the 0.05 significance level, we reject the null hypothesis.
  • Similarly, since the absolute test statistic value (2.40) is greater than the absolute critical value (1.96), we reject the null hypothesis.

Step 6: Write the conclusion

At the 5% level of significance, there is sufficient statistical evidence to reject the company’s claim. As such, the average volume of the energy drinks is significantly different from 500 ml.

Frequently Asked Questions

What does this one-sample z-test calculator do?

This calculator performs a one-sample z-test for a population mean. It returns the z statistic, p-value, critical value, and a step-by-step hypothesis test solution.

When should I use a one-sample z-test?

Use a one-sample z-test when you want to compare a sample mean with a hypothesized population mean and the population standard deviation is known.

Can I enter raw data?

Yes. The calculator allows you to enter raw data values. It will automatically calculate the sample mean and sample size from your data.

Do I still need σ if I enter raw data?

Yes. Raw data mode still requires the known population standard deviation, σ. If σ is unknown, use a one-sample t-test instead.

What is the difference between a one-sample z-test and a one-sample t-test?

A one-sample z-test is used when the population standard deviation is known, whereas a one-sample t-test is used when the population standard deviation is unknown, and the sample standard deviation is used instead.

Advertisement
Joseph Mburu

About This Calculator

Prepared by Joseph Mburu · Updated on

Joseph is an applied statistician and data analyst with over 6 years of experience helping students, researchers, and professionals solve statistics and data analysis problems. He holds a degree in Applied Statistics and a Master’s degree in Data…

We aim to keep our calculators accurate, easy to use, and helpful for learning. Always check that your inputs match the assumptions of the method you are using.