top of page

Welcome
to NumpyNinja Blogs

NumpyNinja: Blogs. Demystifying Tech,

One Blog at a Time.
Millions of views. 

Hypothesis Testing 

 


PicCourtesy:iStock
PicCourtesy:iStock

In today’s data driven world, decisions and assumptions are always based on data. Hypothesis plays a very crucial role in this scenario. Before making decisions we need to make sure the conclusions we reached is correct or not. This is where Hypothesis testing evolves and comes into application 


What is Hypothesis Testing? 

Hypothesis testing is a statistical method used to make decisions or draw conclusions about a population based on sample data. It evaluates whether the data provides enough evidence to support specific claim/hypothesis 


Before diving into details of hypothesis testing and its application, let me explain to you in simple words what a hypothesis means scientifically 

A hypothesis is a prediction that can be tested through experiments or observation 


Mainly 2 types of Hypotheses 

Scientific Hypothesis 

Eg: If a plant receives water and sunlight then it grows faster 


Statistic Hypothesis 

It could be explained more with an example: 

A doctor believes that intermittent fasting is good for 80% of his diabetic patient 

Statistical analysts validate their assumptions by collecting and evaluating the sample from the data set collected for research  

A statistical hypothesis test is a method of statistical inference used to decide whether the data provide sufficient evidence to reject a particular hypothesis 


Applications of Hypothesis Testing 

1) Testing Research Hypothesis 

Eg:  Testing if a new drug is more effective than the old one 

2) Testing validity of a claim 

Eg : A manufacturer claims that 1Lite soft drinks are filled with an avg of at least .99L 

3) Testing business decisions 

Eg: A new online ad led to higher online conversion rate like making purchase, downloading apps etc 


Objective of Hypothesis Testing 

The objective is to set value for the parameter and perform a statistical TEST to see whether the value is tenable in the light of evidence gathered from the sample 

 

Basic Concepts of Hypothesis testing 


Stating Hypothesis – How are the two parts of the hypothesis framed 


Null and alternative Hypothesis-Two mutually exclusive statement about the population parameter 

1) Null Hypothesis (H0) 

  • Presumed current state of the matter. 

  • Represents the default assumption to be tested against evidence from sample data 

  • It represents what is it i am going to test my data against 

  • We are always trying to disprove the Null Hypothesis and prove Alternative hypothesis 

  • In the absence of data, null hypothesis stands 


2) Alternative Hypothesis (Ha) 

  • Represents the claim we want to test/provide evidence for 

  • Contradicts the Null Hypothesis 

  • Alternative hypothesis needs to be established using the data 


 


Tips to formulate Null and Alternate Hypothesis
Tips to formulate Null and Alternate Hypothesis

Null and Alternative Formulation : Example 

Mean length of lumber is specified to be 8.5m for a certain building project. A construction engineer wants to make sure the shipments arrived adhere to that specification 

Population parameter used here id population mean μ 

Hypotheses are H0: μ =8.5 

       Ha: μ ≠ 8.5 


Null Hypothesis is assumed to be true unless we have strong evidence to say it can be rejected or it is wrong 


  • If Evidence is strong -  Satisfies the predetermined decision rule 

    •   Reject the null hypothesis  

  • If Evidence is not strong –does not satisfy predetermined decision rule 

    • Failed to reject null hypothesis  

Decision to reject or not reject is based on a test statistic 


Test statistic: -  

It is a numerical value calculated from sample data and tested against the predetermined

Decision Rule. The test statistic is a random variable that follows a standard distribution such as Normal ,t,F,Chi-Sqaure etc. Sometimes tests are named after the test statistic 


Decision rule decides whether we reject /fail to reject null hypothesis .Decisions made on basis of test statistic are obviously probabilistic as they are based on distributions . So its the probabilistic outcomes that the hypothesis testing generates. Hence it is very important to understand the errors associated with hypothesis testing . So we must frame these probabilities now. These probabilities go by the name Type I and Type II Errors. Why error??This is because they are linked with certain mistakes we made in our decisions 


Type I and Type II Error 

 


Type I and Type II Errors
Type I and Type II Errors

All possible outcomes


All the possible outcomes from the above chart
All the possible outcomes from the above chart

 

 

  • Type I Error 

    Rejecting Null Hypothesis when it is actually true

    eg: Saying that a person doesn't have cancer,but the patient actually does as per doctor


  • Type II Error 

    Failing to reject Null Hypothesis when it is actually false

    eg: Saying that a person does have cancer,but the patient actually doesn't


  • Power of Test(1-β)

    Probability of correctly rejecting a false NULL hypothesis



Hypothesis Testing Template


1) Identify the key question - What is the research question you are trying to answer?

2) Establish the hypotheses - > Define null and alternate hypothesis

3) Understand and prepare the data - >What data do you have can it be used directly?

4) Identify the right test- >Choose the method for testing based on tht previous steps

5) Check the assumptions -> Ensure the data satisfies the assumption for the test

6) Perform the test ->Get to a conclusion based on the results


We will go into the details of this template in another blog


 Conclusion

Hypothesis testing is a powerful tool that bridges raw data and informed decisions. In today's data-driven world, relying on gut feeling is no longer sufficient—decisions must be backed by statistical evidence. By understanding the roles of null and alternative hypotheses, test statistics, and potential errors (Type I and Type II), we can draw meaningful conclusions from sample data with clarity and confidence.


Whether it's validating a business strategy, evaluating a scientific claim, or verifying product quality, hypothesis testing provides a structured framework to assess assumptions objectively. In the next blog, we’ll dive deeper into applying the full hypothesis testing process step-by-step using real-world examples and statistical tests.

+1 (302) 200-8320

NumPy_Ninja_Logo (1).png

Numpy Ninja Inc. 8 The Grn Ste A Dover, DE 19901

© Copyright 2025 by Numpy Ninja Inc.

  • Twitter
  • LinkedIn
bottom of page