Z-test Calculator

Table of contents

This Z-test calculator is a tool that helps you perform a one-sample Z-test on the population's mean . Two forms of this test - a two-tailed Z-test and a one-tailed Z-tests - exist, and can be used depending on your needs. You can also choose whether the calculator should determine the p-value from Z-test or you'd rather use the critical value approach!

Read on to learn more about Z-test in statistics, and, in particular, when to use Z-tests, what is the Z-test formula, and whether to use Z-test vs. t-test. As a bonus, we give some step-by-step examples of how to perform Z-tests!

Or you may also check our t-statistic calculator , where you can learn the concept of another essential statistic. If you are also interested in F-test, check our F-statistic calculator .

What is a Z-test?

A one sample Z-test is one of the most popular location tests. The null hypothesis is that the population mean value is equal to a given number, μ 0 \mu_0 μ 0 ​ :

We perform a two-tailed Z-test if we want to test whether the population mean is not μ 0 \mu_0 μ 0 ​ :

and a one-tailed Z-test if we want to test whether the population mean is less/greater than μ 0 \mu_0 μ 0 ​ :

Let us now discuss the assumptions of a one-sample Z-test.

When do I use Z-tests?

You may use a Z-test if your sample consists of independent data points and:

the data is normally distributed , and you know the population variance ;

the sample is large , and data follows a distribution which has a finite mean and variance. You don't need to know the population variance.

The reason these two possibilities exist is that we want the test statistics that follow the standard normal distribution N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) . In the former case, it is an exact standard normal distribution, while in the latter, it is approximately so, thanks to the central limit theorem.

The question remains, "When is my sample considered large?" Well, there's no universal criterion. In general, the more data points you have, the better the approximation works. Statistics textbooks recommend having no fewer than 50 data points, while 30 is considered the bare minimum.

Z-test formula

Let x 1 , . . . , x n x_1, ..., x_n x 1 ​ , ... , x n ​ be an independent sample following the normal distribution N ( μ , σ 2 ) \mathrm N(\mu, \sigma^2) N ( μ , σ 2 ) , i.e., with a mean equal to μ \mu μ , and variance equal to σ 2 \sigma ^2 σ 2 .

We pose the null hypothesis, H 0  ⁣  ⁣ :  ⁣  ⁣   μ = μ 0 \mathrm H_0 \!\!:\!\! \mu = \mu_0 H 0 ​ :   μ = μ 0 ​ .

We define the test statistic, Z , as:

x ˉ \bar x x ˉ is the sample mean, i.e., x ˉ = ( x 1 + . . . + x n ) / n \bar x = (x_1 + ... + x_n) / n x ˉ = ( x 1 ​ + ... + x n ​ ) / n ;

μ 0 \mu_0 μ 0 ​ is the mean postulated in H 0 \mathrm H_0 H 0 ​ ;

n n n is sample size; and

σ \sigma σ is the population standard deviation.

In what follows, the uppercase Z Z Z stands for the test statistic (treated as a random variable), while the lowercase z z z will denote an actual value of Z Z Z , computed for a given sample drawn from N(μ,σ²).

If H 0 \mathrm H_0 H 0 ​ holds, then the sum S n = x 1 + . . . + x n S_n = x_1 + ... + x_n S n ​ = x 1 ​ + ... + x n ​ follows the normal distribution, with mean n μ 0 n \mu_0 n μ 0 ​ and variance n 2 σ n^2 \sigma n 2 σ . As Z Z Z is the standardization (z-score) of S n / n S_n/n S n ​ / n , we can conclude that the test statistic Z Z Z follows the standard normal distribution N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) , provided that H 0 \mathrm H_0 H 0 ​ is true. By the way, we have the z-score calculator if you want to focus on this value alone.

If our data does not follow a normal distribution, or if the population standard deviation is unknown (and thus in the formula for Z Z Z we substitute the population standard deviation σ \sigma σ with sample standard deviation), then the test statistics Z Z Z is not necessarily normal. However, if the sample is sufficiently large, then the central limit theorem guarantees that Z Z Z is approximately N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) .

In the sections below, we will explain to you how to use the value of the test statistic, z z z , to make a decision , whether or not you should reject the null hypothesis . Two approaches can be used in order to arrive at that decision: the p-value approach, and critical value approach - and we cover both of them! Which one should you use? In the past, the critical value approach was more popular because it was difficult to calculate p-value from Z-test. However, with help of modern computers, we can do it fairly easily, and with decent precision. In general, you are strongly advised to report the p-value of your tests!

p-value from Z-test

Formally, the p-value is the smallest level of significance at which the null hypothesis could be rejected. More intuitively, p-value answers the questions: provided that I live in a world where the null hypothesis holds, how probable is it that the value of the test statistic will be at least as extreme as the z z z - value I've got for my sample? Hence, a small p-value means that your result is very improbable under the null hypothesis, and so there is strong evidence against the null hypothesis - the smaller the p-value, the stronger the evidence.

To find the p-value, you have to calculate the probability that the test statistic, Z Z Z , is at least as extreme as the value we've actually observed, z z z , provided that the null hypothesis is true. (The probability of an event calculated under the assumption that H 0 \mathrm H_0 H 0 ​ is true will be denoted as P r ( event ∣ H 0 ) \small \mathrm{Pr}(\text{event} | \mathrm{H_0}) Pr ( event ∣ H 0 ​ ) .) It is the alternative hypothesis which determines what more extreme means :

  • Two-tailed Z-test: extreme values are those whose absolute value exceeds ∣ z ∣ |z| ∣ z ∣ , so those smaller than − ∣ z ∣ -|z| − ∣ z ∣ or greater than ∣ z ∣ |z| ∣ z ∣ . Therefore, we have:

The symmetry of the normal distribution gives:

  • Left-tailed Z-test: extreme values are those smaller than z z z , so
  • Right-tailed Z-test: extreme values are those greater than z z z , so

To compute these probabilities, we can use the cumulative distribution function, (cdf) of N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) , which for a real number, x x x , is defined as:

Also, p-values can be nicely depicted as the area under the probability density function (pdf) of N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) , due to:

Two-tailed Z-test and one-tailed Z-test

With all the knowledge you've got from the previous section, you're ready to learn about Z-tests.

  • Two-tailed Z-test:

From the fact that Φ ( − z ) = 1 − Φ ( z ) \Phi(-z) = 1 - \Phi(z) Φ ( − z ) = 1 − Φ ( z ) , we deduce that

The p-value is the area under the probability distribution function (pdf) both to the left of − ∣ z ∣ -|z| − ∣ z ∣ , and to the right of ∣ z ∣ |z| ∣ z ∣ :

two-tailed p value

  • Left-tailed Z-test:

The p-value is the area under the pdf to the left of our z z z :

left-tailed p value

  • Right-tailed Z-test:

The p-value is the area under the pdf to the right of z z z :

right-tailed p value

The decision as to whether or not you should reject the null hypothesis can be now made at any significance level, α \alpha α , you desire!

if the p-value is less than, or equal to, α \alpha α , the null hypothesis is rejected at this significance level; and

if the p-value is greater than α \alpha α , then there is not enough evidence to reject the null hypothesis at this significance level.

Z-test critical values & critical regions

The critical value approach involves comparing the value of the test statistic obtained for our sample, z z z , to the so-called critical values . These values constitute the boundaries of regions where the test statistic is highly improbable to lie . Those regions are often referred to as the critical regions , or rejection regions . The decision of whether or not you should reject the null hypothesis is then based on whether or not our z z z belongs to the critical region.

The critical regions depend on a significance level, α \alpha α , of the test, and on the alternative hypothesis. The choice of α \alpha α is arbitrary; in practice, the values of 0.1, 0.05, or 0.01 are most commonly used as α \alpha α .

Once we agree on the value of α \alpha α , we can easily determine the critical regions of the Z-test:

To decide the fate of H 0 \mathrm H_0 H 0 ​ , check whether or not your z z z falls in the critical region:

If yes, then reject H 0 \mathrm H_0 H 0 ​ and accept H 1 \mathrm H_1 H 1 ​ ; and

If no, then there is not enough evidence to reject H 0 \mathrm H_0 H 0 ​ .

As you see, the formulae for the critical values of Z-tests involve the inverse, Φ − 1 \Phi^{-1} Φ − 1 , of the cumulative distribution function (cdf) of N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) .

How to use the one-sample Z-test calculator?

Our calculator reduces all the complicated steps:

Choose the alternative hypothesis: two-tailed or left/right-tailed.

In our Z-test calculator, you can decide whether to use the p-value or critical regions approach. In the latter case, set the significance level, α \alpha α .

Enter the value of the test statistic, z z z . If you don't know it, then you can enter some data that will allow us to calculate your z z z for you:

  • sample mean x ˉ \bar x x ˉ (If you have raw data, go to the average calculator to determine the mean);
  • tested mean μ 0 \mu_0 μ 0 ​ ;
  • sample size n n n ; and
  • population standard deviation σ \sigma σ (or sample standard deviation if your sample is large).

Results appear immediately below the calculator.

If you want to find z z z based on p-value , please remember that in the case of two-tailed tests there are two possible values of z z z : one positive and one negative, and they are opposite numbers. This Z-test calculator returns the positive value in such a case. In order to find the other possible value of z z z for a given p-value, just take the number opposite to the value of z z z displayed by the calculator.

Z-test examples

To make sure that you've fully understood the essence of Z-test, let's go through some examples:

  • A bottle filling machine follows a normal distribution. Its standard deviation, as declared by the manufacturer, is equal to 30 ml. A juice seller claims that the volume poured in each bottle is, on average, one liter, i.e., 1000 ml, but we suspect that in fact the average volume is smaller than that...

Formally, the hypotheses that we set are the following:

H 0  ⁣ :   μ = 1000  ml \mathrm H_0 \! : \mu = 1000 \text{ ml} H 0 ​ :   μ = 1000  ml

H 1  ⁣ :   μ < 1000  ml \mathrm H_1 \! : \mu \lt 1000 \text{ ml} H 1 ​ :   μ < 1000  ml

We went to a shop and bought a sample of 9 bottles. After carefully measuring the volume of juice in each bottle, we've obtained the following sample (in milliliters):

1020 , 970 , 1000 , 980 , 1010 , 930 , 950 , 980 , 980 \small 1020, 970, 1000, 980, 1010, 930, 950, 980, 980 1020 , 970 , 1000 , 980 , 1010 , 930 , 950 , 980 , 980 .

Sample size: n = 9 n = 9 n = 9 ;

Sample mean: x ˉ = 980   m l \bar x = 980 \ \mathrm{ml} x ˉ = 980   ml ;

Population standard deviation: σ = 30   m l \sigma = 30 \ \mathrm{ml} σ = 30   ml ;

And, therefore, p-value = Φ ( − 2 ) ≈ 0.0228 \text{p-value} = \Phi(-2) \approx 0.0228 p-value = Φ ( − 2 ) ≈ 0.0228 .

As 0.0228 < 0.05 0.0228 \lt 0.05 0.0228 < 0.05 , we conclude that our suspicions aren't groundless; at the most common significance level, 0.05, we would reject the producer's claim, H 0 \mathrm H_0 H 0 ​ , and accept the alternative hypothesis, H 1 \mathrm H_1 H 1 ​ .

We tossed a coin 50 times. We got 20 tails and 30 heads. Is there sufficient evidence to claim that the coin is biased?

Clearly, our data follows Bernoulli distribution, with some success probability p p p and variance σ 2 = p ( 1 − p ) \sigma^2 = p (1-p) σ 2 = p ( 1 − p ) . However, the sample is large, so we can safely perform a Z-test. We adopt the convention that getting tails is a success.

Let us state the null and alternative hypotheses:

H 0  ⁣ :   p = 0.5 \mathrm H_0 \! : p = 0.5 H 0 ​ :   p = 0.5 (the coin is fair - the probability of tails is 0.5 0.5 0.5 )

H 1  ⁣ :   p ≠ 0.5 \mathrm H_1 \! : p \ne 0.5 H 1 ​ :   p  = 0.5 (the coin is biased - the probability of tails differs from 0.5 0.5 0.5 )

In our sample we have 20 successes (denoted by ones) and 30 failures (denoted by zeros), so:

Sample size n = 50 n = 50 n = 50 ;

Sample mean x ˉ = 20 / 50 = 0.4 \bar x = 20/50 = 0.4 x ˉ = 20/50 = 0.4 ;

Population standard deviation is given by σ = 0.5 × 0.5 \sigma = \sqrt{0.5 \times 0.5} σ = 0.5 × 0.5 ​ (because 0.5 0.5 0.5 is the proportion p p p hypothesized in H 0 \mathrm H_0 H 0 ​ ). Hence, σ = 0.5 \sigma = 0.5 σ = 0.5 ;

  • And, therefore

Since 0.1573 > 0.1 0.1573 \gt 0.1 0.1573 > 0.1 we don't have enough evidence to reject the claim that the coin is fair , even at such a large significance level as 0.1 0.1 0.1 . In that case, you may safely toss it to your Witcher or use the coin flip probability calculator to find your chances of getting, e.g., 10 heads in a row (which are extremely low!).

What is the difference between Z-test vs t-test?

We use a t-test for testing the population mean of a normally distributed dataset which had an unknown population standard deviation . We get this by replacing the population standard deviation in the Z-test statistic formula by the sample standard deviation, which means that this new test statistic follows (provided that H₀ holds) the t-Student distribution with n-1 degrees of freedom instead of N(0,1) .

When should I use t-test over the Z-test?

For large samples, the t-Student distribution with n degrees of freedom approaches the N(0,1). Hence, as long as there are a sufficient number of data points (at least 30), it does not really matter whether you use the Z-test or the t-test, since the results will be almost identical. However, for small samples with unknown variance, remember to use the t-test instead of Z-test .

How do I calculate the Z test statistic?

To calculate the Z test statistic:

  • Compute the arithmetic mean of your sample .
  • From this mean subtract the mean postulated in null hypothesis .
  • Multiply by the square root of size sample .
  • Divide by the population standard deviation .
  • That's it, you've just computed the Z test statistic!

Here, we perform a Z-test for population mean μ. Null hypothesis H₀: μ = μ₀.

Alternative hypothesis H₁

Significance level α

The probability that we reject the true hypothesis H₀ (type I error).

Z-Test Calculator

This Z-test calculator computes data for both one-sample and two-sample Z-tests. It also provides a diagram to show the position of the Z-score and the acceptance/rejection regions. When making a two-sample Z-test calculation, the population mean difference, d, represents the difference between the population means of sample one and sample two, which is μ 1 -μ 2 . To use this calculator, simply select the type of calculation from the tab, enter the values, and click the 'Calculate' button.

The Z-test is a statistical procedure used to determine whether there is a significant difference between means, either between a sample mean and a known population mean (one-sample Z-test) or between the means of two independent samples (two-sample Z-test). It assumes that the data is normally distributed and is particularly useful when the sample sizes are large (>30) and the population standard deviations are known. When analyzing data to make informed decisions, statistical hypothesis tests are indispensable tools used to determine if evidence exists to reject a prevailing assumption or theory, known as the null hypothesis. The Z-test is one of these tests.

One-Sample Z-Test

The one-sample Z-test is used when you want to compare the mean of a single sample to a known population mean to see if there is a significant difference. This is particularly common in quality control and other scenarios where the standard deviation of the population is known.

  • Null Hypothesis (H 0 ): The sample mean is equal to the population mean (x̅=μ).
  • Alternative Hypothesis (H 1 ): The sample mean is not equal to the population mean (x̅≠μ). This can also be one-tailed (x̅>μ or x̅<μ) depending on the direction of interest.

The formula for the Z-statistic in a one-sample Z-test is:

  • x̅ is the sample mean
  • μ is the population mean
  • σ is the population standard deviation
  • n is the sample size

Example: Suppose a school administrator knows the national average score for a standardized test is 500 with a standard deviation of 50. A sample of 100 students from a new teaching program scores an average of 520. To determine if this program significantly differs from the national average:

This Z-value would then be compared against a critical value from the Z-distribution table typically at a 0.05 significance level. The critical value for a 0.05 significance level is approximately ±1.96. The Z-value of 4 is greater than 1.96. Therefore, the null hypothesis is rejected and the score of this program is considered significantly different from the national average at the 0.05 significance level.

Two-Sample Z-Test

The two-sample Z-test (or independent samples Z-test) compares the means from two independent groups to determine if there is a statistically significant difference between them.

  • Null Hypothesis (H 0 ): The two population means have a difference of d (μ 1 -μ 2 =d). If d is 0, the null hypothesis states that the two population means are equal (μ 1 =μ 2 ).
  • Alternative Hypothesis (H 1 ): The difference between two population means is not d (μ 1 -μ 2 ≠d), which can also be directional (μ 1 -μ 2 >d or μ 1 -μ 2 <d). If d is 0, the alternative hypothesis becomes μ 1 ≠μ 2 , or μ 1 >μ 2 or μ 1 <μ 2 if it is directional.

The formula for calculating the Z-statistic in a two-sample Z-test is:

  • x̅ 1 and x̅ 2 are the sample means of groups 1 and 2, respectively
  • μ 1 and μ 2 are the population means, with μ 1 - μ 2 = d. d is often hypothesized to be zero under the null hypothesis.
  • σ 1 and σ 2 are the population standard deviations
  • n 1 and n 2 are the sample sizes of the two groups

Example: Consider two groups of employees from different branches of a company undergoing training. Group A has 50 employees with an average score of 80 and a standard deviation of 10, and Group B has 50 employees with an average score of 75 and a standard deviation of 12. To test if there's a significant difference:

This Z-value is then compared to the critical Z-values to assess significance. The critical value of a 0.05 significance level is around ±1.95. The Z-value of 2.26 is more than 1.95. Therefore, the two group has significant difference at 0.05 significance level.

Significance Level

The significance level (α) is a critical concept in hypothesis testing. It represents the probability threshold below which the null hypothesis will be rejected. Common levels are 0.05 (5%) or 0.01 (1%). The choice of α affects the Z-critical value, which is used to determine whether to reject the null hypothesis based on the computed Z-score.

  • Critical Value: This is a point on the Z-distribution that the test statistic must exceed to reject the null hypothesis. For instance, at a 5% significance level in a two-tailed test, the critical values are approximately ±1.96. The significance level (probability) and critical value (Z-score) can be converted with each other the Z-distribution table or use our Z/P converter .

Using the above examples, if the computed Z-scores exceed the respective critical values, the null hypotheses in each case would be rejected, indicating a statistically significant difference as per the alternative hypotheses. These examples demonstrate how the Z-test is applied in different scenarios to test hypotheses concerning population means.

Hypothesis Testing Calculator

Type ii error.

The first step in hypothesis testing is to calculate the test statistic. The formula for the test statistic depends on whether the population standard deviation (σ) is known or unknown. If σ is known, our hypothesis test is known as a z test and we use the z distribution. If σ is unknown, our hypothesis test is known as a t test and we use the t distribution. Use of the t distribution relies on the degrees of freedom, which is equal to the sample size minus one. Furthermore, if the population standard deviation σ is unknown, the sample standard deviation s is used instead. To switch from σ known to σ unknown, click on $\boxed{\sigma}$ and select $\boxed{s}$ in the Hypothesis Testing Calculator.

Next, the test statistic is used to conduct the test using either the p-value approach or critical value approach. The particular steps taken in each approach largely depend on the form of the hypothesis test: lower tail, upper tail or two-tailed. The form can easily be identified by looking at the alternative hypothesis (H a ). If there is a less than sign in the alternative hypothesis then it is a lower tail test, greater than sign is an upper tail test and inequality is a two-tailed test. To switch from a lower tail test to an upper tail or two-tailed test, click on $\boxed{\geq}$ and select $\boxed{\leq}$ or $\boxed{=}$, respectively.

In the p-value approach, the test statistic is used to calculate a p-value. If the test is a lower tail test, the p-value is the probability of getting a value for the test statistic at least as small as the value from the sample. If the test is an upper tail test, the p-value is the probability of getting a value for the test statistic at least as large as the value from the sample. In a two-tailed test, the p-value is the probability of getting a value for the test statistic at least as unlikely as the value from the sample.

To test the hypothesis in the p-value approach, compare the p-value to the level of significance. If the p-value is less than or equal to the level of signifance, reject the null hypothesis. If the p-value is greater than the level of significance, do not reject the null hypothesis. This method remains unchanged regardless of whether it's a lower tail, upper tail or two-tailed test. To change the level of significance, click on $\boxed{.05}$. Note that if the test statistic is given, you can calculate the p-value from the test statistic by clicking on the switch symbol twice.

In the critical value approach, the level of significance ($\alpha$) is used to calculate the critical value. In a lower tail test, the critical value is the value of the test statistic providing an area of $\alpha$ in the lower tail of the sampling distribution of the test statistic. In an upper tail test, the critical value is the value of the test statistic providing an area of $\alpha$ in the upper tail of the sampling distribution of the test statistic. In a two-tailed test, the critical values are the values of the test statistic providing areas of $\alpha / 2$ in the lower and upper tail of the sampling distribution of the test statistic.

To test the hypothesis in the critical value approach, compare the critical value to the test statistic. Unlike the p-value approach, the method we use to decide whether to reject the null hypothesis depends on the form of the hypothesis test. In a lower tail test, if the test statistic is less than or equal to the critical value, reject the null hypothesis. In an upper tail test, if the test statistic is greater than or equal to the critical value, reject the null hypothesis. In a two-tailed test, if the test statistic is less than or equal the lower critical value or greater than or equal to the upper critical value, reject the null hypothesis.

When conducting a hypothesis test, there is always a chance that you come to the wrong conclusion. There are two types of errors you can make: Type I Error and Type II Error. A Type I Error is committed if you reject the null hypothesis when the null hypothesis is true. Ideally, we'd like to accept the null hypothesis when the null hypothesis is true. A Type II Error is committed if you accept the null hypothesis when the alternative hypothesis is true. Ideally, we'd like to reject the null hypothesis when the alternative hypothesis is true.

Hypothesis testing is closely related to the statistical area of confidence intervals. If the hypothesized value of the population mean is outside of the confidence interval, we can reject the null hypothesis. Confidence intervals can be found using the Confidence Interval Calculator . The calculator on this page does hypothesis tests for one population mean. Sometimes we're interest in hypothesis tests about two population means. These can be solved using the Two Population Calculator . The probability of a Type II Error can be calculated by clicking on the link at the bottom of the page.

Z-test for One Population Mean

Instructions: This calculator conducts a Z-test for one population mean (\(\mu\)), with known population standard deviation (\(\sigma\)). Please select the null and alternative hypotheses, type the hypothesized mean, the significance level, the sample mean, the population standard deviation, and the sample size, and the results of the z-test will be displayed for you:

hypothesis calculator z test

How to Conduct a Z-Test for One Population Mean?

More about the z-test for one mean so you can better interpret the results obtained by this solver: A z-test for one mean is a hypothesis test that attempts to make a claim about the population mean (\(\mu\)).

The test has two non-overlapping hypotheses, the null and the alternative hypothesis. The null hypothesis is a statement about the population mean, under the assumption of no effect, and the alternative hypothesis is the complementary hypothesis to the null hypothesis. The main properties of a one sample z-test for one population mean are:

  • Depending on our knowledge about the "no effect" situation, the z-test can be two-tailed, left-tailed or right-tailed
  • The main principle of hypothesis testing is that the null hypothesis is rejected if the test statistic obtained is sufficiently unlikely under the assumption that the null hypothesis is true
  • The p-value is the probability of obtaining sample results as extreme or more extreme than the sample results obtained, under the assumption that the null hypothesis is true
  • In a hypothesis tests there are two types of errors. Type I error occurs when we reject a true null hypothesis, and the Type II error occurs when we fail to reject a false null hypothesis

Uses of this z-test calculator

What can you do with this z-test statistic calculator for hypothesis testing? The formula for a z-statistic is

The null hypothesis is rejected when the z-statistic lies on the rejection region, which is determined by the significance level (\(\alpha\)) and the type of tail (two-tailed, left-tailed or right-tailed).

What if the population standard deviation is not known?

It frequently happens that you don't actually know the population standard deviation, in which case you need to use a t-test for one mean calculator instead, which adjusts for that by using the sample standard deviation, by using a slightly different distribution (the t-distribution)

How to calculate p-value in the context of a z-test?

The answer depends on whether you are using a two-tailed, a left-tailed or a right-tailed test. Say you have the calculated z-statistic, \(Z_{obs}\).

  • For a two-tailed test, the p-value is computed as: \(p = \Pr( Z > |Z_{obs}|) \)
  • For a left-tailed test, the p-value is computed as: \(p = \Pr( Z < Z_{obs}) \)
  • For a right-tailed test, the p-value is computed as: \(p = \Pr( Z > Z_{obs}) \)

where \(Z\) has a standard normal distribution.

Other types of Z-calculators

In case that you need to compare two population means, when you know the corresponding population standard deviations, you need to use this z-test for two means with known population standard deviations instead.

Outlier Detection

Don't forget to detect outliers before running a z-test for one mean. It is important that outliers are detected and removed before conducting the test, but the results of the test statistics may be slanted.

Z-test for one mean

Example: Application of the Z-test calculator

Question : Assume that you want to test whether or not the population mean is 12.3. You collect a representative random sample of size n = 16, and you find that the sample mean is 11.3. Also, you know that the population is 2.3. Do the sample data provide enough evidence to reject the claim that the population mean is 12.3? Use a two-tailed test, with a significance level of 0.01.

The following information has been provided:

(1) Null and Alternative Hypotheses

The following null and alternative hypotheses need to be tested:

This corresponds to a two-tailed test, for which a z-test for one mean, with known population standard deviation will be used.

(2) Rejection Region

Based on the information provided, the significance level is \(\alpha = 0.01\), and the critical value for a two-tailed test is \(z_c = 2.58\).

The rejection region for this two-tailed test is \(R = \{z: |z| > 2.576\}\)

(3) Test Statistics

The z-statistic is computed as follows:

(4) Decision about the null hypothesis

Since it is observed that \(|z| = 1.739 \le z_c = 2.576\), it is then concluded that the null hypothesis is not rejected.

Using the P-value approach: The p-value is \(p = 0.082\), and since \(p = 0.082 \ge 0.01\), it is concluded that the null hypothesis is not rejected.

(5) Conclusion

It is concluded that the null hypothesis Ho is not rejected. Therefore, there is not enough evidence to claim that the population mean \(\mu\) is different than 12.3, at the \(\alpha = 0.01\) significance level.

Confidence Interval

The 99% confidence interval is \(9.819 < \mu < 12.781\).

Related Calculators

Descriptive Statistics Calculator of Grouped Data

log in to your account

Reset password.

One Sample Z-Test Calculator

Enter sample data, z test online, assumptions, required sample data.

One sample z test calculator

Welcome to our One Sample Z Test Calculator! This tool helps you perform a one-sample Z test for hypothesis testing quickly and accurately. our calculator simplifies the process of determining p-values, critical value, test statistics, decision and Conclusion.

Table of Contents

Understanding the one sample z test.

  • Related Calculators

How to Use the One Sample Z Test Calculator

Applications of the one sample z test, assumption for one sample z test :, frequently asked questions (faqs).

The one-sample Z test is used to assess whether there is a significant difference between the sample mean and the population mean. This test is appropriate when the population standard deviation is known and the sample size is large enough \( \mathrm{( n > 30)}\).

To determine if a population's mean is greater than, less than, or equal to a given value, use the one-sample z-test. This test is frequently referred to as the one-sample z-test since the critical values are determined using the standard normal distribution. The population standard deviation must be known in order to use the z-test.

Related Calculators :

Below are more calculators which use the critical value to perform statistical analysis.

  • Select Data Type: Choose whether to input summary statistics directly or provide a data set.
  • Input Your Data: Enter the necessary values such as the population mean, sample size, sample mean, and population standard deviation.
  • Set Hypotheses: Specify the null and alternative hypotheses.
  • Calculate: Click the "Calculate" button to see the test statistic, p-value, and other relevant results.

Example of one sample z test hypothesis

one sample z example imag

First lets find the given parameters

Sample size, \(n =20\), Sample mean, \(\bar x = 42\), Population standard deviation, \(\sigma = 6\), Population mean, \(\mu = 38\), Significance level, \(\alpha = 0.01\)

The null and alternative hypothesis is

\(H_0: \mu = 38\) and \( H_a: \mu > 38 \)

The null hypothesis contains the equality sign and the alternative hypothesis contains the inequality sign.

Now, lets find the Test statistic which is required for find the p-value

Formula for the test statistic is

\( z = \frac{\bar{x}-\mu}{\frac{\sigma}{\sqrt{n}}} \)

Put the given values in above formula, we get

\(\frac{42-38}{\frac{6}{\sqrt{20}}} = 2.98 \)

The test statistic is 2.98

Here we round test statistic to two decimal places because this decimal places is used in p-value table to find the test statistic

Next, find the p-value to find the statistical decision

The p-value with test statistic, z = 2.98 is

P( z > 2.98) = 0.0014

The p-value is 0.0014

The p-value in statistical hypothesis testing is the probability of obtaining results at least as extreme as the observed results of a statistical test, assuming that the null hypothesis is true.

The following Excel formula can be used to find the p-value:

=1-NORM.S.DIST(2.98,TRUE)

In this formula 2.98 is represents the test statistic.

Decision : Since the p-value is less than the chosen significance level, the decision is reject the null hypothesis.

Conclusion : There is sufficient evidence to conclude that population mean is greater than 38.

Since the decision is reject the null hypothesis, there is sufficient evidence to support alternative hypothesis.

Interpreting the Results

The results of the one-sample Z test will indicate whether you should reject the null hypothesis. A p-value smaller than α rejects the null hypothesis, showing a substantial difference between the sample and population means.

This test is widely used in various fields including:

  • Education: Assessing whether the average test scores of a class differ from the national average.
  • Healthcare: Comparing the mean blood pressure level of a group of patients to a known population mean.
  • Business: Evaluating if the average sales of a product differ from the company's historical sales data.

The assumption for one sample z test are as follows

1. Continuous Data: It's true that continuous data is necessary. This indicates that rather than being discrete or categorical, the data points are measured on a continuous scale.

2. Simple Random Sample: According to this premise, there is no bias in the sample selection process and every individual in the population has an equal probability of being chosen. By doing this, the sample's representativeness to the population is increased.

3. Normality of Data: It is assumed that the data for a one-sample z-test have a normal distribution. This presumption is essential since the validity of the z-test depends on the characteristics of the normal distribution.

4. Known Population Standard Deviation: The z-test operates under the assumption that the population standard deviation (σ) is known, in contrast to the t-test, which necessitates the sample standard deviation.

What is a one-sample Z test?

A one-sample Z test is a statistical test used to determine whether there is a significant difference between the mean of a sample and a known population mean.

When should I use a one-sample Z test?

You should use this test when the population standard deviation is known and the sample size is large (typically n > 30).

How do I interpret the p-value in a Z test?

The p-value indicates the probability of observing the test results under the null hypothesis. A low p-value (less than the significance level, α) suggests that you should reject the null hypothesis.

Why use our one-sample Z test calculator?

Our calculator offers several advantages:

  • Accuracy: Provides precise calculations for your hypothesis testing needs.
  • User-Friendly Interface: Easy to navigate and input your data.
  • Educational Value: Offers detailed explanations and step-by-step guides to help you understand the results.
  • Time-Saving: Quickly computes results, allowing you to focus on analysis and interpretation.
  • Versatility: Suitable for various fields such as education, healthcare, and business, making it a valuable tool for a wide range of users.

hypothesis calculator z test

  • Calculators
  • Descriptive Statistics
  • Merchandise
  • Which Statistics Test?

Single Sample Z Score Calculator

This tool calculates the z -score of the mean of a single sample. It can be used to make a judgement about whether the sample differs significantly on some axis from the population from which it was originally drawn.

By default, this tool works on the assumption that you already know the mean value of your sample scores and the number of individuals in your sample. If you want the tool to calculate these for you from raw values, please select the checkbox below.

To use this calculator, just input your population mean, population variance, sample mean and the number of individuals in the sample into the text boxes below. You also need to select a significance level and whether your hypothesis is one or two-tailed. Hit the calculate button (below) when you're ready.

Calculation not performed yet.

  

hypothesis calculator z test

logo of Wishmetool blog

Z-Test Calculator

Z-Score: –

Conclusion: –

Buy Me A Coffee

Note : This calculator assumes a two-tailed test, so if you’re interested in a one-tailed test, you’ll need to interpret the Z-score manually.

Table of Contents

How to use this z-test calculator.

  • Select the Confidence Level : Choose the confidence level suitable for your test.
  • Enter Sample Mean (x̄) : Type the average of the sample data in the corresponding field.
  • Enter Population Mean (μ) : Type the average of the entire population in the corresponding field.
  • Enter Sample Size (n) : Type the number of observations in your sample.
  • Enter Population Standard Deviation (σ) : Type the standard deviation of the population.
  • Click the Calculate Button : After entering all the data, click the “Calculate” button.
  • View the Results : Look at the “Z-Score” and “Conclusion” sections to interpret the results.

Interpretations

  • If the conclusion is “Reject null hypothesis,” it means that the sample mean is significantly different from the population mean at the selected confidence level.
  • If the conclusion is “Fail to reject null hypothesis,” it means that there’s not enough evidence to suggest that the sample mean is different from the population mean at the selected confidence level.

Demystifying the Z-Test: A Simple Guide to Understanding When and How to Use It

Let’s delve into the fascinating world of statistical hypothesis testing, particularly focusing on one of its most fundamental tools: the Z-test. Now, if the mere mention of ‘statistics’ or ‘Z-test’ sends you into a spiral of confusion, worry not! By the end of this article, you’ll not only understand what a Z-test is but also when and how to use it

What is a Z-Test, Anyway?

So, let’s start with the basics. A Z-test is a type of statistical hypothesis test that helps you determine whether the mean of a sample you’ve collected is statistically significantly different from the known mean of a whole population. In simpler terms, it’s like a fact-checker that tells you if the average value you’ve calculated from a small group is a reliable representation of a much larger group. Imagine polling a hundred people to predict the outcome of a presidential election. A Z-test can tell you whether that sample of 100 people is a good indicator of how the entire country will vote.

Why Would You Need a Z-Test?

The answer is quite straightforward: you often can’t survey an entire population. Whether you’re a researcher studying the effect of a new drug, a marketer trying to gauge the success of a recent campaign, or a student collecting data for a project, you’ll likely be working with samples. And here’s where the Z-test comes in handy—it helps you make accurate inferences about a whole population based on the sample data you have.

The Ingredients for a Z-Test

Armed with these numbers, you’re all set to perform a Z-test.

  • Sample Mean (x̄) : The average of the sample data you’ve collected.
  • Population Mean (μ) : The known average of the entire population.
  • Sample Size (n) : The number of observations in your sample.
  • Population Standard Deviation (σ) : The spread of the entire population data.

The Nuts and Bolts: How to Perform a Z-Test

The crux of a Z-test lies in calculating the Z-score, a simple formula that looks something like this:

Z test formula

Don’t be intimidated by the formula; it’s simpler than it looks. You’re basically taking the difference between the sample mean and the population mean, and then dividing that by the standard error (which is the population standard deviation divided by the square root of the sample size). This Z-score will be your guide in determining whether to reject or accept the null hypothesis.

Interpreting the Z-Score

Once you’ve got the Z-score, the next step is to compare it against a critical Z-value that corresponds to a confidence level you’ve chosen (usually 95% or 99%). If the absolute value of the Z-score is greater than the critical Z-value, you can reject the null hypothesis. This means that the sample mean is significantly different from the population mean. On the flip side, if the Z-score is less than the critical Z-value, you fail to reject the null hypothesis, implying there’s not enough evidence to say the sample is different from the population.

When to Use Which? (One-Tailed vs Two-Tailed)

The terms ‘one-tailed’ and ‘two-tailed’ refer to the number of directions in which we are interested in testing our sample mean against the population mean. Allow me to clarify:

One-Tailed Test

In a one-tailed test, you’re essentially asking a directional question. You want to know if the sample mean is either significantly greater or significantly less than the population mean, but not both. For example, let’s say you’re a marketer who has tweaked an online ad campaign, and you want to know if the changes have increased the click-through rate. You’re not interested in whether the rate decreased; you only want to know if it went up. This is a perfect situation for a one-tailed test.

The critical Z-value in a one-tailed test is generally going to be larger in absolute terms if you’re looking at the tail at the extreme end of the distribution. This makes it ‘easier’ to reject the null hypothesis, but be cautious—this also increases the likelihood of a Type I error (falsely rejecting a true null hypothesis).

Two-Tailed Test

On the other hand, a two-tailed test doesn’t assume a direction. You’re asking if the sample mean is different from the population mean—either greater or less. Imagine you’re a quality control manager at a factory, and you want to know if a new manufacturing process has changed the average weight of a product. In this case, you’re interested in knowing if the weight has either increased or decreased, making a two-tailed test the appropriate choice.

The critical Z-value in a two-tailed test is generally smaller in absolute terms, making it ‘harder’ to reject the null hypothesis, which can be a safer approach to avoid Type I errors.

When to Use Which?

  • Use a One-Tailed Test When : You have a specific direction in mind (greater or less), and you are okay with the increased risk of a Type I error for the benefit of a more sensitive test.
  • Use a Two-Tailed Test When : You are interested in any kind of difference between the sample mean and population mean, irrespective of the direction. This is often considered a more conservative approach.

Confidence Levels and Two-Tailed Tests

You may have heard of terms like ‘confidence levels’ or ‘two-tailed tests.’ These are just ways to refine your Z-test. The confidence level, usually set at 95%, gives you the probability that your sample mean will fall within a certain range of the population mean. A two-tailed test, on the other hand, checks for deviations in both directions—whether the sample mean is either significantly higher or lower than the population mean.

Putting It All Together

So there you have it- a complete guide to understanding and using the Z-test. While it might seem daunting at first, remember that the Z-test is essentially a tool that helps you make sense of the data you have, allowing you to draw meaningful conclusions about a larger group based on a sample. Whether you’re in academia, business, or just satisfying your own curiosity, mastering the Z-test is a valuable skill that will help you navigate the complex, yet exciting, world of data and statistics.

Loved it? How about checking our All-in-One Descriptive Statistical Calculator or may be other Statistical Tools .

Other Useful Tools

Zodiac sign finder

Zodiac Sign Finder

Hexa-color-palette

Hexa Color Palette

Ohm's-law-calculator

Ohm’s Law Calculator

Color-palette-from-image

Color Palette from Image

Golden ratio calculator

Golden Ratio Calculator

Destiny number calculator

Destiny Number Calculator

Descriptive-statistical-calculator

Descriptive Statistical Calculator

Kinematics-calculator

Kinematics Calculator

Leave a reply cancel reply.

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

IMAGES

  1. Z Test Statistics Formula

    hypothesis calculator z test

  2. One Sample Z Hypothesis Test

    hypothesis calculator z test

  3. Two Sample Z Hypothesis Test

    hypothesis calculator z test

  4. 2 Sample Z Test Ti 84

    hypothesis calculator z test

  5. Find the Value of the Standardized Z Test Statistic

    hypothesis calculator z test

  6. Z Test

    hypothesis calculator z test

COMMENTS

  1. What is a Z-test?

    This Z-test calculator is a tool that helps you perform a one-sample Z-test on the population's mean. Two forms of this test - a two-tailed Z-test and a one-tailed Z-tests - exist, and can be used depending on your needs. ... The critical regions depend on a significance level, α \alpha α, of the test, and on the alternative hypothesis.

  2. Z-Test Calculator

    This Z-test calculator computes data for both one-sample and two-sample Z-tests. It also provides a diagram to show the position of the Z-score and the acceptance/rejection regions. ... The significance level (α) is a critical concept in hypothesis testing. It represents the probability threshold below which the null hypothesis will be ...

  3. Hypothesis Testing Calculator with Steps

    The first step in hypothesis testing is to calculate the test statistic. The formula for the test statistic depends on whether the population standard deviation (σ) is known or unknown. If σ is known, our hypothesis test is known as a z test and we use the z distribution.

  4. One Sample Z-Test Calculator

    To perform a one sample z-test, simply fill in the information below and then click the "Calculate" button. Enter raw data Enter summary data 301, 298, 295, 297, 304, 305, 309, 298, 291, 299, 293, 304

  5. Z-test for One Population Mean

    This calculator conducts a Z-test for one population mean µ, with known population standard deviation σ. Please select the null and alternative hypotheses, type the hypothesized mean, the significance level, the sample mean, the population standard deviation, and the sample size, and the results of the z-test will be displayed for you

  6. One Sample Z-Test Calculator

    Z test online. Target: To check if the assumed μ 0 is statistically correct, based on a sample average. You know the standard deviation from previous researches. Example1: A farmer calculated last year the average of the apples' weight in his apple orchard μ 0 equals 17 kg, based on the entire population. The current year he checked a small sample of apples and the sample average x equals 18 kg

  7. One sample z test calculator

    How to Use the One Sample Z Test Calculator. Select Data Type: Choose whether to input summary statistics directly or provide a data set. Input Your Data: Enter the necessary values such as the population mean, sample size, sample mean, and population standard deviation. Set Hypotheses: Specify the null and alternative hypotheses.

  8. z-test calculator

    z-test calculator. Natural Language; Math Input; Extended Keyboard Examples Upload Random. Compute answers using Wolfram's breakthrough technology & knowledgebase, relied on by millions of students & professionals. ... Null hypothesis. Alternative hypothesis. Test statistic. p ‐value. Sampling distribution of test statistic under the null ...

  9. Single Sample Z Score Calculator

    To use this calculator, just input your population mean, population variance, sample mean and the number of individuals in the sample into the text boxes below. You also need to select a significance level and whether your hypothesis is one or two-tailed. Hit the calculate button (below) when you're ready.

  10. Z-Test Calculator: Calculate Z-Score Like A Pro!

    Demystifying the Z-Test: A Simple Guide to Understanding When and How to Use It. Let's delve into the fascinating world of statistical hypothesis testing, particularly focusing on one of its most fundamental tools: the Z-test. Now, if the mere mention of 'statistics' or 'Z-test' sends you into a spiral of confusion, worry not!