ZTest Calculator
This Ztest calculator computes data for both onesample and twosample Ztests. It also provides a diagram to show the position of the Zscore and the acceptance/rejection regions. When making a twosample Ztest 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 Ztest 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 (onesample Ztest) or between the means of two independent samples (twosample Ztest). 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 Ztest is one of these tests.
OneSample ZTest
The onesample Ztest 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.
Hypotheses
 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 onetailed (x̅>μ or x̅<μ) depending on the direction of interest.
Formula
The formula for the Zstatistic in a onesample Ztest is:
Z = 

where:
 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:
Z = 

= 

= 4 
This Zvalue would then be compared against a critical value from the Zdistribution table typically at a 0.05 significance level. The critical value for a 0.05 significance level is approximately ±1.96. The Zvalue 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.
TwoSample ZTest
The twosample Ztest (or independent samples Ztest) compares the means from two independent groups to determine if there is a statistically significant difference between them.
Hypotheses
 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.
Formula
The formula for calculating the Zstatistic in a twosample Ztest is:
Z = 

where:
 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:
Z = 

= 

= 2.26 
This Zvalue is then compared to the critical Zvalues to assess significance. The critical value of a 0.05 significance level is around ±1.95. The Zvalue 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 Zcritical value, which is used to determine whether to reject the null hypothesis based on the computed Zscore.
 Critical Value: This is a point on the Zdistribution that the test statistic must exceed to reject the null hypothesis. For instance, at a 5% significance level in a twotailed test, the critical values are approximately ±1.96. The significance level (probability) and critical value (Zscore) can be converted with each other the Zdistribution table or use our Z/P converter.
Using the above examples, if the computed Zscores 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 Ztest is applied in different scenarios to test hypotheses concerning population means.