Hypothesis Testing Formula (Table of Contents)
What is the Hypothesis Testing Formula?
Before we deep dive into hypothesis testing, we need to understand what is hypothesis at first place. In a very simple language, a hypothesis is basically an educated and informed guess about anything around you, which can be tested by experiment or simply by observation. For example, A new variant of mobile will be accepted by people or not, new medicine might work or not, etc. So hypothesis test is a statistical tool for testing that hypothesis which we will make and if that statement is meaning full or not. Basically, we select a sample from the data set and test a hypothesis statement by determining the likelihood that a sample statistics. So If your results from that test are not significant, it means that the hypothesis is not valid.
Formula For Hypothesis Testing:
Hypothesis testing is given by the z test. The formula for Z – Test is given as:
Where:
 X – Sample Mean
 U – Population Mean
 SD – Standard Deviation
 n – Sample size
But this is not so simple as it seems. To correctly perform the hypothesis test, you need to follow certain steps:
Step 1: First and foremost thing to perform a hypothesis test is that we have to define the null hypothesis and alternative hypothesis. Example of the null and alternate hypothesis is given by:
 H0 (null hypothesis): Mean value > 0
 For this, Alternate Hypothesis (Ha): Mean < 0
Step 2: Next thing we have to do is that we need to find out the level of significance. Generally, its value is 0.05 or 0.01
Step 3: Find the z test value also called test statistic as stated in the above formula.
Step 4: Also, find the z score from z table given the level of significance and mean.
Step 5: Compare these two values and if test statistic greater than z score, reject the null hypothesis. In case test statistic is less than z score, you cannot reject the null hypothesis.
Examples of Hypothesis Testing Formula (With Excel Template)
Let’s take an example to understand the calculation of Hypothesis Testing formula in a better manner.
Hypothesis Testing Formula – Example #1
Suppose you have been given the following parameters and you have to find the Z value and state if you accept the null hypothesis or not:
Solution:
Null hypothesis H0: Population Mean = 30
Alternate hypothesis Ha: Population Mean ≠ 30
Z – Test is calculated using the formula given below
Z = (X – U) / (SD / √n)
 Z – Test = ( 27 – 30 ) / (20 / SQRT(10))
 Z – Test = 0.474
Level of significance = 0.05
This is a Two tail test, so the probability lies on both side of the distribution. So 0.025 each side and we will look at this value on the z table.
Z table:
Source: http://www.ztable.com/
Since the level of significance is 0.025 each side, we need to find 0.025 in the z table. Once we find that value from the table, we need to extract z value.
If you see here, on the left side the values of z are given and in the top row, decimal places are given. So from that, we can say that 0.025 will give z value of 1.96
So Z – Score = 1.96
Since the Z Test > Z Score, we can reject the null hypothesis.
Hypothesis Testing Formula – Example #2
Let’s say you are a principal of a school you are claiming that the students in your school are above average intelligence. An analyst wants to double check your claim and use hypothesis testing. He measures the IQ of all the students in the school and then takes a sample of 20 students. Following is the data points:
Data Set:
Z – Test is calculated using the formula given below
Z = (X – U) / (SD / √n)
 Z – Test = (112 – 110)/ (15 / SQRT(20))
 Z – Test = 3.58
Null Hypothesis : Since population mean = 100,
 H0 : Mean = 100
 Ha: Mean > 100
Level of Significance = 0.05
Since the level of significance is 0.05, we need to find 1 – 0.05 =0.95 in the z table. Once we find that value from the table, we need to extract z value.
Z – Table:
Source: http://www.ztable.com/
If you see here, on the left side the values of z are given and in the top row, decimal places are given. So from that, we can say that 0.95 lies between 1.64 to 1.65, midpoint in 1.645.
So Z Score = 1.645
Since the Z Test > Z Score, we can reject the null hypothesis and can say that students intelligence is above average.
Explanation
One thing everyone should keep in mind that No hypothesis test is 100% correct and there is always a chance of making an error. There is 2 type of errors which can arise in hypothesis testing: type I and type II.
Type 1: When the null hypothesis is true but it is rejected in the model. The probability of this is given by the level of significance. So if the level of significance is 0.05, there is a 5% chance that you will reject the null which is true.
Type 2: When the null hypothesis is not true but it is not rejected in the model. The probability of this is given the power of the test. This probability of occurrence of this type of error can be reduced by having sample which is large enough to give us confidence about the model.
Relevance and Uses of Hypothesis Testing Formula
As discussed above, the hypothesis test helps the analyst in testing the statistical sample and at the end will either accept or reject the null hypothesis. So the test helps in understanding the hypothesis formed is true or not and if not then the new hypothesis can be formed and tested again. There are steps for any hypothesis test. The first step is to state the hypothesis, both the null and alternate hypothesis. The next step is to determine all the relevant parameters like mean, standard deviation, level of significance, etc. which helps in determining the z test value. The third step determines the z score from the z table and for this step, we need to see is it two tail or single tail test and accordingly extract z score. The fourth and final step is to compare the results and then based on that either accept or reject the null hypothesis.
Hypothesis Testing Formula Calculator
You can use the following Hypothesis Testing Calculator
X  
U  
SD  
√n  
Z  
Z = 


Recommended Articles
This has been a guide to Hypothesis Testing Formula. Here we discuss how to calculate Hypothesis Testing along with practical examples. We also provide Hypothesis Testing calculator with downloadable excel template. You may also look at the following articles to learn more –
 Examples of T Distribution Formula
 Calculator For Consumer Surplus Formula
 How To Calculate Equity Multiplier Formula
 Guide To Net Realizable Value Formula
 Altman Z Score (With Excel Template)
250+ Online Courses  1000+ Hours  Verifiable Certificates  Lifetime Access
4.9
View Course
Related Courses