Hypothesis Testing
Hypothesis Testing
Hypothesis testing is a tool for making statistical inferences about the population data. It is an
analysis tool that tests assumptions and determines how likely something is within a given
standard of accuracy. Hypothesis testing provides a way to verify whether the results of an
experiment are valid.
A null hypothesis and an alternative hypothesis are set up before performing the hypothesis
testing. This helps to arrive at a conclusion regarding the sample obtained from the population.
In this article, we will learn more about hypothesis testing, its types, steps to perform the testing,
and associated examples
Hypothesis testing can be defined as a statistical tool that is used to identify if the results of an
experiment are meaningful or not. It involves setting up a null hypothesis and an alternative
hypothesis. These two hypotheses will always be mutually exclusive. This means that if the null
hypothesis is true then the alternative hypothesis is false and vice versa. An example of
hypothesis testing is setting up a test to check if a new medicine works on a disease in a more
efficient manner.
1
Null Hypothesis:
The null hypothesis is a concise mathematical statement that is used to indicate that there is no
difference between two possibilities. In other words, there is no difference between certain
characteristics of data. This hypothesis assumes that the outcomes of an experiment are based on
chance alone. It is denoted as H0H0. Hypothesis testing is used to conclude if the null hypothesis
can be rejected or not. Suppose an experiment is conducted to check if girls are shorter than boys
at the age of 5. The null hypothesis will say that they are the same height.
Examples:
Alternative Hypothesis:
The alternative hypothesis is an alternative to the null hypothesis. It is used to show that the
observations of an experiment are due to some real effect. It indicates that there is a statistical
significance between two possible outcomes and can be denoted as H1H1 or HaHa. For the
above-mentioned example, the alternative hypothesis would be that girls are shorter than boys at
the age of 5.al
Examples:
Test Statistic:
A test statistic is a numerical value calculated from sample data during a hypothesis test. It is
used to decide whether to reject or fail to reject the null hypothesis (H₀).
2
Definition:
A test statistic measures how much the sample data differs from what we would expect if the null
hypothesis were true.It helps us compare the sample result to a theoretical distribution (like the
normal, t, or chi-square distribution) to determine if the difference is significant or due to random
chance.
This formula can change depending on the type of test (z-test, t-test, etc.).
A z test is a way of hypothesis testing that is used for a large sample size (n ≥ 30). It is used to
determine whether there is a difference between the population mean and the sample mean when
the population standard deviation is known. It can also be used to compare the mean of two
samples. It is used to compute the z test statistic. The formulas are given as follows:
3
Hypothesis Testing t Test:
The t test is another method of hypothesis testing that is used for a small sample size (n < 30). It
is also used to compare the sample mean and population mean. However, the population standard
deviation is not known. Instead, the sample standard deviation is known. The mean of two
samples can also be compared using the t test.
The Chi square test is a hypothesis testing method that is used to check whether the variables in a
population are independent or not. It is used when the test statistic is chi-squared distributed.
Hypothesis testing can be easily performed in five simple steps. The most important step is to
correctly set up the hypotheses and identify the right method for hypothesis testing. The basic
steps to perform hypothesis testing are as follows:
Step 1: Set up the null hypothesis by correctly identifying whether it is the left-tailed,
right-tailed, or two-tailed hypothesis testing.
Step 3: Choose the correct significance level, αα, and find the critical value.
Step 4: Calculate the correct test statistic (z, t or χχ) and p-value.
Step 5: Compare the test statistic with the critical value or compare the p-value
with αα to arrive at a conclusion. In other words, decide if the null hypothesis is to be
rejected or not.
4
Example:
Suppose a company claims the average delivery time is 30 minutes. You collect a sample and
find the average is 35 minutes. You can calculate a test statistic to see if the 5-minute difference
is statistically significant or just due to chance.
The critical region is a range of values for the test statistic that leads to rejection of H₀. It
depends on the significance level (α), which is usually set at 0.05 (5%).
Example:
The critical region is split into two tails of the standard normal distribution.
Each tail has 2.5% area.
The critical values are approximately ±1.96.
So, if your z-statistic > 1.96 or < -1.96, it falls in the critical region, and you reject H₀.
The critical region helps determine whether the evidence is strong enough to reject the null
hypothesis. It is based on the chosen significance level and type of test.
5
One Tailed Hypothesis Testing
One tailed hypothesis testing is done when the rejection region is only in one direction. It can
also be known as directional hypothesis testing because the effects can be tested in one direction
only. This type of testing is further classified into the right tailed test and left tailed test.
The right tail test is also known as the upper tail test. This test is used to check whether the
population parameter is greater than some value. The null and alternative hypotheses for this test
are given as follows:
If the test statistic has a greater value than the critical value then the null hypothesis is rejected
The left tail test is also known as the lower tail test. It is used to check whether the population
parameter is less than some value. The hypotheses for this hypothesis testing can be written as
follows:
6
The null hypothesis is rejected if the test statistic has a value lesser than the critical value.
In this hypothesis testing method, the critical region lies on both sides of the sampling
distribution. It is also known as a non - directional hypothesis testing method. The two-tailed test
is used when it needs to be determined if the population parameter is assumed to be different
than some value. The hypotheses can be set up as follows:
The null hypothesis is rejected if the test statistic has a value that is not
7
Type I and Type II Errors:
In hypothesis testing, errors can occur when making decisions about the null hypothesis (H₀).
These errors are called Type I and Type II errors.
Example:
A pregnancy test says you're pregnant, but you're not.
In hypothesis terms:
Rejecting H₀ when H₀ is actually true.
Occurs when the null hypothesis is false, but we fail to reject it.
In simple terms: We say there is no effect, but in reality, there is one.
Probability of this error is called beta (β).
8
Example:
A pregnancy test says you're not pregnant, but you are.
In hypothesis terms:
Not rejecting H₀ when H₀ is actually false.
🔹 Summary Table:
Fail to Reject
✅ Correct Decision Type II Error (β)
H₀
🔹 Visual Analogy: