DEV Community

Maureen Njeri
Maureen Njeri

Posted on

Hypothesis Testing - Why and when we use it

In this article, I will talk about what hypothesis testing is, why and when it is used.

1. What is a hypothesis?

In simple terms, a hypothesis is a guess where one draws conclusions based on their findings.

In Statistics, a hypothesis is a statement about the parameters of one or more populations.

The truth or fallacy of a statistical hypothesis is usually unknown unless we examine the entire population. Since this is impractical in most cases, we take a random sample from the population we are interested in and use the data in the sample to come up with evidence that either supports or doesn't support the hypothesis.

Inconsistent evidence from the sample stated in the hypothesis leads to rejection of the hypothesis whereas evidence supporting the hypothesis leads to acceptance. Since we don't use the word "acceptance" in statistical hypothesis, we say we "fail to reject the hypothesis".

The structure of hypothesis testing is formulated using the term "null hypothesis" which refers to any hypothesis we wish to test. It is denoted by "Ho".

The rejection of our Ho leads to the failure to reject our alternate hypothesis, denoted by H1. The alternate hypothesis is the educated guess the researcher wishes to support.

A null hypothesis (Ho) concerning a population parameter will always be stated to specify the exact value of the parameter, whereas the alternate hypothesis (H1) allows for the possibility of several values.

Therefore, if a = 0.5 for the null hypothesis (Ho) of a population, the alternate hypothesis (H1) could be one of the following:

  • a < 0.5
  • a > 0.5
  • a != 0.5 (p not equal to 0.5)

2. Why and when use statistical hypothesis

We use hypothesis testing when we want to make data-driven decisions by determining whether or not there is enough statistical evidence to support a claim about a population.

This helps a researcher validate their findings and reduce uncertainty.

More often than not, we use the sampling method to study an entire population, as collecting data from everyone can prove to be time-consuming, costly, impractical or even impossible.

Conclusion

In sum, the steps to coming up with a hypothesis test are:

  • Define the hypothesis (your null (Ho) and alternate (H1) hypotheses).
  • Choose a significance level (the risk of rejecting a true null hypothesis). You can choose one of these levels: 0.05 0.1 and 0.01. The most commonly used in statistics is 0.05.
  • Perform your test depending on the size of your data. You can choose to perform a z-test, a one-sample t-test or two-sample t-test.
  • Interpret your results. If the p-value is less than the 0.05 significance level, you null hypothesis is rejected, meaning there statistical significance in the variables in your data.

Otherwise, if the the p-value is greater than the 0.05 significance, you fail to reject the null hypothesis, impying that there is no statistical significance in the variables in your data.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay