Introduction




You might have come across the question, what is hypothesis testing? several times before going to study inferential statistics. That's because you should learn about hypothesis testing and hypothesis testing examples.

This is a complete guide for a beginner who wanted to know what the basics of hypothesis testing are. The following terms you will learn in this article.


What is Hypothesis Testing?

A statistical hypothesis is a claim that is to be tested based on the inferences of the given data. The whole testing procedure is known as statistical hypothesis testing.

Here the data refers to the random sample drawn from the population under study.

In hypothesis testing, a researcher is testing the chosen random sample with the goal of providing evidence on whether to reject or fail to reject the null hypothesis.


What are the null and the alternative hypotheses?

In any statistical testing, there are two types of hypotheses namely, the null hypothesis and the alternative hypothesis. The null hypothesis is the hypothesis of no difference while the alternative hypothesis is exactly the opposite of the null hypothesis. Both hypotheses contradict each other. Hence, after carrying out all the testing procedures we accept/reject either of these two hypotheses.

  • The null and the alternative hypotheses are denoted by H0 and H1 respectively.
  • The null hypothesis always contains an equality sign, that is, either “=” or “≥” or “≤” signs. While the alternative hypothesis contains either “≠” or “<” or “>” signs.
  • We decide the tail of the test based on the sign in the alternative hypothesis (H1).

If H1 contains the “≠” sign, then it is a two-tailed test. If H1 contains the “<” sign, then it is a left-tailed test. If H1 contains the ">” sign, then it is a right-tailed test.


Real-life situations

Suppose a researcher is studying the difference between the average heights of males and females in a certain city. Then the null hypothesis would be that the average heights of males and females are the same while the alternative hypothesis would be the average heights of males and females are different.

Suppose a gambler is playing a game in a casino and he expects that the game is fair. In this situation, the null hypothesis would be the chance of winning the game is 50% while the alternative hypothesis would be the chance of winning the game is different from 50%.


Parameter Vs Statistic

A parameter is a descriptive measure of the entire population while a statistic is a descriptive measure of a selected sample.

There are mainly two types of hypothesis testing: Parametric testing and non-parametric testing.

 

Steps of parametric hypothesis testing

  1. Fix the null and alternative hypotheses.
  2. Decide the test statistic.
  3. Fix the significance level (α).
  4. Calculate the critical value/ p-value.
  5. Make the decision based on critical value/ p-value.
  6. Write the conclusion based on the decision.

Types of error

We fix the null and alternative hypotheses at the beginning of the testing procedure. There are two possibilities for a population, either the null hypothesis is actually true or the null hypothesis is actually false. After carrying out all the testing procedures, researchers either reject the null hypothesis or fail to reject the null hypothesis. Hence, the following four conditions can arise.

  1. The researcher rejects the null hypothesis when it is actually false. This is the correct decision.
  2. The researcher rejects the null hypothesis when it is actually true. This is an error while making a decision. Such an error is called a “Type I error”.
  3. The researcher accepts the null hypothesis when it is actually false. This is also an error while making a decision. Such an error is called a “Type II error”.
  4. The researcher accepts the null hypothesis when it is actually true. This is the correct decision.

 This can be tabulated as follows.




  • The significance level (α) is the probability of committing a Type I error. That is, P(Type I error) = α while P(Type II error) = ß.
  • The power of the hypothesis test is the probability of correctly rejecting a false null hypothesis. This gives, power = 1 – P(Type II error) = 1 – ß.

P-value

The P-value for hypothesis testing plays an important role in making decisions (whether to reject the null hypothesis or not). The p-value can be interpreted as the probability of observing the test statistic as extreme as or more extreme than the calculated value.

Let α be the level of significance then the decision rule based on the p-value for a statistical hypothesis testing is as follows.

“If the p-value ≤ α then reject the null hypothesis otherwise fail to reject the null hypothesis.”