**Introduction**

Generally, we use Hypothesis testing to make statistical decisions using experimental data. Hypothesis Testing is an assumption that we make about the population parameter.

Hypothesis testing is an essential part of statistics. We use a hypothesis test to evaluate which of the two mutually exclusive statements about a population is best supported by the sample data.

**Basics of Hypothesis Testing**

**Null Hypothesis**

Statistical hypothesis tests are based on a null hypothesis statement that assumes no relationship or association between whatever variables you are testing. The Null hypothesis is a basic assumption made on domain knowledge. For example, the average age of students in class is eighteen.

**Alternative hypothesis**

Hypothesis testing aims to determine whether the null hypothesis is true or not on a given sample data. If there is enough evidence supporting the null hypothesis given the data, we accept the null hypothesis. Otherwise, if the null hypothesis is unlikely given the data, we might reject the null in favor of the alternative hypothesis.

We use the alternative hypothesis in hypothesis testing contrary to the null hypothesis. We generally consider that the observations result from a real effect. From the example above, the average age of students is not eighteen.

**Level of Significance**

Once we have the null and alternative hypothesis in hand, we choose a significance level. It is a probability threshold that determines when you reject the null hypothesis. It is impossible to have 100% accuracy for accepting or rejecting a hypothesis. Therefore, we select a level of significance that is usually 5%, which means our output should be 95% confident to give a similar result in each sample.

**P-value**

After carrying out a test, we reject the null hypothesis if the probability of getting a result as extreme is less than the significance level. The likelihood of seeing a result as extreme or more extreme than the one observed is the p-value.

The P-value is the likelihood of finding the observed, or more extreme, results when the null hypothesis of a study question is true — the definition of ‘extreme’ depends on how we test the hypothesis.

If the P-value is less than the chosen significance level, we reject the null hypothesis, i.e., accept that our sample gives reasonable evidence to support the alternative hypothesis.

**Type I error**

Type I error occurs when we reject the null hypothesis, even when the Null hypothesis is confirmed. Type I error is denoted by alpha. The normal curve that shows the critical region is called the alpha region in hypothesis testing.

**Type II error**

When we accept the null hypothesis, it is false. We denote Type II errors by beta. In Hypothesis testing, the normal curve that shows the acceptance region is called the beta region.

Now let us see some of the widely used hypothesis testing types:-