What is Hypothesis Testing ?

Sandeep Bansal
Analytics Vidhya
Published in
3 min readDec 27, 2021

--

Hypothesis testing is a statistical method that is used in making statistical decisions using experimental data. Hypothesis Testing is basically an assumption that we make about the population parameter.

Why do we use Hypothesis Testing?

Hypothesis testing is an essential procedure in statistics.
A hypothesis test evaluates two mutually exclusive statements about a population to determine which statement is best supported by the sample data. When we say that a finding is statistically significant, it’s thanks to a hypothesis test.

Null hypothesis : In inferential statistics, the null hypothesis is a general statement or default position that there is no relationship between two measured phenomena, or no association among groups In other words it is a basic assumption or made based on domain or problem knowledge.

Alternative hypothesis :
The alternative hypothesis is the hypothesis used in hypothesis testing that is
contrary to the null hypothesis.It is usually taken to be that the observations are the result of a real effect (with some amount of chance variation superposed.

T- Test :

A t-test is a type of inferential statistic which is used to determine
if there is a significant difference between the means of two groups which may be related in certain features. It is mostly used when the data sets, like the set of data recorded as outcome from flipping a coin a 100 times,
would follow a normal distribution and may have unknown variances. T test is used as a hypothesis testing tool, which allows testing of an assumption applicable to a population.

T-test has 2 types :
1. one sampled t-test
2. two-sampled t-test

One Sampled T-Test:

The One Sample T Test determines whether the sample mean is statistically different from a known or hypothesized population mean. The One Sample T Test is a parametric test. Example: You have 10 ages and you are checking whether average age is 30 or not.

Two Sample T-Test

A two sample-t-test is used to test whether or not the mean of two populations are equal. For example: Let’s say we would like to know whether or not two different types of plants have the same mean in terms of their height. Below we have two groups of plants.

Our Null Hypothesis will be:

H0: µ1 = µ2 (the two population means are equal)

Our Alternative Hypothesis will be:

HA: µ1 ≠µ2 (the two population means are not equal)

However before we conduct the test we must if we’ll assume the two populations have equal variances or not. According to Statology “As a rule of thumb we can assume the populations have equal variances if the ratio of the larger sample variance to the smaller sample variance is less than 4:1. Lets find the variance!

Since the ratio of the larger sample variance to smaller sample variance is 12.26 / 7.73 = 1.586, we can assume that the population variances are equal.

Thus we can conduct our two-sample-test with equal variances:

Because the p-value of our test (0.53005) is greater than alpha = 0.05, we fail to reject the null hypothesis of the test. We do not have sufficient evidence to say that the mean height of plants between the two populations is different

Thanks for reading!

--

--

Sandeep Bansal
Analytics Vidhya

A clumsy hard working goof & a contributing Author to Analytics Vidya; A leading community of Analytics, Data Science and AI professionals