logo image missing

  • > Machine Learning
  • > Statistics

What is Hypothesis Testing? Types and Methods

  • Soumyaa Rawat
  • Jul 23, 2021

What is Hypothesis Testing? Types and Methods title banner

Hypothesis Testing  

Hypothesis testing is the act of testing a hypothesis or a supposition in relation to a statistical parameter. Analysts implement hypothesis testing in order to test if a hypothesis is plausible or not. 

In data science and statistics , hypothesis testing is an important step as it involves the verification of an assumption that could help develop a statistical parameter. For instance, a researcher establishes a hypothesis assuming that the average of all odd numbers is an even number. 

In order to find the plausibility of this hypothesis, the researcher will have to test the hypothesis using hypothesis testing methods. Unlike a hypothesis that is ‘supposed’ to stand true on the basis of little or no evidence, hypothesis testing is required to have plausible evidence in order to establish that a statistical hypothesis is true. 

Perhaps this is where statistics play an important role. A number of components are involved in this process. But before understanding the process involved in hypothesis testing in research methodology, we shall first understand the types of hypotheses that are involved in the process. Let us get started! 

Types of Hypotheses

In data sampling, different types of hypothesis are involved in finding whether the tested samples test positive for a hypothesis or not. In this segment, we shall discover the different types of hypotheses and understand the role they play in hypothesis testing.

Alternative Hypothesis

Alternative Hypothesis (H1) or the research hypothesis states that there is a relationship between two variables (where one variable affects the other). The alternative hypothesis is the main driving force for hypothesis testing. 

It implies that the two variables are related to each other and the relationship that exists between them is not due to chance or coincidence. 

When the process of hypothesis testing is carried out, the alternative hypothesis is the main subject of the testing process. The analyst intends to test the alternative hypothesis and verifies its plausibility.

Null Hypothesis

The Null Hypothesis (H0) aims to nullify the alternative hypothesis by implying that there exists no relation between two variables in statistics. It states that the effect of one variable on the other is solely due to chance and no empirical cause lies behind it. 

The null hypothesis is established alongside the alternative hypothesis and is recognized as important as the latter. In hypothesis testing, the null hypothesis has a major role to play as it influences the testing against the alternative hypothesis. 

(Must read: What is ANOVA test? )

Non-Directional Hypothesis

The Non-directional hypothesis states that the relation between two variables has no direction. 

Simply put, it asserts that there exists a relation between two variables, but does not recognize the direction of effect, whether variable A affects variable B or vice versa. 

Directional Hypothesis

The Directional hypothesis, on the other hand, asserts the direction of effect of the relationship that exists between two variables. 

Herein, the hypothesis clearly states that variable A affects variable B, or vice versa. 

Statistical Hypothesis

A statistical hypothesis is a hypothesis that can be verified to be plausible on the basis of statistics. 

By using data sampling and statistical knowledge, one can determine the plausibility of a statistical hypothesis and find out if it stands true or not. 

(Related blog: z-test vs t-test )

Performing Hypothesis Testing  

Now that we have understood the types of hypotheses and the role they play in hypothesis testing, let us now move on to understand the process in a better manner. 

In hypothesis testing, a researcher is first required to establish two hypotheses - alternative hypothesis and null hypothesis in order to begin with the procedure. 

To establish these two hypotheses, one is required to study data samples, find a plausible pattern among the samples, and pen down a statistical hypothesis that they wish to test. 

A random population of samples can be drawn, to begin with hypothesis testing. Among the two hypotheses, alternative and null, only one can be verified to be true. Perhaps the presence of both hypotheses is required to make the process successful. 

At the end of the hypothesis testing procedure, either of the hypotheses will be rejected and the other one will be supported. Even though one of the two hypotheses turns out to be true, no hypothesis can ever be verified 100%. 

(Read also: Types of data sampling techniques )

Therefore, a hypothesis can only be supported based on the statistical samples and verified data. Here is a step-by-step guide for hypothesis testing.

Establish the hypotheses

First things first, one is required to establish two hypotheses - alternative and null, that will set the foundation for hypothesis testing. 

These hypotheses initiate the testing process that involves the researcher working on data samples in order to either support the alternative hypothesis or the null hypothesis. 

Generate a testing plan

Once the hypotheses have been formulated, it is now time to generate a testing plan. A testing plan or an analysis plan involves the accumulation of data samples, determining which statistic is to be considered and laying out the sample size. 

All these factors are very important while one is working on hypothesis testing.

Analyze data samples

As soon as a testing plan is ready, it is time to move on to the analysis part. Analysis of data samples involves configuring statistical values of samples, drawing them together, and deriving a pattern out of these samples. 

While analyzing the data samples, a researcher needs to determine a set of things -

Significance Level - The level of significance in hypothesis testing indicates if a statistical result could have significance if the null hypothesis stands to be true.

Testing Method - The testing method involves a type of sampling-distribution and a test statistic that leads to hypothesis testing. There are a number of testing methods that can assist in the analysis of data samples. 

Test statistic - Test statistic is a numerical summary of a data set that can be used to perform hypothesis testing.

P-value - The P-value interpretation is the probability of finding a sample statistic to be as extreme as the test statistic, indicating the plausibility of the null hypothesis. 

Infer the results

The analysis of data samples leads to the inference of results that establishes whether the alternative hypothesis stands true or not. When the P-value is less than the significance level, the null hypothesis is rejected and the alternative hypothesis turns out to be plausible. 

Methods of Hypothesis Testing

As we have already looked into different aspects of hypothesis testing, we shall now look into the different methods of hypothesis testing. All in all, there are 2 most common types of hypothesis testing methods. They are as follows -

Frequentist Hypothesis Testing

The frequentist hypothesis or the traditional approach to hypothesis testing is a hypothesis testing method that aims on making assumptions by considering current data. 

The supposed truths and assumptions are based on the current data and a set of 2 hypotheses are formulated. A very popular subtype of the frequentist approach is the Null Hypothesis Significance Testing (NHST). 

The NHST approach (involving the null and alternative hypothesis) has been one of the most sought-after methods of hypothesis testing in the field of statistics ever since its inception in the mid-1950s. 

Bayesian Hypothesis Testing

A much unconventional and modern method of hypothesis testing, the Bayesian Hypothesis Testing claims to test a particular hypothesis in accordance with the past data samples, known as prior probability, and current data that lead to the plausibility of a hypothesis. 

The result obtained indicates the posterior probability of the hypothesis. In this method, the researcher relies on ‘prior probability and posterior probability’ to conduct hypothesis testing on hand. 

On the basis of this prior probability, the Bayesian approach tests a hypothesis to be true or false. The Bayes factor, a major component of this method, indicates the likelihood ratio among the null hypothesis and the alternative hypothesis. 

The Bayes factor is the indicator of the plausibility of either of the two hypotheses that are established for hypothesis testing.  

(Also read - Introduction to Bayesian Statistics ) 

To conclude, hypothesis testing, a way to verify the plausibility of a supposed assumption can be done through different methods - the Bayesian approach or the Frequentist approach. 

Although the Bayesian approach relies on the prior probability of data samples, the frequentist approach assumes without a probability. A number of elements involved in hypothesis testing are - significance level, p-level, test statistic, and method of hypothesis testing. 

(Also read: Introduction to probability distributions )

A significant way to determine whether a hypothesis stands true or not is to verify the data samples and identify the plausible hypothesis among the null hypothesis and alternative hypothesis. 

Share Blog :

create a chart of various hypothesis test methods

Be a part of our Instagram community

Trending blogs

5 Factors Influencing Consumer Behavior

Elasticity of Demand and its Types

An Overview of Descriptive Analysis

What is PESTLE Analysis? Everything you need to know about it

What is Managerial Economics? Definition, Types, Nature, Principles, and Scope

5 Factors Affecting the Price Elasticity of Demand (PED)

6 Major Branches of Artificial Intelligence (AI)

Scope of Managerial Economics

Dijkstra’s Algorithm: The Shortest Path Algorithm

Different Types of Research Methods

Latest Comments

create a chart of various hypothesis test methods

Which hypothesis test should I use? A flowchart

Rebecca Barter

December 4, 2018

Many years ago I taught a stats class for which one of the topics was hypothesis testing. Many of the students had a hard time remembering what situation each test was designed for, so I made a flowchart to help piece together the wild world of hypothesis tests.

While the flowchart isn’t pretty (if I made it today, it would be much more attractive), I feel like it might be useful for others, so here it is:

create a chart of various hypothesis test methods

(if you all like it - I’ll make a pretty version!)

MLP Logo

Hypothesis Testing – A Deep Dive into Hypothesis Testing, The Backbone of Statistical Inference

  • September 21, 2023

Explore the intricacies of hypothesis testing, a cornerstone of statistical analysis. Dive into methods, interpretations, and applications for making data-driven decisions.

create a chart of various hypothesis test methods

In this Blog post we will learn:

  • What is Hypothesis Testing?
  • Steps in Hypothesis Testing 2.1. Set up Hypotheses: Null and Alternative 2.2. Choose a Significance Level (α) 2.3. Calculate a test statistic and P-Value 2.4. Make a Decision
  • Example : Testing a new drug.
  • Example in python

1. What is Hypothesis Testing?

In simple terms, hypothesis testing is a method used to make decisions or inferences about population parameters based on sample data. Imagine being handed a dice and asked if it’s biased. By rolling it a few times and analyzing the outcomes, you’d be engaging in the essence of hypothesis testing.

Think of hypothesis testing as the scientific method of the statistics world. Suppose you hear claims like “This new drug works wonders!” or “Our new website design boosts sales.” How do you know if these statements hold water? Enter hypothesis testing.

2. Steps in Hypothesis Testing

  • Set up Hypotheses : Begin with a null hypothesis (H0) and an alternative hypothesis (Ha).
  • Choose a Significance Level (α) : Typically 0.05, this is the probability of rejecting the null hypothesis when it’s actually true. Think of it as the chance of accusing an innocent person.
  • Calculate Test statistic and P-Value : Gather evidence (data) and calculate a test statistic.
  • p-value : This is the probability of observing the data, given that the null hypothesis is true. A small p-value (typically ≤ 0.05) suggests the data is inconsistent with the null hypothesis.
  • Decision Rule : If the p-value is less than or equal to α, you reject the null hypothesis in favor of the alternative.

2.1. Set up Hypotheses: Null and Alternative

Before diving into testing, we must formulate hypotheses. The null hypothesis (H0) represents the default assumption, while the alternative hypothesis (H1) challenges it.

For instance, in drug testing, H0 : “The new drug is no better than the existing one,” H1 : “The new drug is superior .”

2.2. Choose a Significance Level (α)

When You collect and analyze data to test H0 and H1 hypotheses. Based on your analysis, you decide whether to reject the null hypothesis in favor of the alternative, or fail to reject / Accept the null hypothesis.

The significance level, often denoted by $α$, represents the probability of rejecting the null hypothesis when it is actually true.

In other words, it’s the risk you’re willing to take of making a Type I error (false positive).

Type I Error (False Positive) :

  • Symbolized by the Greek letter alpha (α).
  • Occurs when you incorrectly reject a true null hypothesis . In other words, you conclude that there is an effect or difference when, in reality, there isn’t.
  • The probability of making a Type I error is denoted by the significance level of a test. Commonly, tests are conducted at the 0.05 significance level , which means there’s a 5% chance of making a Type I error .
  • Commonly used significance levels are 0.01, 0.05, and 0.10, but the choice depends on the context of the study and the level of risk one is willing to accept.

Example : If a drug is not effective (truth), but a clinical trial incorrectly concludes that it is effective (based on the sample data), then a Type I error has occurred.

Type II Error (False Negative) :

  • Symbolized by the Greek letter beta (β).
  • Occurs when you accept a false null hypothesis . This means you conclude there is no effect or difference when, in reality, there is.
  • The probability of making a Type II error is denoted by β. The power of a test (1 – β) represents the probability of correctly rejecting a false null hypothesis.

Example : If a drug is effective (truth), but a clinical trial incorrectly concludes that it is not effective (based on the sample data), then a Type II error has occurred.

Balancing the Errors :

create a chart of various hypothesis test methods

In practice, there’s a trade-off between Type I and Type II errors. Reducing the risk of one typically increases the risk of the other. For example, if you want to decrease the probability of a Type I error (by setting a lower significance level), you might increase the probability of a Type II error unless you compensate by collecting more data or making other adjustments.

It’s essential to understand the consequences of both types of errors in any given context. In some situations, a Type I error might be more severe, while in others, a Type II error might be of greater concern. This understanding guides researchers in designing their experiments and choosing appropriate significance levels.

2.3. Calculate a test statistic and P-Value

Test statistic : A test statistic is a single number that helps us understand how far our sample data is from what we’d expect under a null hypothesis (a basic assumption we’re trying to test against). Generally, the larger the test statistic, the more evidence we have against our null hypothesis. It helps us decide whether the differences we observe in our data are due to random chance or if there’s an actual effect.

P-value : The P-value tells us how likely we would get our observed results (or something more extreme) if the null hypothesis were true. It’s a value between 0 and 1. – A smaller P-value (typically below 0.05) means that the observation is rare under the null hypothesis, so we might reject the null hypothesis. – A larger P-value suggests that what we observed could easily happen by random chance, so we might not reject the null hypothesis.

2.4. Make a Decision

Relationship between $α$ and P-Value

When conducting a hypothesis test:

  • We first choose a significance level ($α$), which sets a threshold for making decisions.

We then calculate the p-value from our sample data and the test statistic.

Finally, we compare the p-value to our chosen $α$:

  • If $p−value≤α$: We reject the null hypothesis in favor of the alternative hypothesis. The result is said to be statistically significant.
  • If $p−value>α$: We fail to reject the null hypothesis. There isn’t enough statistical evidence to support the alternative hypothesis.

3. Example : Testing a new drug.

Imagine we are investigating whether a new drug is effective at treating headaches faster than drug B.

Setting Up the Experiment : You gather 100 people who suffer from headaches. Half of them (50 people) are given the new drug (let’s call this the ‘Drug Group’), and the other half are given a sugar pill, which doesn’t contain any medication.

  • Set up Hypotheses : Before starting, you make a prediction:
  • Null Hypothesis (H0): The new drug has no effect. Any difference in healing time between the two groups is just due to random chance.
  • Alternative Hypothesis (H1): The new drug does have an effect. The difference in healing time between the two groups is significant and not just by chance.
  • Choose a Significance Level (α) : Typically 0.05, this is the probability of rejecting the null hypothesis when it’s actually true

Calculate Test statistic and P-Value : After the experiment, you analyze the data. The “test statistic” is a number that helps you understand the difference between the two groups in terms of standard units.

For instance, let’s say:

  • The average healing time in the Drug Group is 2 hours.
  • The average healing time in the Placebo Group is 3 hours.

The test statistic helps you understand how significant this 1-hour difference is. If the groups are large and the spread of healing times in each group is small, then this difference might be significant. But if there’s a huge variation in healing times, the 1-hour difference might not be so special.

Imagine the P-value as answering this question: “If the new drug had NO real effect, what’s the probability that I’d see a difference as extreme (or more extreme) as the one I found, just by random chance?”

For instance:

  • P-value of 0.01 means there’s a 1% chance that the observed difference (or a more extreme difference) would occur if the drug had no effect. That’s pretty rare, so we might consider the drug effective.
  • P-value of 0.5 means there’s a 50% chance you’d see this difference just by chance. That’s pretty high, so we might not be convinced the drug is doing much.
  • If the P-value is less than ($α$) 0.05: the results are “statistically significant,” and they might reject the null hypothesis , believing the new drug has an effect.
  • If the P-value is greater than ($α$) 0.05: the results are not statistically significant, and they don’t reject the null hypothesis , remaining unsure if the drug has a genuine effect.

4. Example in python

For simplicity, let’s say we’re using a t-test (common for comparing means). Let’s dive into Python:

Making a Decision : “The results are statistically significant! p-value < 0.05 , The drug seems to have an effect!” If not, we’d say, “Looks like the drug isn’t as miraculous as we thought.”

5. Conclusion

Hypothesis testing is an indispensable tool in data science, allowing us to make data-driven decisions with confidence. By understanding its principles, conducting tests properly, and considering real-world applications, you can harness the power of hypothesis testing to unlock valuable insights from your data.

More Articles

F statistic formula – explained, correlation – connecting the dots, the role of correlation in data analysis, sampling and sampling distributions – a comprehensive guide on sampling and sampling distributions, law of large numbers – a deep dive into the world of statistics, central limit theorem – a deep dive into central limit theorem and its significance in statistics, similar articles, complete introduction to linear regression in r, how to implement common statistical significance tests and find the p value, logistic regression – a complete tutorial with examples in r.

Subscribe to Machine Learning Plus for high value data science content

© Machinelearningplus. All rights reserved.

create a chart of various hypothesis test methods

Machine Learning A-Z™: Hands-On Python & R In Data Science

Free sample videos:.

create a chart of various hypothesis test methods

  • Skip to secondary menu
  • Skip to main content
  • Skip to primary sidebar

Statistics By Jim

Making statistics intuitive

Use Control Charts with Hypothesis Tests

By Jim Frost 17 Comments

Typically, quality improvement analysts use control charts to assess business processes and don’t have hypothesis tests in mind. Do you know how control charts provide tremendous benefits in other settings and with hypothesis testing? Spoilers—control charts check an assumption that we often forget about for hypothesis tests!

Before we get to using control charts with hypothesis tests, bear with me while I quickly explain their standard usage in statistical process control (SPC) and quality improvement initiatives.

Control charts plot process data and help you identify common cause and special cause variation. These graphs can determine whether the process is stable and if variability is a problem. If variability is problematic, control charts can determine whether the variability is intrinsic to the process or related to specific sources. By identifying the different sources of variation, you can keep your process stable without over-correction. Control charts guide your remedial actions.

When control charts determine that a process is stable, you can perform additional analyses to draw conclusions about the process. However, an unstable process is unpredictable, and you can’t draw reliable conclusions about its behavior. Any conclusions that you draw today might not be correct tomorrow.

Control charts are linked to business processes, but I’ll make the case that these plots provide tremendous benefits for processes and hypothesis testing that fall outside the realm of quality improvement. I’ll show a real example where control charts gave me a clear answer that would’ve been hard to find otherwise.

Related post : Control Charts: Uses, Example, and Types

Control Charts can Assess Non-Business Processes

The trick to seeing how control charts work in a wide variety of settings is to enlarge your notion of processes to include non-business processes. After all, instability and variability are problems in many other environments. For instance:

  • Teaching is the process of transferring knowledge that is measured by testing.
  • People with diabetes have a process for maintaining blood sugar at a stable level.
  • I had a process for causing research participants to experience impacts of 6 times their body weight.

These processes can be unstable or stable, have some natural variability, and might have special causes of variability. Assessing these issues can help you improve the processes. Just like business processes, if your data aren’t stable, conclusions that you draw using hypothesis tests are unreliable.

Let’s start by showing how control charts can provide crucial information in a non-business process.

The third bullet point above recounts a study that I was a part of. Our study had middle school participants jumping off 24-inch steps 30 times on alternating school days. The research goal was to determine whether these impacts would cause their bone density to increase. We defined the treatment as impacts of six times their body weight. Unfortunately, not all subjects experienced impacts of this magnitude initially.

While the mean of the impacts was above six times the body weight, and a hypothesis test confirmed this, we knew this was not good enough. All subjects should achieve the target impact force.

Using a Control Chart in My Research Study

To devise a solution, I conducted a pilot study and plotted the data from this process on an Xbar-S control chart.

Xbar-S control charts that show that the impact variability is in control but the impact means are not in control.

To interpret this chart, you start by looking at the S chart on the bottom, which displays the variability of each subject’s landing impacts. There are no points outside of the control limits. Consequently, this graph indicates that each subject has their own consistent landing style. This variability is in control.

The Xbar chart on the top shows that the overall mean (6.141) is greater than our target. Unfortunately, data points fall outside of the control limits, which indicate that this process is out of control. Different subjects have dramatically different average landing impacts.

Taken all together, the interpretation of the control chart indicates that some participants have large impacts consistently while others have lower impacts consistently. However, this variability is not intrinsic to the process (common cause variation) but assignable to differences between the participants (special cause variation).

This information guided the corrective measures that we implemented. Had the variability been inherent in the process, we probably would have built higher steps. However, because we could attribute the variability to the subjects, we decided to teach the subjects how to land and have a nurse watch all jumping sessions to provide feedback on the spot. This combination lessened the variability enough so that all impacts were greater than six body weights.

Success! Even though this was not a business process, a control chart provided invaluable information.

This study occurred early in my scientific research career. To learn more about the experiences and challenges I faced in this study, read my post about using applied statistics to expand human knowledge .

Use Control Charts to Test Assumptions for Hypothesis Tests

Controls charts verify the assumption that a process is stable. We don’t usually think of applying this assumption to hypothesis tests. However, data for a hypothesis test must also be stable otherwise the conclusions aren’t reliable.

To illustrate this point, suppose we need to compare test scores between two groups. You can download the CSV data file: 2TControlCharts . To compare the means, we’ll perform a 2-sample t-test. The results are below.

Two-sample t-test results for comparing group A and group B.

Related post : How T-Tests Work

The statistical output shows that group A has a higher mean than group B. Furthermore, the p-value of 0.000 indicates that this difference is statistically significant. Group B’s standard deviation is slightly higher, but this test does not assume they are equal. If you perform normality tests on the samples, you’ll find that both groups are normally distributed . Although, our sample sizes are large enough that we don’t have to worry about this assumption . It all looks good, right?

The I-MR charts tells us another story!

I-MR control charts that indicate that group A is in control.

The I-MR chart for group A indicates that these scores are in control. However, group B has many points that are out-of-control. Group B is unstable, and you can see the negative trend. It is not valid to draw conclusions from the unstable group even though the data satisfies all of the other assumptions. The difference between the two groups is not constant and depends on when you take your measurements.

The I-MR chart for group B displays just one of many types of problems that control charts can detect. Control charts are a valuable addition to your toolbox because other methods can miss these problems.

Using the Different Types of Control Charts

This blog post highlights only the tip of the iceberg for the capabilities of control charts. There are different kinds of control charts you can use based on your data and whether you have subgroups in your data.

For the examples in this post, the Xbar-S and I-MR charts both assess the mean but look at different forms of variability. Additionally, the Xbar-S chart assesses data that are in subgroups while the I-MR chart does not.

There are other types of control charts for other kinds of data. For example, if you are assessing:

  • Proportions, consider using the P Chart before performing a 1 Proportion or 2 Proportion hypothesis test.
  • Count data, consider using the U chart before conducting a 1-Sample or 2-Sample Poisson Rate hypothesis test.

Learn more about control charts even if you’re not working in the field of quality improvement. They can be tremendously helpful when you’re analyzing data and performing hypothesis tests!

Share this:

create a chart of various hypothesis test methods

Reader Interactions

' src=

February 10, 2023 at 9:18 am

I love your practical approach and explanations. And it always frustrated me that too often control charts are taught in control phase of six sigma training. It’s one reason I bifurcated all the tools from the DMAIC general approach and methodology in my training material reference. This is because many of the tools (including control charts) are valuable in different phases. It avoids that “when did we learn that tool?” problem when searching for the tool in the PowerPoint slide dump printouts often used (which I also have abandoned in favor of actual reference material using the Information Mapping (R) methodology).

When I teach hypothesis testing, I emphasize that you always want to visually assess the four “S sounding words” of Shape, Centering, Spread, and Stability for continuous data. 3 of the 4 you can see with a histogram, but stability requires time series. So I introduce control charts in measure phase, and then reinforce it in control phase.

So I have been working hard for some years to counter the situation you mention: “Controls charts verify the assumption that a process is stable. We don’t usually think of applying this assumption to hypothesis tests.”

Kind regards

' src=

May 13, 2022 at 5:09 pm

Yes. You would use a p chart.

' src=

August 12, 2020 at 10:02 am

Is it possible to use control charts for errors generation process evaluation? For example, a web server processes requests from clients, N requests per day. M requests per day fail, i.e. M is number of errors, N>>M. In other words, the server generates a number of errors (failed requests) per day. Can I apply control charts to numbers of failed requests to investigate the error generation process?

' src=

August 6, 2020 at 3:51 pm

Hi Jim, The article is a good demonstration of the use of control charts to test IID. It is also a good demonstration of the need to plot data. A histogram of both A and B on a common axis clearly demonstrates the difference between the two groups. Interestingly, the Shapiro-Wilks test of both group for normality gives p=0.3845 for group B and p=0.082 for group A. This suggests the groups may be considered normal. But normality plots of both groups shows that group A is not normal. The lesson here is that p-values close to the hurdle rate should be carefully scrutinized. If you send me an email address, I will send you the normality plots.

Also, the power curve reports that with 80% power, a difference of +/- 3 units cannot be detected by these data.

' src=

August 6, 2020 at 4:01 pm

Hi Stan, I entirely agree with all your points. Check your email for an email from me. Thanks!

' src=

August 3, 2020 at 8:16 am

Great post, thanks for writing it up! When creating a control chart do we have to plot the observations in the order they were recorded?

Thinking about the sample T-test example in this post, couldn’t we make either population look in control or out of control depending on how we sort and plot the data?

Does the order have to have some intrinsic meaning for a control chart to apply?

August 5, 2020 at 12:29 am

Hi Michael,

You do need to record some time related information about when the data are recorded or when the subject/item completed the process (e.g., manufactured). Basically, there is a need to record time data along with the observations. If it’s an individuals control chart, you’ll need to know the order they were measured/produced. If the chart uses subgroups, you’ll need to record the subgroup to which each observation belongs.

In a nutshell, if you don’t have that time information for each item/subject, you can’t use control charts. That information is crucial for these charts.

Thanks for asking the great question!

' src=

November 30, 2019 at 11:57 am

Can you expand on whether to run two tailed or one tailed hypothesis tests when using control charts?

November 30, 2019 at 5:44 pm

Control charts don’t help you decided whether to use a one-tail or two-tail test. That’s based on theory and goals of the analysis. For more information, read my post about one- and two-tailed hypothesis tests . And, a follow up post about why you should only rarely use one-tailed tests .

' src=

May 26, 2019 at 12:07 pm

Thank you for sharing your knowledge.

I am doing a retrospective study of a process using historical data. These are individual measurements.

1- I assessed the normal distribution of the data. 2- Took the first 100 measurements and plotted them in an I-MR chart. Called it my baseline data. Calculated control limit values. Locked the control limits for next step. 3- I plotted the whole series of historical data (500 values = 100 (previously used in step 2) + 400 (following values)) in a longer I-MR chart.

Then I visually inspect the second I-MR chart and see two things: During 100 extra values (until value 200), values remain within control limits. After that, values start surpassing on and off the upper control limit for the rest of the series. On the other hand, if a look at the general trend of the whole series, I seem to perceive an upward trend from the beginning to the end of the series. The type of regression model that fits best a Response(Y): data vs Predictor (X): time plot is a Quadratic one with an R-Sq = 34%.

MY QUESTION: In order to look for an assignable cause, how can I discriminate if the process (a) became unstable at a specific point in time (value 200) OR actually (b) was drifting upwards from earlier time until it crossed the upper control limit? Are there any statistical tools that could help me determine if I am faced with one situation or the other?

Thank you very much in advance and keep up your good work.

Best regards, Toni

' src=

February 15, 2019 at 1:18 pm

I would like to know the difference between hypothesis testing and statistical process control results. For example, assume there are a number of out-of-control observations in a certain period of a control chart (e.g., annual revenues), if I use the classic hypothesis testing to test the difference between the mean of these out of control points (e.g., 2017 and 2018 revenues) with the mean of the other points in the same chart which are under control (e.g., 2005-2016 revenues), would I get a statistically significant results? And why?

In other words, are classic hypothesis testing and SPC both based on the same statistical theory? Thank you.

February 15, 2019 at 5:08 pm

You use control charts and hypothesis tests for different purposes. While there are some graphs, such as histograms and boxplots , that you can use to illustrate the results of hypothesis tests, that’s not the case with control charts.

The purpose of control charts is to determine whether you obtained your sample from a stable population. If the population isn’t stable (e.g., its mean and/or variance are changing), then any hypothesis test you perform using those data are meaningless. For hypothesis test results to be generalizeable beyond the sample, you must be drawing your samples from stable populations. When the populations are unstable, the results only apply to the moment in time that you obtain the sample because the population is changing. In other words, if you obtained your sample at a different time, the results would be different due to the instability.

So, hypothesis testing and control charts serve different purposes. You can think of control charts as testing one of the underlying assumptions (that’s often unstated) for hypothesis tests.

It’s true that control charts do use some hypothesis test like procedures when it performs various tests on the data to identify out of control points. But, those tests allow the chart to serve its main function of assessing the stability of a population (i.e., its in control).

Looking at your example, you would not use control charts to determine whether the mean revenue is different. However, you could use control charts to determine whether the populations are stable. If they are stable, you can then use a hypothesis test, such as a t-test, to determine whether the difference between means is statistically significant.

' src=

January 24, 2019 at 6:31 pm

Thanks for the response Jim!

So, does the same apply to any control chart (variable/attribute) – comparison of stable processes only to tell the differences are significant?

I know usually for stable processes, variation would be little and will be difficult to tell if there is significant difference. So more sample size the better for picking a timeframe?

I did an ANOVA on 3 periods of different sample sizes and they are significantly different from each other as the variation is more and they are not stable processes.

January 24, 2019 at 11:53 pm

Yes, while it’s not often taught (it should be!), hypothesis tests assume that you are comparing stable samples–that the mean, proportion, variance, etc are not changing.

A stable process doesn’t necessarily have a small variability. It just means that the measure of central tendency (which ever one) and the variability are not changing over the course of the time frame. You can have a sample that has a relatively large variability still be in control as long as it’s stable.

When you do have low variability, you actually have relatively more statistical power. In other words, for a given sample size and effect size, when variability is low, you’ll have a greater chance of detecting an effect if it exists in the population (i.e., greater statistical power).

If you’re performing ANOVA and the variability is notably different, use Welch’s ANOVA. With unequal sample sizes, a good rule of thumb is that if any group has twice the variability of another group, you’re already experiencing results that you can’t trust. When sample sizes are equal, the problems are just starting to occur when you get to that threshold, but you’re past it with unequal sample sizes. So, check the magnitude of the differences between group standard deviations. You can read more about this problem in my post about Welch’s ANOVA . In that post, the comments from December 20 refer to what I write about when problems start occurring.

But, if those groups aren’t stable, it’s hard to trust the results to begin with!

January 23, 2019 at 6:30 pm

Can we use this method other way around. Meaning from a control chart say p-chart select 2 different periods and conduct test for proportions to see if there is any significant difference? A out of control period to a control period? Thanks!

January 24, 2019 at 9:45 am

Hi, you can use a proportions test to compare the difference in proportion between two timeframes. However, you’d still need to be sure that the proportions are in control during each of those timeframes. The proportion can vary between timeframes but each time frame itself should be in control. If the proportion is out of control in one or both timeframes, then you’re not comparing two stable processes each with it’s own proportion. And, statistical significance, or lack thereof, does not indicate whether these timeframes are in control.

So, really you should use both in conjunction with each other to get the full picture. If one or both timeframes are out of control, your data are not satisfying a basic requirement of the proportions test.

I hope this helps!

' src=

September 25, 2017 at 2:57 am

That was very interesting. I can see the usefulness for continuous data; am going to test it using “means” of Likert scales.

Comments and Questions Cancel reply

LEARN STATISTICS EASILY

LEARN STATISTICS EASILY

Learn Data Analysis Now!

LEARN STATISTICS EASILY LOGO 2

A Comprehensive Guide to Hypotheses Tests in Statistics

You will learn the essentials of hypothesis tests, from fundamental concepts to practical applications in statistics.

  • Null and alternative hypotheses guide hypothesis tests.
  • Significance level and p-value aid decision-making.
  • Parametric tests assume specific probability distributions.
  • Non-parametric tests offer flexible assumptions.
  • Confidence intervals provide estimate precision.  

Introduction to Hypotheses Tests

Hypothesis testing is a statistical tool used to make decisions based on data.

It involves making assumptions about a population parameter and testing its validity using a population sample.

Hypothesis tests help us draw conclusions and make informed decisions in various fields like business, research, and science.

Null and Alternative Hypotheses

The null hypothesis (H0) is an initial claim about a population parameter, typically representing no effect or no difference.

The alternative hypothesis (H1) opposes the null hypothesis, suggesting an effect or difference.

Hypothesis tests aim to determine if there is evidence for the null hypothesis rejection in favor of the alternative hypothesis.

Significance Levels and P-values

The significance level (α), often set at 0.05 or 5%, serves as a threshold for determining if we should reject the null hypothesis.

A p-value, calculated during hypothesis testing, represents the probability of observing the test statistic if the null hypothesis is true.

Suppose the p-value is less than the significance level. We reject the null hypothesis, in that case, indicating that the alternative hypothesis is more likely.

Parametric and Non-Parametric Tests

Parametric tests assume the data follows a specific probability distribution, usually the normal distribution. Examples include the Student’s t-test.

Non-parametric tests do not require such assumptions and are helpful when dealing with data that do not meet the assumptions of parametric tests. Examples include the Mann-Whitney U test.

applied-statistics-data-analysis

🎓 Master Data Analysis and Skyrocket Your Career

Find Out the Secrets in Our Ultimate Guide! 💼

Commonly Used Hypotheses Tests

Independent samples t-test:  This analysis compares the means of two independent groups.

Paired samples t-test:  Compares the means of two related groups (e.g., before and after treatment).

Chi-squared test:  Determines if there is a significant association, in a contingency table, between two categorical variables.

Analysis of Variance (ANOVA):  Compares the means of three or more independent groups to determine whether significant differences exist.

Pearson’s Correlation Coefficient (Pearson’s r):  Quantifies the strength and direction of a linear association between two continuous variables.

Simple Linear Regression:  Evaluate whether a significant linear relationship exists between a predictor variable (X) and a continuous outcome variable (y).

Logistic Regression:  Determines the relationship between one or more predictor variables (continuous or categorical) and a binary outcome variable (e.g., success or failure).

Levene’s Test:  Tests the equality of variances between two or more groups, often used as an assumption checks for ANOVA.

Shapiro-Wilk Test:  Assesses the null hypothesis that a data sample is drawn from a population with a normal distribution.

Hypothesis Test Description Application
Compares means of two independent groups Comparing scores of two groups of students
Compares means of two related groups (e.g., before and after treatment) Comparing weight loss before and after a diet program
Determines significant associations between two categorical variables in a contingency table Analyzing the relationship between education and income
Compares means of three or more independent groups Evaluating the impact of different teaching methods on test scores
Measures the strength and direction of a linear relationship between two continuous variables Studying the correlation between height and weight
Determines a significant linear relationship between a predictor variable and an outcome variable Predicting sales based on advertising budget
Determines the relationship between predictor variables and a binary outcome variable Predicting the probability of loan default based on credit score
Tests the equality of variances between two or more groups Checking the assumption of equal variances for ANOVA
Tests if a data sample is from a normally distributed population Assessing normality assumption for parametric tests

Interpreting the Results of Hypotheses Tests

To interpret the hypothesis test results, compare the p-value to the chosen significance level.

If the p-value falls below the significance level, reject the null hypothesis and infer that a notable effect or difference exists.

Otherwise, fail to reject the null hypothesis, meaning there is insufficient evidence to support the alternative hypothesis.

Other Relevant Information

In addition to understanding the basics of hypothesis tests, it’s crucial to consider other relevant information when interpreting the results.

For example, factors such as effect size, statistical power, and confidence intervals can provide valuable insights and help you make more informed decisions.

Effect size

The effect size represents a quantitative measurement of the strength or magnitude of the observed relationship or effect between variables. It aids in evaluating the practical significance of the results. A statistically significant outcome may not necessarily imply practical relevance. At the same time, a substantial effect size can suggest meaningful findings, even when statistical significance appears marginal.

Statistical power

The power of a test represents the likelihood of accurately rejecting the null hypothesis when it is incorrect. In other words, it’s the likelihood that the test will detect an effect when it exists. Factors affecting the power of a test include the sample size, effect size, and significance level. Enhanced power reduces the likelihood of making an error of Type II — failing to reject the null hypothesis when it ought to be rejected.

Confidence intervals

A confidence interval represents a range where the true population parameter is expected to be found with a specified confidence level (e.g., 95%). Confidence intervals provide additional context to hypothesis testing, helping to assess the estimate’s precision and offering a better understanding of the uncertainty surrounding the results.

By considering these additional aspects when interpreting the results of hypothesis tests, you can gain a more comprehensive understanding of the data and make more informed conclusions.

Hypothesis testing is an indispensable statistical tool for drawing meaningful inferences and making informed data-based decisions.

By comprehending the essential concepts such as null and alternative hypotheses, significance levels, p-values, and the distinction between parametric and non-parametric tests, you can proficiently apply hypothesis testing to a wide range of real-world situations.

Additionally, understanding the importance of effect sizes, statistical power, and confidence intervals will enhance your ability to interpret the results and make better decisions.

With many applications across various fields, including medicine, psychology, business, and environmental sciences, hypothesis testing is a versatile and valuable method for research and data analysis.

A comprehensive grasp of hypothesis testing techniques will enable professionals and researchers to strengthen their decision-making processes, optimize strategies, and deepen their understanding of the relationships between variables, leading to more impactful results and discoveries.

Refine your data analysis skills and present meaningful insights with confidence using our latest digital book!

Access FREE samples now and master advanced techniques in data analysis, including optimal sample size determination and effective communication of results.

Don’t miss the chance to immerse yourself in  Applied Statistics: Data Analysis  and unlock your full potential in data-driven decision making.

Click the link to start exploring!

Applied Statistics: Data Analysis

Can Standard Deviations Be Negative?

Connect with us on our social networks.

DAILY POSTS ON INSTAGRAM!

Hypothesis Tests

Similar posts.

Chi Square Calculator

Chi-Square Calculator: Enhance Your Data Analysis Skills

Master the Chi Square Calculator to elevate your data analysis. This guide unpacks the tool’s utility in statistical testing and research.

how to calculate median excel

How to Calculate the Median in Excel – Simple Steps

Master How to Calculate Median in Excel with our step-by-step guide, enhancing your data analysis skills and understanding of central tendency.

can correlation coefficient be negative

Can Correlation Coefficient Be Negative?

Learn if the correlation coefficient can be negative and explore real-world applications in finance, medicine, and sports.

Cramer's V

Cramer’s V and Its Application for Data Analysis

Explore the depths of Cramer’s V for analyzing categorical data relationships in our guide, complete with R and Python applications.

generate a random number

Generate a Random Number

Generate a Random Number with our user-friendly generator! The generated random numbers will be displayed below the button as a list.

Can Standard Deviations Be Negative

Can Standard Deviations Be Negative? Data Analysis Understanding

Discover why standard deviations can’t be negative and deepen your understanding of data analysis in this insightful article.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

create a chart of various hypothesis test methods

create a chart of various hypothesis test methods

  • What DataKleenr Can Do For You
  • How DataKleenr Works
  • DataKleenr Credits
  • Ways to Earn
  • What CorrelViz Can Do For You
  • How CorrelViz Works
  • CorrelViz Credits
  • Book a Call
  • The Hive – Home
  • Course Pricing
  • Membership Pricing
  • Members Area
  • Need Help Subscribing? Start Here
  • How To Enrol on Our Courses
  • Log in to The Hive
  • Reset Hive Password
  • The Captain’s Blog
  • Discover Data

Discover Stats

  • Discover Visualisation

Statistical Hypothesis Testing – 4 Steps to the Correct Test

0    comments

Statistical hypothesis testing can be a daunting task.

It can feel like there are hundreds of hypothesis tests that you could choose from, and many of them you’ve never heard of. It can take years of learning and practice before you get comfortable with statistical hypothesis testing, and knowing when and how to choose the right statistical hypothesis test is no mean feat.

Fortunately, there are ways to shortcut this by having a process, a useful list of hypothesis testing steps and a nice, big statistical test flow chart that you can use to choose the correct statistical test to use in your research.

Here I'm going to give you all three!

Disclosure: This post contains affiliate links. This means that if you click one of the links and make a purchase we may receive a small commission at no extra cost to you. As an Amazon Associate we may earn an affiliate commission for purchases you make when using the links in this page.

You can find further details in our TCs

To get started, I’ll explain what statistical hypothesis testing is, and give you a few statistical hypothesis testing examples.

I’ll explain how you write a good hypothesis, giving you 3 different ways to do it, and I’ll show you the difference between a scientific hypothesis and a statistical hypothesis.

You’ll learn that there are 2 types of statistical hypothesis – Null and Alternative hypotheses, and I’ll explain the difference between them.

Finally, I’ll give you an incredibly useful statistical test flow chart – The Hypothesis Wheel – that will help you in choosing a statistical test for your study, along with the 4 hypothesis testing steps you’ll need along the way.

This post forms part of a series on the 4 types of data in statistics.

For more detail, choose from the options below:

4 Types of Data in Statistics: Introduction

Nominal data, ordinal data, interval data, all 4 types of data compared, statistical hypothesis testing, statistical hypothesis testing - introductory video.

To help you get a good start and as an introduction to this post, I've prepared a short video.

You don't need to have watched the video to understand the post, but it will get your thinking in the right place. Once you've watched it, you'll find there is a lot more detail within the post.

What Is Statistical Hypothesis Testing?

The main purpose of statistics is to test, by observation or experiment, a hypothesis (idea, hunch or educated guess) about something in the world around you.

Statistical hypothesis testing is the use of data to decide between two or more different possibilities to resolve an unknown or uncertain issue. For example, you might want to run an experiment to find out whether a new medicine is effective at treating headaches, compared to a placebo.

Statistical hypothesis testing produces a definite decision about which of the possibilities, based on the data gathered, is more likely to be correct, and is particularly powerful when the answer is not obvious from just glancing at the data.

Statistical Hypothesis Testing

Statistical Hypothesis Testing Examples

You can make a hypothesis about anything at all as long as you can put it to the test.

Typical statistical hypothesis testing examples might be:

  • A new medical treatment you think might work better
  • The election of the next US President
  • Men are taller than women
  • XXWhite toothpaste produces whiter teeth than the leading brand
  • An advertisement is more effective on the right side of a web page than on the left

Hypothesis Testing - Spinning The wheel

Pin it for later

Need to save this for later?

Pin it to your favourite board  and you can get back to it when you're ready.

How Do You Write A Good Hypothesis?

It is always a really good idea to write down your hypothesis. It’s not just good pratice, but it helps you to clarify what it is you’re trying to achieve.

Your hypothesis should be written as a statement, not a question, and is about the thing you are seeking to prove. Hypotheses are usually written in one of 3 ways:

  • 1 As an If-Then statement
  • 2 In terms of the relationship between variables
  • 3 As the difference between two or more comparison groups.

How to Write a Good Hypothesis

In statistics and science, many hypotheses are formed with a structure of:

“ If I (do this) then (this will happen)”, for example:

  • If I (give this new drug to my patients) then (more of them will recover)
  • If I (eat more vegetables) then (I will lose weight faster)
  • If I (take multivitamins every day) then (I will not feel tired)

Your hypothesis doesn’t have to fit this framework, though. Many hypotheses are phrased in terms of the relationship between a pair of variables, like these amazing hypotheses from some of the world’s greatest scientists:

  • Isaac Newton , on testing the observation that objects thrown into the air fall to earth: “objects with mass attract each other through a gravitational field”
  • Albert Einstein , on disproving Isaac Newton’s hypothesis: “objects with mass cause space to bend”

If you are comparing two groups, your hypothesis can state the difference you expect to find between them, like this:

  • Men are, on average, more than 5 centimetres taller than women
  • XXWhite toothpaste produces teeth that are at least 5% brighter than brand XYZ

3 Simple Questions...

What's Stopping You Reaching YOUR Data Ninja Potential?

Answer 3 questions and we'll recommend the best route to

super-charge your data career

What Is The Difference Between a Scientific Hypothesis and a Statistical Hypothesis?

A scientific hypothesis is a statement of what you believe will happen in your study , and is a proposed explanation (or prediction) of observed patterns or trends. You will then try to prove this hypothesis to be true or false by collecting and analysing data.

A statistical hypothesis, on the other hand, is a statement about whether a pattern or trend is present in the data . If the predicted trend is present, then you can state with a degree of confidence that there is evidence that the hypothesis may be correct.

Scientific Hypothesis Versus Statistical Hypothesis

For example, you might hypothesise that prolonged exposure to loud noise will increase systolic blood pressure.

Once you have your scientific hypothesis, you can state your statistical hypothesis and design your study accordingly to test whether it is true or false, by manipulating the amount of noise a person is exposed to and taking their blood pressure. Once you have collected your data you can analyse them to decide whether or not your scientific hypothesis was correct.

LEARN MORE ABOUT HYPOTHESIS TESTING WITH THESE BOOKS

create a chart of various hypothesis test methods

2 Types of Statistical Hypothesis: Null and Alternative Hypotheses

Statistical tests are used to distinguish between the null hypothesis and one or more ‘alternative hypotheses’. In many cases, what you do is make a scientific hypothesis about whether something will happen, then try to prove it false by testing an opposing statistical hypothesis. If you fail to prove it false, then you have a basis for suggesting that your initial hypothesis may be correct. The statistical hypothesis that you try to prove false is called the Null Hypothesis.

The Null Hypothesis states that there is no pattern or trend in the data (e.g. there is no difference between groups, no relationship between two variables).

An Alternative Hypothesis is in direct contradiction to the null hypothesis, and states that there is a distinct pattern or trend in the data (e.g. there is a difference between groups, or a relationship between two variables). This is what you believe is true, and what you hope to prove.

Null Hypothesis Versus Alternative Hypothesis

Is it Possible to Prove a Null Hypothesis?

Statistics is the study of uncertainty, and everything in statistics is based upon this premise. As such, statistics can never definitively prove nor disprove anything.

What you can do, though, is make a statement on how confident you are, based on your results, that your conclusion is correct.

Although you can never be 0% or 100% sure that your result is correct, statistics gives you confidence that your methods are correct – if you repeat your experiment a number of times and keep getting the same (or similar) results, then your view of the world is broadly correct.

Statistical Hypothesis Testing: 4 Simple Steps (and a free chart) - Learn how the pros choose the correct test every time #statistics #datascience @chi2innovations

Statistical Hypothesis Testing - Getting Started

Knowing what statistical hypothesis testing is and how to do it are two different things!

One of the most important aspects of statistical hypothesis testing is choosing the correct statistical test, and that’s what this post is all about.

To help you in choosing the correct statistical test I've created a statistical test flow chart called The Hypothesis Wheel .

So without further ado, here it is – The Hypothesis Wheel – making its debut in the world:

Statistical Hypothesis Testing - The Hypothesis Wheel

Now, there's a HUGE amount of information in this statistical test flow chart, and I don't expect anyone to absorb it all with just a quick glance, so it will take you quite a bit of study time to get to grips with it all. This is why most people get confused when they dip their toes into the statistical hypothesis testing world!

We have an exclusive video course dedicated to teaching all of this in The Hive , but for now, let's have a look at the wheel to see how to 'read' it.

The Hypothesis Wheel Statistical Test Flow Chart - Free Download

To get the best out of this post you’ll need your own copy of The Hypothesis Wheel.

Below you can download and keep a Hi-Def pdf of The Hypothesis Wheel to help you in choosing the correct statistical test.

I suggest you download it now and refer to it throughout – it really will help you to take the next steps in choosing a statistical test for your study.

FREE Ultra-HD pdf Download

The hypothesis wheel.

create a chart of various hypothesis test methods

Learn how to choose the correct statistical hypothesis test every time

What Are The 4 Steps of Statistical Hypothesis Testing?

When making decisions about statistical hypothesis testing and deciding which statistical test to use, you need a plan of action, and here are my 4 hypothesis testing steps:

  • 1 Deduce the properties of your outcome variable (aka dependent or hypothesis variable)
  • 2 Deduce the properties of your input variable (aka independent or predictor variable)
  • 3 Deduce the parameters of the relationship
  • 4 Look up the statistic on The Hypothesis Wheel

That may sound complicated, but it’s actually easier than you might think.

Let’s go through each of the 4 hypothesis testing steps to learn how to decide which statistical test to use.

Hypothesis Testing Steps 1 & 2: Your Variable Properties

As you are doing the same thing in steps 1 and 2 you can do them together. The properties you need to check for your input and outcome variables are:

  • 1 Data Type
  • 2 Distribution
  • 3 Number of Classes

I've previously written an in-depth post about data types , but it's worth briefly going over them again.

There are 4 distinct data types that you'll come across in your research, and they are Ratio (R), Interval (I), Ordinal (O) and Nominal (N).

Ratio and Interval data are quantitative data , also known as numerical data or continuous data.

In statistical hypothesis testing, there is no difference in how you treat Ratio and Interval data, so you don’t need to know how to distinguish between them.

You will, though, need to know the difference between Ordinal and Nominal data.

Ordinal data are qualitative data, organised in ordered categories , like Size: [Small, Medium, Large].

Nominal data are also qualitative data, organised in unordered categories , like Favourite Colour: [Red, Green, Blue].

Ratio, Interval, Ordinal and Nominal data are related like this:

Statistical Hypothesis Testing - Data Types

Distribution

In terms of the distribution you need to check whether your data (Ratio or Interval data only) are normally-distributed (ND) or non-normally distributed (NND). Actually, all you really need to know is whether they are symmetrical or not - they don't need to be full-blown Gaussian distributions to qualify here.

Statistical Hypothesis Testing - Data Distributions

If you’re not sure how to check whether your data are symmetrical, you can use the SKEW function in Excel. If the result is zero, your data are perfectly symmetrical, while positive values indicate that your distribution is skewed to the right (long tail on the right), and negative values indicate a left skew (long tail on the left).

Small values, whether positive or negative, are OK, and you can consider your data to be symmetrical.

There aren’t any defined cut-offs to tell you when your data are symmetrical or skewed, so it’s a by-eye judgement – you’ll need to run a few samples of data through the SKEW function to get a ‘feel’ for making decisions.

There are more powerful statistical measures of skewness and symmetricity, but this is the easiest to use and interpret.

Number of Classes

Finally, you need to check (Ordinal or Nominal only) how many classes (categories) there are in your data.

It's easier to explain what that means by example – the variable Gender has 2 classes; Male and Female, whereas My Favourite Colour Of The Rainbow has 7 (ROYGBIV).

What you really need to know to decide which statistical test to use is whether your variable has 2 classes or more than 2:

Statistical Hypothesis Testing - Number of Classes

Once you’ve gathered together these pieces of information, you have all you need to choose the correct statistical test.

Hypothesis Testing Step 3: Relationship Parameters

The relationship parameter you need to know for the Hypothesis Wheel is which type of analysis you are conducting, univariate analysis or multivariate analysis , like this:

Statistical Hypothesis Testing - Types of Analysis

Hypothesis Testing Step 4: Look up Your Statistic on the Hypothesis Wheel

To help you navigate around the hypothesis wheel I've colour coded various parts of it, like this:

Hypothesis Wheel Colour Codes

We always start in the centre with the properties of the hypothesis variable, coloured in purple. There are 3 concentric circles corresponding to Data Type, Distribution and Number of Classes.

Hypothesis Testing Step 1 – Hypothesis Variable:

  • 1 Data Type (RION)
  • 2 Distribution (ND or NND)
  • 3 Number of Classes (2 or >2)

Spinning further out, in red we have the properties of the predictor variable - again, there are 3 circles for Data Type, Distribution and Number of Classes.

Hypothesis Testing Step 2 – Predictor Variable:

Then we have a blue circle for the relationship parameters, which denotes whether our analysis is univariate (UV) or multivariate (MV).

Hypothesis Testing Step 3 – Relationship Parameters:

  • Univariate Analysis (UV)
  • Multivariate Analysis (MV)

When you look closely you'll see that there are 2 hypothesis wheels, and the larger one contains only univariate hypothesis tests while the smaller one has only the multivariate hypothesis tests.

Finally, the outer orange circle tells us which hypothesis test we should choose in any given circumstance.

Hypothesis Testing Step 4 – Choosing the Correct Statistical Test

If you have followed each of the steps correctly, The Hypothesis Wheel will present you with the correct statistical test to use for your study.

Statistical Hypothesis Testing Example Using The Hypothesis Wheel

Let’s zoom in on a hypothesis testing example to see how you would use The Hypothesis Wheel to tell you which statistical test to use.

Let's say that your hypothesis variable has the following properties:

Step 1 – Hypothesis Variable:

  • >2 classes

And your predictor variable has these properties:

Step 2 – Predictor Variable:

You’re doing a pair-wise analysis between two variables, so this will be a univariate analysis:

Step 3 – Relationship Parameters:

Now let's see what that looks like on the hypothesis wheel:

Hypothesis Wheel Example

Purple Segment : Starting from the centre, locate the data type of your hypothesis variable (Ordinal). It has more than 2 classes, so we locate that too.

Red Segment : Spinning out to the red segment, locate the data type of your predictor variable (Nominal). In this case, since the hypothesis variable has more than 2 classes it doesn't matter how many classes the predictor variable has.

Blue Segment : You are conducting a univariate analysis, so you should be checking the larger of the 2 Hypothesis Wheels and you should locate the entry of UV.

Orange Segment : This is where The Hypothesis Wheel reveals the correct statistical test to use for your study:

Step 4 – Choosing the Correct Statistical Test:

  • Chi-Squared Test

The Hypothesis Wheel – More Than Just Another Statistical Test Flow Chart

The Hypothesis Wheel is more than just another flow chart that helps you choose which statistical test to use. The world doesn’t need another statistical test flow chart, it needs a better one – and I believe this is it.

The Hypothesis Wheel is a framework for helping you to ask the right questions of your data so you can choose the correct statistical test every time. All you need to do is ask 3 questions to choose the correct statistical test:

  • 1 What are my data types (RION)?
  • 2 What are their distributions (ND, NND), and/or how many categories do they have (2, >2)?
  • 3 What types of analysis am I looking to perform (UV, MV)?

Once you’ve answered these questions – and they are right there on the chart to help you decide – The Hypothesis Wheel will help you choose which statistical test to use.

But this isn’t why it is a framework. It is a framework because if there is a statistical test that is not present on the chart (I’ve only included the most used in statistical hypothesis testing), it is really easy to see exactly where it should fit on The Hypothesis Wheel, like this:

Statistical Hypothesis Testing - Paired t-test

For example, if you’re conducting a univariate analysis of paired continuous data that are both normally-distributed (or symmetrical), then you should be using a Paired t-test, and you can locate exactly where it should fit on The Hypothesis Wheel.

If you haven't downloaded your copy of The Hypothesis Wheel yet, you can get your Hi-Def pdf copy right here:

Hypothesis Wheel Poster

If you'd quite like to have it stuck on your wall so you can refer to it whenever you need to (and add your favourite hypothesis tests to it), you can get a Hi-Def poster of The Hypothesis Wheel here:

Statistical Hypothesis Testing - The Hypothesis Wheel Poster

Statistical Hypothesis Testing – Summary

For those that didn’t take a degree in statistics at University – around 99% of all those that need to use statistics in their work – statistical hypothesis testing can be a daunting task.

You need to choose the correct statistical test among a sea of possibilities, most of which you’ve probably never heard of.

What you need is a way to narrow the field, so you know which statistical test to use. Once you know that you can find out more about that statistical test so you can move on with your study.

The Hypothesis Wheel is a statistical test flow chart that gives you just 4 hypothesis testing steps to choosing the correct statistical test – first time, every time.

I hope that you find The Hypothesis Wheel to be useful in your research and that you will use it often.

Now that you know everything there is to know about choosing the correct statistical test, if you need a little refresher on the data basics you might also like to read this post's sister articles on quantitative data and qualitative data , Nominal data , Ordinal data , Interval data and Ratio data , and a comparison between each of the 4 types of data .

Do you have any questions about Statistical Hypothesis Testing and choosing the correct statistical test? Is there something that I've missed out?

Let me know in the comments below - your feedback will help me to improve the post and make learning about data and statistics easier for everybody!

Hypothesis Testing - Spinning The Wheel

chi-squared test, fisher's exact test, hypothesis testing, statistics, stats

Author Image

About the Author

Lee Baker is an award-winning software creator that lives behind a keyboard in a darkened room. Illuminated only by the light from his monitor, he aspires to finding the light switch. With decades of experience in science, statistics and artificial intelligence, he has a passion for telling stories with data. His mission is to help you discover your inner Data Ninja!

You may also like

45+ awesome gifts for data scientists, statisticians and other geeks, computational statistics is the new holy grail – experts, 3 crucial tips for data processing and analysis, correlation is not causation – pirates prove it, cracking chi-square tests: step-by-step, chi-square test: the key to categorical analysis.

create a chart of various hypothesis test methods

User Preferences

Content preview.

Arcu felis bibendum ut tristique et egestas quis:

  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
  • Duis aute irure dolor in reprehenderit in voluptate
  • Excepteur sint occaecat cupidatat non proident

Keyboard Shortcuts

6a.2 - steps for hypothesis tests, the logic of hypothesis testing section  .

A hypothesis, in statistics, is a statement about a population parameter, where this statement typically is represented by some specific numerical value. In testing a hypothesis, we use a method where we gather data in an effort to gather evidence about the hypothesis.

How do we decide whether to reject the null hypothesis?

  • If the sample data are consistent with the null hypothesis, then we do not reject it.
  • If the sample data are inconsistent with the null hypothesis, but consistent with the alternative, then we reject the null hypothesis and conclude that the alternative hypothesis is true.

Six Steps for Hypothesis Tests Section  

In hypothesis testing, there are certain steps one must follow. Below these are summarized into six such steps to conducting a test of a hypothesis.

  • Set up the hypotheses and check conditions : Each hypothesis test includes two hypotheses about the population. One is the null hypothesis, notated as \(H_0 \), which is a statement of a particular parameter value. This hypothesis is assumed to be true until there is evidence to suggest otherwise. The second hypothesis is called the alternative, or research hypothesis, notated as \(H_a \). The alternative hypothesis is a statement of a range of alternative values in which the parameter may fall. One must also check that any conditions (assumptions) needed to run the test have been satisfied e.g. normality of data, independence, and number of success and failure outcomes.
  • Decide on the significance level, \(\alpha \): This value is used as a probability cutoff for making decisions about the null hypothesis. This alpha value represents the probability we are willing to place on our test for making an incorrect decision in regards to rejecting the null hypothesis. The most common \(\alpha \) value is 0.05 or 5%. Other popular choices are 0.01 (1%) and 0.1 (10%).
  • Calculate the test statistic: Gather sample data and calculate a test statistic where the sample statistic is compared to the parameter value. The test statistic is calculated under the assumption the null hypothesis is true and incorporates a measure of standard error and assumptions (conditions) related to the sampling distribution.
  • Calculate probability value (p-value), or find the rejection region: A p-value is found by using the test statistic to calculate the probability of the sample data producing such a test statistic or one more extreme. The rejection region is found by using alpha to find a critical value; the rejection region is the area that is more extreme than the critical value. We discuss the p-value and rejection region in more detail in the next section.
  • Make a decision about the null hypothesis: In this step, we decide to either reject the null hypothesis or decide to fail to reject the null hypothesis. Notice we do not make a decision where we will accept the null hypothesis.
  • State an overall conclusion : Once we have found the p-value or rejection region, and made a statistical decision about the null hypothesis (i.e. we will reject the null or fail to reject the null), we then want to summarize our results into an overall conclusion for our test.

We will follow these six steps for the remainder of this Lesson. In the future Lessons, the steps will be followed but may not be explained explicitly.

Step 1 is a very important step to set up correctly. If your hypotheses are incorrect, your conclusion will be incorrect. In this next section, we practice with Step 1 for the one sample situations.

Have a language expert improve your writing

Run a free plagiarism check in 10 minutes, generate accurate citations for free.

  • Knowledge Base
  • Choosing the Right Statistical Test | Types & Examples

Choosing the Right Statistical Test | Types & Examples

Published on January 28, 2020 by Rebecca Bevans . Revised on June 22, 2023.

Statistical tests are used in hypothesis testing . They can be used to:

  • determine whether a predictor variable has a statistically significant relationship with an outcome variable.
  • estimate the difference between two or more groups.

Statistical tests assume a null hypothesis of no relationship or no difference between groups. Then they determine whether the observed data fall outside of the range of values predicted by the null hypothesis.

If you already know what types of variables you’re dealing with, you can use the flowchart to choose the right statistical test for your data.

Statistical tests flowchart

Table of contents

What does a statistical test do, when to perform a statistical test, choosing a parametric test: regression, comparison, or correlation, choosing a nonparametric test, flowchart: choosing a statistical test, other interesting articles, frequently asked questions about statistical tests.

Statistical tests work by calculating a test statistic – a number that describes how much the relationship between variables in your test differs from the null hypothesis of no relationship.

It then calculates a p value (probability value). The p -value estimates how likely it is that you would see the difference described by the test statistic if the null hypothesis of no relationship were true.

If the value of the test statistic is more extreme than the statistic calculated from the null hypothesis, then you can infer a statistically significant relationship between the predictor and outcome variables.

If the value of the test statistic is less extreme than the one calculated from the null hypothesis, then you can infer no statistically significant relationship between the predictor and outcome variables.

Prevent plagiarism. Run a free check.

You can perform statistical tests on data that have been collected in a statistically valid manner – either through an experiment , or through observations made using probability sampling methods .

For a statistical test to be valid , your sample size needs to be large enough to approximate the true distribution of the population being studied.

To determine which statistical test to use, you need to know:

  • whether your data meets certain assumptions.
  • the types of variables that you’re dealing with.

Statistical assumptions

Statistical tests make some common assumptions about the data they are testing:

  • Independence of observations (a.k.a. no autocorrelation): The observations/variables you include in your test are not related (for example, multiple measurements of a single test subject are not independent, while measurements of multiple different test subjects are independent).
  • Homogeneity of variance : the variance within each group being compared is similar among all groups. If one group has much more variation than others, it will limit the test’s effectiveness.
  • Normality of data : the data follows a normal distribution (a.k.a. a bell curve). This assumption applies only to quantitative data .

If your data do not meet the assumptions of normality or homogeneity of variance, you may be able to perform a nonparametric statistical test , which allows you to make comparisons without any assumptions about the data distribution.

If your data do not meet the assumption of independence of observations, you may be able to use a test that accounts for structure in your data (repeated-measures tests or tests that include blocking variables).

Types of variables

The types of variables you have usually determine what type of statistical test you can use.

Quantitative variables represent amounts of things (e.g. the number of trees in a forest). Types of quantitative variables include:

  • Continuous (aka ratio variables): represent measures and can usually be divided into units smaller than one (e.g. 0.75 grams).
  • Discrete (aka integer variables): represent counts and usually can’t be divided into units smaller than one (e.g. 1 tree).

Categorical variables represent groupings of things (e.g. the different tree species in a forest). Types of categorical variables include:

  • Ordinal : represent data with an order (e.g. rankings).
  • Nominal : represent group names (e.g. brands or species names).
  • Binary : represent data with a yes/no or 1/0 outcome (e.g. win or lose).

Choose the test that fits the types of predictor and outcome variables you have collected (if you are doing an experiment , these are the independent and dependent variables ). Consult the tables below to see which test best matches your variables.

Parametric tests usually have stricter requirements than nonparametric tests, and are able to make stronger inferences from the data. They can only be conducted with data that adheres to the common assumptions of statistical tests.

The most common types of parametric test include regression tests, comparison tests, and correlation tests.

Regression tests

Regression tests look for cause-and-effect relationships . They can be used to estimate the effect of one or more continuous variables on another variable.

Predictor variable Outcome variable Research question example
What is the effect of income on longevity?
What is the effect of income and minutes of exercise per day on longevity?
Logistic regression What is the effect of drug dosage on the survival of a test subject?

Comparison tests

Comparison tests look for differences among group means . They can be used to test the effect of a categorical variable on the mean value of some other characteristic.

T-tests are used when comparing the means of precisely two groups (e.g., the average heights of men and women). ANOVA and MANOVA tests are used when comparing the means of more than two groups (e.g., the average heights of children, teenagers, and adults).

Predictor variable Outcome variable Research question example
Paired t-test What is the effect of two different test prep programs on the average exam scores for students from the same class?
Independent t-test What is the difference in average exam scores for students from two different schools?
ANOVA What is the difference in average pain levels among post-surgical patients given three different painkillers?
MANOVA What is the effect of flower species on petal length, petal width, and stem length?

Correlation tests

Correlation tests check whether variables are related without hypothesizing a cause-and-effect relationship.

These can be used to test whether two variables you want to use in (for example) a multiple regression test are autocorrelated.

Variables Research question example
Pearson’s  How are latitude and temperature related?

Non-parametric tests don’t make as many assumptions about the data, and are useful when one or more of the common statistical assumptions are violated. However, the inferences they make aren’t as strong as with parametric tests.

Predictor variable Outcome variable Use in place of…
Spearman’s 
Pearson’s 
Sign test One-sample -test
Kruskal–Wallis  ANOVA
ANOSIM MANOVA
Wilcoxon Rank-Sum test Independent t-test
Wilcoxon Signed-rank test Paired t-test

Receive feedback on language, structure, and formatting

Professional editors proofread and edit your paper by focusing on:

  • Academic style
  • Vague sentences
  • Style consistency

See an example

create a chart of various hypothesis test methods

This flowchart helps you choose among parametric tests. For nonparametric alternatives, check the table above.

Choosing the right statistical test

If you want to know more about statistics , methodology , or research bias , make sure to check out some of our other articles with explanations and examples.

  • Normal distribution
  • Descriptive statistics
  • Measures of central tendency
  • Correlation coefficient
  • Null hypothesis

Methodology

  • Cluster sampling
  • Stratified sampling
  • Types of interviews
  • Cohort study
  • Thematic analysis

Research bias

  • Implicit bias
  • Cognitive bias
  • Survivorship bias
  • Availability heuristic
  • Nonresponse bias
  • Regression to the mean

Statistical tests commonly assume that:

  • the data are normally distributed
  • the groups that are being compared have similar variance
  • the data are independent

If your data does not meet these assumptions you might still be able to use a nonparametric statistical test , which have fewer requirements but also make weaker inferences.

A test statistic is a number calculated by a  statistical test . It describes how far your observed data is from the  null hypothesis  of no relationship between  variables or no difference among sample groups.

The test statistic tells you how different two or more groups are from the overall population mean , or how different a linear slope is from the slope predicted by a null hypothesis . Different test statistics are used in different statistical tests.

Statistical significance is a term used by researchers to state that it is unlikely their observations could have occurred under the null hypothesis of a statistical test . Significance is usually denoted by a p -value , or probability value.

Statistical significance is arbitrary – it depends on the threshold, or alpha value, chosen by the researcher. The most common threshold is p < 0.05, which means that the data is likely to occur less than 5% of the time under the null hypothesis .

When the p -value falls below the chosen alpha value, then we say the result of the test is statistically significant.

Quantitative variables are any variables where the data represent amounts (e.g. height, weight, or age).

Categorical variables are any variables where the data represent groups. This includes rankings (e.g. finishing places in a race), classifications (e.g. brands of cereal), and binary outcomes (e.g. coin flips).

You need to know what type of variables you are working with to choose the right statistical test for your data and interpret your results .

Discrete and continuous variables are two types of quantitative variables :

  • Discrete variables represent counts (e.g. the number of objects in a collection).
  • Continuous variables represent measurable amounts (e.g. water volume or weight).

Cite this Scribbr article

If you want to cite this source, you can copy and paste the citation or click the “Cite this Scribbr article” button to automatically add the citation to our free Citation Generator.

Bevans, R. (2023, June 22). Choosing the Right Statistical Test | Types & Examples. Scribbr. Retrieved September 9, 2024, from https://www.scribbr.com/statistics/statistical-tests/

Is this article helpful?

Rebecca Bevans

Rebecca Bevans

Other students also liked, hypothesis testing | a step-by-step guide with easy examples, test statistics | definition, interpretation, and examples, normal distribution | examples, formulas, & uses, what is your plagiarism score.

  • Data Science
  • Data Analysis
  • Data Visualization
  • Machine Learning
  • Deep Learning
  • Computer Vision
  • Artificial Intelligence
  • AI ML DS Interview Series
  • AI ML DS Projects series
  • Data Engineering
  • Web Scrapping

Understanding Hypothesis Testing

Hypothesis testing involves formulating assumptions about population parameters based on sample statistics and rigorously evaluating these assumptions against empirical evidence. This article sheds light on the significance of hypothesis testing and the critical steps involved in the process.

What is Hypothesis Testing?

A hypothesis is an assumption or idea, specifically a statistical claim about an unknown population parameter. For example, a judge assumes a person is innocent and verifies this by reviewing evidence and hearing testimony before reaching a verdict.

Hypothesis testing is a statistical method that is used to make a statistical decision using experimental data. Hypothesis testing is basically an assumption that we make about a population parameter. It evaluates two mutually exclusive statements about a population to determine which statement is best supported by the sample data. 

To test the validity of the claim or assumption about the population parameter:

  • A sample is drawn from the population and analyzed.
  • The results of the analysis are used to decide whether the claim is true or not.
Example: You say an average height in the class is 30 or a boy is taller than a girl. All of these is an assumption that we are assuming, and we need some statistical way to prove these. We need some mathematical conclusion whatever we are assuming is true.

Defining Hypotheses

  • Null hypothesis (H 0 ): In statistics, the null hypothesis is a general statement or default position that there is no relationship between two measured cases or no relationship among groups. In other words, it is a basic assumption or made based on the problem knowledge. Example : A company’s mean production is 50 units/per da H 0 : [Tex]\mu [/Tex] = 50.
  • Alternative hypothesis (H 1 ): The alternative hypothesis is the hypothesis used in hypothesis testing that is contrary to the null hypothesis.  Example: A company’s production is not equal to 50 units/per day i.e. H 1 : [Tex]\mu [/Tex] [Tex]\ne [/Tex] 50.

Key Terms of Hypothesis Testing

  • Level of significance : It refers to the degree of significance in which we accept or reject the null hypothesis. 100% accuracy is not possible for accepting a hypothesis, so we, therefore, select a level of significance that is usually 5%. This is normally denoted with  [Tex]\alpha[/Tex] and generally, it is 0.05 or 5%, which means your output should be 95% confident to give a similar kind of result in each sample.
  • P-value: The P value , or calculated probability, is the probability of finding the observed/extreme results when the null hypothesis(H0) of a study-given problem is true. If your P-value is less than the chosen significance level then you reject the null hypothesis i.e. accept that your sample claims to support the alternative hypothesis.
  • Test Statistic: The test statistic is a numerical value calculated from sample data during a hypothesis test, used to determine whether to reject the null hypothesis. It is compared to a critical value or p-value to make decisions about the statistical significance of the observed results.
  • Critical value : The critical value in statistics is a threshold or cutoff point used to determine whether to reject the null hypothesis in a hypothesis test.
  • Degrees of freedom: Degrees of freedom are associated with the variability or freedom one has in estimating a parameter. The degrees of freedom are related to the sample size and determine the shape.

Why do we use Hypothesis Testing?

Hypothesis testing is an important procedure in statistics. Hypothesis testing evaluates two mutually exclusive population statements to determine which statement is most supported by sample data. When we say that the findings are statistically significant, thanks to hypothesis testing. 

One-Tailed and Two-Tailed Test

One tailed test focuses on one direction, either greater than or less than a specified value. We use a one-tailed test when there is a clear directional expectation based on prior knowledge or theory. The critical region is located on only one side of the distribution curve. If the sample falls into this critical region, the null hypothesis is rejected in favor of the alternative hypothesis.

One-Tailed Test

There are two types of one-tailed test:

  • Left-Tailed (Left-Sided) Test: The alternative hypothesis asserts that the true parameter value is less than the null hypothesis. Example: H 0 ​: [Tex]\mu \geq 50 [/Tex] and H 1 : [Tex]\mu < 50 [/Tex]
  • Right-Tailed (Right-Sided) Test : The alternative hypothesis asserts that the true parameter value is greater than the null hypothesis. Example: H 0 : [Tex]\mu \leq50 [/Tex] and H 1 : [Tex]\mu > 50 [/Tex]

Two-Tailed Test

A two-tailed test considers both directions, greater than and less than a specified value.We use a two-tailed test when there is no specific directional expectation, and want to detect any significant difference.

Example: H 0 : [Tex]\mu = [/Tex] 50 and H 1 : [Tex]\mu \neq 50 [/Tex]

To delve deeper into differences into both types of test: Refer to link

What are Type 1 and Type 2 errors in Hypothesis Testing?

In hypothesis testing, Type I and Type II errors are two possible errors that researchers can make when drawing conclusions about a population based on a sample of data. These errors are associated with the decisions made regarding the null hypothesis and the alternative hypothesis.

  • Type I error: When we reject the null hypothesis, although that hypothesis was true. Type I error is denoted by alpha( [Tex]\alpha [/Tex] ).
  • Type II errors : When we accept the null hypothesis, but it is false. Type II errors are denoted by beta( [Tex]\beta [/Tex] ).


Null Hypothesis is True

Null Hypothesis is False

Null Hypothesis is True (Accept)

Correct Decision

Type II Error (False Negative)

Alternative Hypothesis is True (Reject)

Type I Error (False Positive)

Correct Decision

How does Hypothesis Testing work?

Step 1: define null and alternative hypothesis.

State the null hypothesis ( [Tex]H_0 [/Tex] ), representing no effect, and the alternative hypothesis ( [Tex]H_1 [/Tex] ​), suggesting an effect or difference.

We first identify the problem about which we want to make an assumption keeping in mind that our assumption should be contradictory to one another, assuming Normally distributed data.

Step 2 – Choose significance level

Select a significance level ( [Tex]\alpha [/Tex] ), typically 0.05, to determine the threshold for rejecting the null hypothesis. It provides validity to our hypothesis test, ensuring that we have sufficient data to back up our claims. Usually, we determine our significance level beforehand of the test. The p-value is the criterion used to calculate our significance value.

Step 3 – Collect and Analyze data.

Gather relevant data through observation or experimentation. Analyze the data using appropriate statistical methods to obtain a test statistic.

Step 4-Calculate Test Statistic

The data for the tests are evaluated in this step we look for various scores based on the characteristics of data. The choice of the test statistic depends on the type of hypothesis test being conducted.

There are various hypothesis tests, each appropriate for various goal to calculate our test. This could be a Z-test , Chi-square , T-test , and so on.

  • Z-test : If population means and standard deviations are known. Z-statistic is commonly used.
  • t-test : If population standard deviations are unknown. and sample size is small than t-test statistic is more appropriate.
  • Chi-square test : Chi-square test is used for categorical data or for testing independence in contingency tables
  • F-test : F-test is often used in analysis of variance (ANOVA) to compare variances or test the equality of means across multiple groups.

We have a smaller dataset, So, T-test is more appropriate to test our hypothesis.

T-statistic is a measure of the difference between the means of two groups relative to the variability within each group. It is calculated as the difference between the sample means divided by the standard error of the difference. It is also known as the t-value or t-score.

Step 5 – Comparing Test Statistic:

In this stage, we decide where we should accept the null hypothesis or reject the null hypothesis. There are two ways to decide where we should accept or reject the null hypothesis.

Method A: Using Crtical values

Comparing the test statistic and tabulated critical value we have,

  • If Test Statistic>Critical Value: Reject the null hypothesis.
  • If Test Statistic≤Critical Value: Fail to reject the null hypothesis.

Note: Critical values are predetermined threshold values that are used to make a decision in hypothesis testing. To determine critical values for hypothesis testing, we typically refer to a statistical distribution table , such as the normal distribution or t-distribution tables based on.

Method B: Using P-values

We can also come to an conclusion using the p-value,

  • If the p-value is less than or equal to the significance level i.e. ( [Tex]p\leq\alpha [/Tex] ), you reject the null hypothesis. This indicates that the observed results are unlikely to have occurred by chance alone, providing evidence in favor of the alternative hypothesis.
  • If the p-value is greater than the significance level i.e. ( [Tex]p\geq \alpha[/Tex] ), you fail to reject the null hypothesis. This suggests that the observed results are consistent with what would be expected under the null hypothesis.

Note : The p-value is the probability of obtaining a test statistic as extreme as, or more extreme than, the one observed in the sample, assuming the null hypothesis is true. To determine p-value for hypothesis testing, we typically refer to a statistical distribution table , such as the normal distribution or t-distribution tables based on.

Step 7- Interpret the Results

At last, we can conclude our experiment using method A or B.

Calculating test statistic

To validate our hypothesis about a population parameter we use statistical functions . We use the z-score, p-value, and level of significance(alpha) to make evidence for our hypothesis for normally distributed data .

1. Z-statistics:

When population means and standard deviations are known.

[Tex]z = \frac{\bar{x} – \mu}{\frac{\sigma}{\sqrt{n}}}[/Tex]

  • [Tex]\bar{x} [/Tex] is the sample mean,
  • μ represents the population mean, 
  • σ is the standard deviation
  • and n is the size of the sample.

2. T-Statistics

T test is used when n<30,

t-statistic calculation is given by:

[Tex]t=\frac{x̄-μ}{s/\sqrt{n}} [/Tex]

  • t = t-score,
  • x̄ = sample mean
  • μ = population mean,
  • s = standard deviation of the sample,
  • n = sample size

3. Chi-Square Test

Chi-Square Test for Independence categorical Data (Non-normally distributed) using:

[Tex]\chi^2 = \sum \frac{(O_{ij} – E_{ij})^2}{E_{ij}}[/Tex]

  • [Tex]O_{ij}[/Tex] is the observed frequency in cell [Tex]{ij} [/Tex]
  • i,j are the rows and columns index respectively.
  • [Tex]E_{ij}[/Tex] is the expected frequency in cell [Tex]{ij}[/Tex] , calculated as : [Tex]\frac{{\text{{Row total}} \times \text{{Column total}}}}{{\text{{Total observations}}}}[/Tex]

Real life Examples of Hypothesis Testing

Let’s examine hypothesis testing using two real life situations,

Case A: D oes a New Drug Affect Blood Pressure?

Imagine a pharmaceutical company has developed a new drug that they believe can effectively lower blood pressure in patients with hypertension. Before bringing the drug to market, they need to conduct a study to assess its impact on blood pressure.

  • Before Treatment: 120, 122, 118, 130, 125, 128, 115, 121, 123, 119
  • After Treatment: 115, 120, 112, 128, 122, 125, 110, 117, 119, 114

Step 1 : Define the Hypothesis

  • Null Hypothesis : (H 0 )The new drug has no effect on blood pressure.
  • Alternate Hypothesis : (H 1 )The new drug has an effect on blood pressure.

Step 2: Define the Significance level

Let’s consider the Significance level at 0.05, indicating rejection of the null hypothesis.

If the evidence suggests less than a 5% chance of observing the results due to random variation.

Step 3 : Compute the test statistic

Using paired T-test analyze the data to obtain a test statistic and a p-value.

The test statistic (e.g., T-statistic) is calculated based on the differences between blood pressure measurements before and after treatment.

t = m/(s/√n)

  • m  = mean of the difference i.e X after, X before
  • s  = standard deviation of the difference (d) i.e d i ​= X after, i ​− X before,
  • n  = sample size,

then, m= -3.9, s= 1.8 and n= 10

we, calculate the , T-statistic = -9 based on the formula for paired t test

Step 4: Find the p-value

The calculated t-statistic is -9 and degrees of freedom df = 9, you can find the p-value using statistical software or a t-distribution table.

thus, p-value = 8.538051223166285e-06

Step 5: Result

  • If the p-value is less than or equal to 0.05, the researchers reject the null hypothesis.
  • If the p-value is greater than 0.05, they fail to reject the null hypothesis.

Conclusion: Since the p-value (8.538051223166285e-06) is less than the significance level (0.05), the researchers reject the null hypothesis. There is statistically significant evidence that the average blood pressure before and after treatment with the new drug is different.

Python Implementation of Case A

Let’s create hypothesis testing with python, where we are testing whether a new drug affects blood pressure. For this example, we will use a paired T-test. We’ll use the scipy.stats library for the T-test.

Scipy is a mathematical library in Python that is mostly used for mathematical equations and computations.

We will implement our first real life problem via python,

import numpy as np from scipy import stats # Data before_treatment = np . array ([ 120 , 122 , 118 , 130 , 125 , 128 , 115 , 121 , 123 , 119 ]) after_treatment = np . array ([ 115 , 120 , 112 , 128 , 122 , 125 , 110 , 117 , 119 , 114 ]) # Step 1: Null and Alternate Hypotheses # Null Hypothesis: The new drug has no effect on blood pressure. # Alternate Hypothesis: The new drug has an effect on blood pressure. null_hypothesis = "The new drug has no effect on blood pressure." alternate_hypothesis = "The new drug has an effect on blood pressure." # Step 2: Significance Level alpha = 0.05 # Step 3: Paired T-test t_statistic , p_value = stats . ttest_rel ( after_treatment , before_treatment ) # Step 4: Calculate T-statistic manually m = np . mean ( after_treatment - before_treatment ) s = np . std ( after_treatment - before_treatment , ddof = 1 ) # using ddof=1 for sample standard deviation n = len ( before_treatment ) t_statistic_manual = m / ( s / np . sqrt ( n )) # Step 5: Decision if p_value <= alpha : decision = "Reject" else : decision = "Fail to reject" # Conclusion if decision == "Reject" : conclusion = "There is statistically significant evidence that the average blood pressure before and after treatment with the new drug is different." else : conclusion = "There is insufficient evidence to claim a significant difference in average blood pressure before and after treatment with the new drug." # Display results print ( "T-statistic (from scipy):" , t_statistic ) print ( "P-value (from scipy):" , p_value ) print ( "T-statistic (calculated manually):" , t_statistic_manual ) print ( f "Decision: { decision } the null hypothesis at alpha= { alpha } ." ) print ( "Conclusion:" , conclusion )

T-statistic (from scipy): -9.0 P-value (from scipy): 8.538051223166285e-06 T-statistic (calculated manually): -9.0 Decision: Reject the null hypothesis at alpha=0.05. Conclusion: There is statistically significant evidence that the average blood pressure before and after treatment with the new drug is different.

In the above example, given the T-statistic of approximately -9 and an extremely small p-value, the results indicate a strong case to reject the null hypothesis at a significance level of 0.05. 

  • The results suggest that the new drug, treatment, or intervention has a significant effect on lowering blood pressure.
  • The negative T-statistic indicates that the mean blood pressure after treatment is significantly lower than the assumed population mean before treatment.

Case B : Cholesterol level in a population

Data: A sample of 25 individuals is taken, and their cholesterol levels are measured.

Cholesterol Levels (mg/dL): 205, 198, 210, 190, 215, 205, 200, 192, 198, 205, 198, 202, 208, 200, 205, 198, 205, 210, 192, 205, 198, 205, 210, 192, 205.

Populations Mean = 200

Population Standard Deviation (σ): 5 mg/dL(given for this problem)

Step 1: Define the Hypothesis

  • Null Hypothesis (H 0 ): The average cholesterol level in a population is 200 mg/dL.
  • Alternate Hypothesis (H 1 ): The average cholesterol level in a population is different from 200 mg/dL.

As the direction of deviation is not given , we assume a two-tailed test, and based on a normal distribution table, the critical values for a significance level of 0.05 (two-tailed) can be calculated through the z-table and are approximately -1.96 and 1.96.

The test statistic is calculated by using the z formula Z = [Tex](203.8 – 200) / (5 \div \sqrt{25}) [/Tex] ​ and we get accordingly , Z =2.039999999999992.

Step 4: Result

Since the absolute value of the test statistic (2.04) is greater than the critical value (1.96), we reject the null hypothesis. And conclude that, there is statistically significant evidence that the average cholesterol level in the population is different from 200 mg/dL

Python Implementation of Case B

import scipy.stats as stats import math import numpy as np # Given data sample_data = np . array ( [ 205 , 198 , 210 , 190 , 215 , 205 , 200 , 192 , 198 , 205 , 198 , 202 , 208 , 200 , 205 , 198 , 205 , 210 , 192 , 205 , 198 , 205 , 210 , 192 , 205 ]) population_std_dev = 5 population_mean = 200 sample_size = len ( sample_data ) # Step 1: Define the Hypotheses # Null Hypothesis (H0): The average cholesterol level in a population is 200 mg/dL. # Alternate Hypothesis (H1): The average cholesterol level in a population is different from 200 mg/dL. # Step 2: Define the Significance Level alpha = 0.05 # Two-tailed test # Critical values for a significance level of 0.05 (two-tailed) critical_value_left = stats . norm . ppf ( alpha / 2 ) critical_value_right = - critical_value_left # Step 3: Compute the test statistic sample_mean = sample_data . mean () z_score = ( sample_mean - population_mean ) / \ ( population_std_dev / math . sqrt ( sample_size )) # Step 4: Result # Check if the absolute value of the test statistic is greater than the critical values if abs ( z_score ) > max ( abs ( critical_value_left ), abs ( critical_value_right )): print ( "Reject the null hypothesis." ) print ( "There is statistically significant evidence that the average cholesterol level in the population is different from 200 mg/dL." ) else : print ( "Fail to reject the null hypothesis." ) print ( "There is not enough evidence to conclude that the average cholesterol level in the population is different from 200 mg/dL." )

Reject the null hypothesis. There is statistically significant evidence that the average cholesterol level in the population is different from 200 mg/dL.

Limitations of Hypothesis Testing

  • Although a useful technique, hypothesis testing does not offer a comprehensive grasp of the topic being studied. Without fully reflecting the intricacy or whole context of the phenomena, it concentrates on certain hypotheses and statistical significance.
  • The accuracy of hypothesis testing results is contingent on the quality of available data and the appropriateness of statistical methods used. Inaccurate data or poorly formulated hypotheses can lead to incorrect conclusions.
  • Relying solely on hypothesis testing may cause analysts to overlook significant patterns or relationships in the data that are not captured by the specific hypotheses being tested. This limitation underscores the importance of complimenting hypothesis testing with other analytical approaches.

Hypothesis testing stands as a cornerstone in statistical analysis, enabling data scientists to navigate uncertainties and draw credible inferences from sample data. By systematically defining null and alternative hypotheses, choosing significance levels, and leveraging statistical tests, researchers can assess the validity of their assumptions. The article also elucidates the critical distinction between Type I and Type II errors, providing a comprehensive understanding of the nuanced decision-making process inherent in hypothesis testing. The real-life example of testing a new drug’s effect on blood pressure using a paired T-test showcases the practical application of these principles, underscoring the importance of statistical rigor in data-driven decision-making.

Frequently Asked Questions (FAQs)

1. what are the 3 types of hypothesis test.

There are three types of hypothesis tests: right-tailed, left-tailed, and two-tailed. Right-tailed tests assess if a parameter is greater, left-tailed if lesser. Two-tailed tests check for non-directional differences, greater or lesser.

2.What are the 4 components of hypothesis testing?

Null Hypothesis ( [Tex]H_o [/Tex] ): No effect or difference exists. Alternative Hypothesis ( [Tex]H_1 [/Tex] ): An effect or difference exists. Significance Level ( [Tex]\alpha [/Tex] ): Risk of rejecting null hypothesis when it’s true (Type I error). Test Statistic: Numerical value representing observed evidence against null hypothesis.

3.What is hypothesis testing in ML?

Statistical method to evaluate the performance and validity of machine learning models. Tests specific hypotheses about model behavior, like whether features influence predictions or if a model generalizes well to unseen data.

4.What is the difference between Pytest and hypothesis in Python?

Pytest purposes general testing framework for Python code while Hypothesis is a Property-based testing framework for Python, focusing on generating test cases based on specified properties of the code.

Please Login to comment...

Similar reads.

  • data-science
  • OpenAI o1 AI Model Launched: Explore o1-Preview, o1-Mini, Pricing & Comparison
  • How to Merge Cells in Google Sheets: Step by Step Guide
  • How to Lock Cells in Google Sheets : Step by Step Guide
  • PS5 Pro Launched: Controller, Price, Specs & Features, How to Pre-Order, and More
  • #geekstreak2024 – 21 Days POTD Challenge Powered By Deutsche Bank

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Tutorial Playlist

Statistics tutorial, everything you need to know about the probability density function in statistics, the best guide to understand central limit theorem, an in-depth guide to measures of central tendency : mean, median and mode, the ultimate guide to understand conditional probability.

A Comprehensive Look at Percentile in Statistics

The Best Guide to Understand Bayes Theorem

Everything you need to know about the normal distribution, an in-depth explanation of cumulative distribution function, chi-square test, what is hypothesis testing in statistics types and examples, understanding the fundamentals of arithmetic and geometric progression, the definitive guide to understand spearman’s rank correlation, mean squared error: overview, examples, concepts and more, all you need to know about the empirical rule in statistics, the complete guide to skewness and kurtosis, a holistic look at bernoulli distribution.

All You Need to Know About Bias in Statistics

A Complete Guide to Get a Grasp of Time Series Analysis

The Key Differences Between Z-Test Vs. T-Test

The Complete Guide to Understand Pearson's Correlation

A complete guide on the types of statistical studies, everything you need to know about poisson distribution, your best guide to understand correlation vs. regression, the most comprehensive guide for beginners on what is correlation, hypothesis testing in statistics - types | examples.

Lesson 10 of 24 By Avijeet Biswal

What Is Hypothesis Testing in Statistics? Types and Examples

Table of Contents

In today’s data-driven world, decisions are based on data all the time. Hypothesis plays a crucial role in that process, whether it may be making business decisions, in the health sector, academia, or in quality improvement. Without hypothesis and hypothesis tests, you risk drawing the wrong conclusions and making bad decisions. In this tutorial, you will look at Hypothesis Testing in Statistics.

What Is Hypothesis Testing in Statistics?

Hypothesis Testing is a type of statistical analysis in which you put your assumptions about a population parameter to the test. It is used to estimate the relationship between 2 statistical variables.

Let's discuss few examples of statistical hypothesis from real-life - 

  • A teacher assumes that 60% of his college's students come from lower-middle-class families.
  • A doctor believes that 3D (Diet, Dose, and Discipline) is 90% effective for diabetic patients.

Now that you know about hypothesis testing, look at the two types of hypothesis testing in statistics.

The Ultimate Ticket to Top Data Science Job Roles

The Ultimate Ticket to Top Data Science Job Roles

Importance of Hypothesis Testing in Data Analysis

Here is what makes hypothesis testing so important in data analysis and why it is key to making better decisions:

Avoiding Misleading Conclusions (Type I and Type II Errors)

One of the biggest benefits of hypothesis testing is that it helps you avoid jumping to the wrong conclusions. For instance, a Type I error could occur if a company launches a new product thinking it will be a hit, only to find out later that the data misled them. A Type II error might happen when a company overlooks a potentially successful product because their testing wasn’t thorough enough. By setting up the right significance level and carefully calculating the p-value, hypothesis testing minimizes the chances of these errors, leading to more accurate results.

Making Smarter Choices

Hypothesis testing is key to making smarter, evidence-based decisions. Let’s say a city planner wants to determine if building a new park will increase community engagement. By testing the hypothesis using data from similar projects, they can make an informed choice. Similarly, a teacher might use hypothesis testing to see if a new teaching method actually improves student performance. It’s about taking the guesswork out of decisions and relying on solid evidence instead.

Optimizing Business Tactics

In business, hypothesis testing is invaluable for testing new ideas and strategies before fully committing to them. For example, an e-commerce company might want to test whether offering free shipping increases sales. By using hypothesis testing, they can compare sales data from customers who received free shipping offers and those who didn’t. This allows them to base their business decisions on data, not hunches, reducing the risk of costly mistakes.

Hypothesis Testing Formula

Z = ( x̅ – μ0 ) / (σ /√n)

  • Here, x̅ is the sample mean,
  • μ0 is the population mean,
  • σ is the standard deviation,
  • n is the sample size.

How Hypothesis Testing Works?

An analyst performs hypothesis testing on a statistical sample to present evidence of the plausibility of the null hypothesis. Measurements and analyses are conducted on a random sample of the population to test a theory. Analysts use a random population sample to test two hypotheses: the null and alternative hypotheses.

The null hypothesis is typically an equality hypothesis between population parameters; for example, a null hypothesis may claim that the population means return equals zero. The alternate hypothesis is essentially the inverse of the null hypothesis (e.g., the population means the return is not equal to zero). As a result, they are mutually exclusive, and only one can be correct. One of the two possibilities, however, will always be correct.

Your Dream Career is Just Around The Corner!

Your Dream Career is Just Around The Corner!

Null Hypothesis and Alternative Hypothesis

The Null Hypothesis is the assumption that the event will not occur. A null hypothesis has no bearing on the study's outcome unless it is rejected.

H0 is the symbol for it, and it is pronounced H-naught.

The Alternate Hypothesis is the logical opposite of the null hypothesis. The acceptance of the alternative hypothesis follows the rejection of the null hypothesis. H1 is the symbol for it.

Let's understand this with an example.

A sanitizer manufacturer claims that its product kills 95 percent of germs on average. 

To put this company's claim to the test, create a null and alternate hypothesis.

H0 (Null Hypothesis): Average = 95%.

Alternative Hypothesis (H1): The average is less than 95%.

Another straightforward example to understand this concept is determining whether or not a coin is fair and balanced. The null hypothesis states that the probability of a show of heads is equal to the likelihood of a show of tails. In contrast, the alternate theory states that the probability of a show of heads and tails would be very different.

Become a Data Scientist with Hands-on Training!

Become a Data Scientist with Hands-on Training!

Hypothesis Testing Calculation With Examples

Let's consider a hypothesis test for the average height of women in the United States. Suppose our null hypothesis is that the average height is 5'4". We gather a sample of 100 women and determine their average height is 5'5". The standard deviation of population is 2.

To calculate the z-score, we would use the following formula:

z = ( x̅ – μ0 ) / (σ /√n)

z = (5'5" - 5'4") / (2" / √100)

z = 0.5 / (0.045)

We will reject the null hypothesis as the z-score of 11.11 is very large and conclude that there is evidence to suggest that the average height of women in the US is greater than 5'4".

Steps in Hypothesis Testing

Hypothesis testing is a statistical method to determine if there is enough evidence in a sample of data to infer that a certain condition is true for the entire population. Here’s a breakdown of the typical steps involved in hypothesis testing:

Formulate Hypotheses

  • Null Hypothesis (H0): This hypothesis states that there is no effect or difference, and it is the hypothesis you attempt to reject with your test.
  • Alternative Hypothesis (H1 or Ha): This hypothesis is what you might believe to be true or hope to prove true. It is usually considered the opposite of the null hypothesis.

Choose the Significance Level (α)

The significance level, often denoted by alpha (α), is the probability of rejecting the null hypothesis when it is true. Common choices for α are 0.05 (5%), 0.01 (1%), and 0.10 (10%).

Select the Appropriate Test

Choose a statistical test based on the type of data and the hypothesis. Common tests include t-tests, chi-square tests, ANOVA, and regression analysis. The selection depends on data type, distribution, sample size, and whether the hypothesis is one-tailed or two-tailed.

Collect Data

Gather the data that will be analyzed in the test. To infer conclusions accurately, this data should be representative of the population.

Calculate the Test Statistic

Based on the collected data and the chosen test, calculate a test statistic that reflects how much the observed data deviates from the null hypothesis.

Determine the p-value

The p-value is the probability of observing test results at least as extreme as the results observed, assuming the null hypothesis is correct. It helps determine the strength of the evidence against the null hypothesis.

Make a Decision

Compare the p-value to the chosen significance level:

  • If the p-value ≤ α: Reject the null hypothesis, suggesting sufficient evidence in the data supports the alternative hypothesis.
  • If the p-value > α: Do not reject the null hypothesis, suggesting insufficient evidence to support the alternative hypothesis.

Report the Results

Present the findings from the hypothesis test, including the test statistic, p-value, and the conclusion about the hypotheses.

Perform Post-hoc Analysis (if necessary)

Depending on the results and the study design, further analysis may be needed to explore the data more deeply or to address multiple comparisons if several hypotheses were tested simultaneously.

Types of Hypothesis Testing

To determine whether a discovery or relationship is statistically significant, hypothesis testing uses a z-test. It usually checks to see if two means are the same (the null hypothesis). Only when the population standard deviation is known and the sample size is 30 data points or more, can a z-test be applied.

A statistical test called a t-test is employed to compare the means of two groups. To determine whether two groups differ or if a procedure or treatment affects the population of interest, it is frequently used in hypothesis testing.

3. Chi-Square 

You utilize a Chi-square test for hypothesis testing concerning whether your data is as predicted. To determine if the expected and observed results are well-fitted, the Chi-square test analyzes the differences between categorical variables from a random sample. The test's fundamental premise is that the observed values in your data should be compared to the predicted values that would be present if the null hypothesis were true.

ANOVA , or Analysis of Variance, is a statistical method used to compare the means of three or more groups. It’s particularly useful when you want to see if there are significant differences between multiple groups. For instance, in business, a company might use ANOVA to analyze whether three different stores are performing differently in terms of sales. It’s also widely used in fields like medical research and social sciences, where comparing group differences can provide valuable insights.

Hypothesis Testing and Confidence Intervals

Both confidence intervals and hypothesis tests are inferential techniques that depend on approximating the sample distribution. Data from a sample is used to estimate a population parameter using confidence intervals. Data from a sample is used in hypothesis testing to examine a given hypothesis. We must have a postulated parameter to conduct hypothesis testing.

Bootstrap distributions and randomization distributions are created using comparable simulation techniques. The observed sample statistic is the focal point of a bootstrap distribution, whereas the null hypothesis value is the focal point of a randomization distribution.

A variety of feasible population parameter estimates are included in confidence ranges. In this lesson, we created just two-tailed confidence intervals. There is a direct connection between these two-tail confidence intervals and these two-tail hypothesis tests. The results of a two-tailed hypothesis test and two-tailed confidence intervals typically provide the same results. In other words, a hypothesis test at the 0.05 level will virtually always fail to reject the null hypothesis if the 95% confidence interval contains the predicted value. A hypothesis test at the 0.05 level will nearly certainly reject the null hypothesis if the 95% confidence interval does not include the hypothesized parameter.

Become a Data Scientist through hands-on learning with hackathons, masterclasses, webinars, and Ask-Me-Anything sessions! Start learning!

Simple and Composite Hypothesis Testing

Depending on the population distribution, you can classify the statistical hypothesis into two types.

Simple Hypothesis: A simple hypothesis specifies an exact value for the parameter.

Composite Hypothesis: A composite hypothesis specifies a range of values.

A company is claiming that their average sales for this quarter are 1000 units. This is an example of a simple hypothesis.

Suppose the company claims that the sales are in the range of 900 to 1000 units. Then this is a case of a composite hypothesis.

One-Tailed and Two-Tailed Hypothesis Testing

The One-Tailed test, also called a directional test, considers a critical region of data that would result in the null hypothesis being rejected if the test sample falls into it, inevitably meaning the acceptance of the alternate hypothesis.

In a one-tailed test, the critical distribution area is one-sided, meaning the test sample is either greater or lesser than a specific value.

In two tails, the test sample is checked to be greater or less than a range of values in a Two-Tailed test, implying that the critical distribution area is two-sided.

If the sample falls within this range, the alternate hypothesis will be accepted, and the null hypothesis will be rejected.

Become a Data Scientist With Real-World Experience

Become a Data Scientist With Real-World Experience

Right Tailed Hypothesis Testing

If the larger than (>) sign appears in your hypothesis statement, you are using a right-tailed test, also known as an upper test. Or, to put it another way, the disparity is to the right. For instance, you can contrast the battery life before and after a change in production. Your hypothesis statements can be the following if you want to know if the battery life is longer than the original (let's say 90 hours):

  • The null hypothesis is (H0 <= 90) or less change.
  • A possibility is that battery life has risen (H1) > 90.

The crucial point in this situation is that the alternate hypothesis (H1), not the null hypothesis, decides whether you get a right-tailed test.

Left Tailed Hypothesis Testing

Alternative hypotheses that assert the true value of a parameter is lower than the null hypothesis are tested with a left-tailed test; they are indicated by the asterisk "<".

Suppose H0: mean = 50 and H1: mean not equal to 50

According to the H1, the mean can be greater than or less than 50. This is an example of a Two-tailed test.

In a similar manner, if H0: mean >=50, then H1: mean <50

Here the mean is less than 50. It is called a One-tailed test.

Type 1 and Type 2 Error

A hypothesis test can result in two types of errors.

Type 1 Error: A Type-I error occurs when sample results reject the null hypothesis despite being true.

Type 2 Error: A Type-II error occurs when the null hypothesis is not rejected when it is false, unlike a Type-I error.

Suppose a teacher evaluates the examination paper to decide whether a student passes or fails.

H0: Student has passed

H1: Student has failed

Type I error will be the teacher failing the student [rejects H0] although the student scored the passing marks [H0 was true]. 

Type II error will be the case where the teacher passes the student [do not reject H0] although the student did not score the passing marks [H1 is true].

Serious About Success? Don't Settle for Less

Serious About Success? Don't Settle for Less

Practice Problems on Hypothesis Testing

Here are the practice problems on hypothesis testing that will help you understand how to apply these concepts in real-world scenarios:

A telecom service provider claims that customers spend an average of ₹400 per month, with a standard deviation of ₹25. However, a random sample of 50 customer bills shows a mean of ₹250 and a standard deviation of ₹15. Does this sample data support the service provider’s claim?

Solution: Let’s break this down:

  • Null Hypothesis (H0): The average amount spent per month is ₹400.
  • Alternate Hypothesis (H1): The average amount spent per month is not ₹400.
  • Population Standard Deviation (σ): ₹25
  • Sample Size (n): 50
  • Sample Mean (x̄): ₹250

1. Calculate the z-value:

z=250-40025/50 −42.42

2. Compare with critical z-values: For a 5% significance level, critical z-values are -1.96 and +1.96. Since -42.42 is far outside this range, we reject the null hypothesis. The sample data suggests that the average amount spent is significantly different from ₹400.

Out of 850 customers, 400 made online grocery purchases. Can we conclude that more than 50% of customers are moving towards online grocery shopping?

Solution: Here’s how to approach it:

  • Proportion of customers who shopped online (p): 400 / 850 = 0.47
  • Null Hypothesis (H0): The proportion of online shoppers is 50% or more.
  • Alternate Hypothesis (H1): The proportion of online shoppers is less than 50%.
  • Sample Size (n): 850
  • Significance Level (α): 5%

z=p-PP(1-P)/n

z=0.47-0.500.50.5/850  −1.74

2. Compare with the critical z-value: For a 5% significance level (one-tailed test), the critical z-value is -1.645. Since -1.74 is less than -1.645, we reject the null hypothesis. This means the data does not support the idea that most customers are moving towards online grocery shopping.

In a study of code quality, Team A has 250 errors in 1000 lines of code, and Team B has 300 errors in 800 lines of code. Can we say Team B performs worse than Team A?

Solution: Let’s analyze it:

  • Proportion of errors for Team A (pA): 250 / 1000 = 0.25
  • Proportion of errors for Team B (pB): 300 / 800 = 0.375
  • Null Hypothesis (H0): Team B’s error rate is less than or equal to Team A’s.
  • Alternate Hypothesis (H1): Team B’s error rate is greater than Team A’s.
  • Sample Size for Team A (nA): 1000
  • Sample Size for Team B (nB): 800

p=nApA+nBpBnA+nB

p=10000.25+8000.3751000+800 ≈ 0.305

z=​pA−pB​p(1-p)(1nA+1nB)

z=​0.25−0.375​0.305(1-0.305) (11000+1800) ≈ −5.72

2. Compare with the critical z-value: For a 5% significance level (one-tailed test), the critical z-value is +1.645. Since -5.72 is far less than +1.645, we reject the null hypothesis. The data indicates that Team B’s performance is significantly worse than Team A’s.

Our Data Scientist Master's Program will help you master core topics such as R, Python, Machine Learning, Tableau, Hadoop, and Spark. Get started on your journey today!

Applications of Hypothesis Testing

Apart from the practical problems, let's look at the real-world applications of hypothesis testing across various fields:

Medicine and Healthcare

In medicine, hypothesis testing plays a pivotal role in assessing the success of new treatments. For example, researchers may want to find out if a new exercise regimen improves heart health. By comparing data from patients who followed the program to those who didn’t, they can determine if the exercise significantly improves health outcomes. Such rigorous testing allows medical professionals to rely on proven methods rather than assumptions.

Quality Control and Manufacturing

In manufacturing, ensuring product quality is vital, and hypothesis testing helps maintain those standards. Suppose a beverage company introduces a new bottling process and wants to verify if it reduces contamination. By analyzing samples from the new and old processes, hypothesis testing can reveal whether the new method reduces the risk of contamination. This allows manufacturers to implement improvements that enhance product safety and quality confidently.

Education and Learning

In education and learning, hypothesis testing is a tool to evaluate the impact of innovative teaching techniques. Imagine a situation where teachers introduce project-based learning to boost critical thinking skills. By comparing the performance of students who engaged in project-based learning with those in traditional settings, educators can test their hypothesis. The results can help educators make informed choices about adopting new teaching strategies.

Environmental Science

Hypothesis testing is essential in environmental science for evaluating the effectiveness of conservation measures. For example, scientists might explore whether a new water management strategy improves river health. By collecting and comparing data on water quality before and after the implementation of the strategy, they can determine whether the intervention leads to positive changes. Such findings are crucial for guiding environmental decisions that have long-term impacts.

Marketing and Advertising

In marketing, businesses use hypothesis testing to refine their approaches. For instance, a clothing brand might test if offering limited-time discounts increases customer loyalty. By running campaigns with and without the discount and analyzing the outcomes, they can assess if the strategy boosts customer retention. Data-driven insights from hypothesis testing enable companies to design marketing strategies that resonate with their audience and drive growth.

Limitations of Hypothesis Testing

Hypothesis testing has some limitations that researchers should be aware of:

  • It cannot prove or establish the truth: Hypothesis testing provides evidence to support or reject a hypothesis, but it cannot confirm the absolute truth of the research question.
  • Results are sample-specific: Hypothesis testing is based on analyzing a sample from a population, and the conclusions drawn are specific to that particular sample.
  • Possible errors: During hypothesis testing, there is a chance of committing type I error (rejecting a true null hypothesis) or type II error (failing to reject a false null hypothesis).
  • Assumptions and requirements: Different tests have specific assumptions and requirements that must be met to accurately interpret results.

Learn All The Tricks Of The BI Trade

Learn All The Tricks Of The BI Trade

After reading this tutorial, you would have a much better understanding of hypothesis testing, one of the most important concepts in the field of Data Science . The majority of hypotheses are based on speculation about observed behavior, natural phenomena, or established theories.

If you are interested in statistics of data science and skills needed for such a career, you ought to explore the Post Graduate Program in Data Science.

1. What is hypothesis testing in statistics with example?

Hypothesis testing is a statistical method used to determine if there is enough evidence in a sample data to draw conclusions about a population. It involves formulating two competing hypotheses, the null hypothesis (H0) and the alternative hypothesis (Ha), and then collecting data to assess the evidence. An example: testing if a new drug improves patient recovery (Ha) compared to the standard treatment (H0) based on collected patient data.

2. What is H0 and H1 in statistics?

In statistics, H0​ and H1​ represent the null and alternative hypotheses. The null hypothesis, H0​, is the default assumption that no effect or difference exists between groups or conditions. The alternative hypothesis, H1​, is the competing claim suggesting an effect or a difference. Statistical tests determine whether to reject the null hypothesis in favor of the alternative hypothesis based on the data.

3. What is a simple hypothesis with an example?

A simple hypothesis is a specific statement predicting a single relationship between two variables. It posits a direct and uncomplicated outcome. For example, a simple hypothesis might state, "Increased sunlight exposure increases the growth rate of sunflowers." Here, the hypothesis suggests a direct relationship between the amount of sunlight (independent variable) and the growth rate of sunflowers (dependent variable), with no additional variables considered.

4. What are the 3 major types of hypothesis?

The three major types of hypotheses are:

  • Null Hypothesis (H0): Represents the default assumption, stating that there is no significant effect or relationship in the data.
  • Alternative Hypothesis (Ha): Contradicts the null hypothesis and proposes a specific effect or relationship that researchers want to investigate.
  • Nondirectional Hypothesis: An alternative hypothesis that doesn't specify the direction of the effect, leaving it open for both positive and negative possibilities.

5. What software tools can assist with hypothesis testing?

Several software tools offering distinct features can help with hypothesis testing. R and RStudio are popular for their advanced statistical capabilities. The Python ecosystem, including libraries like SciPy and Statsmodels, also supports hypothesis testing. SAS and SPSS are well-established tools for comprehensive statistical analysis. For basic testing, Excel offers simple built-in functions.

6. How do I interpret the results of a hypothesis test?

Interpreting hypothesis test results involves comparing the p-value to the significance level (alpha). If the p-value is less than or equal to alpha, you can reject the null hypothesis, indicating statistical significance. This suggests that the observed effect is unlikely to have occurred by chance, validating your analysis findings.

7. Why is sample size important in hypothesis testing?

Sample size is crucial in hypothesis testing as it affects the test’s power. A larger sample size increases the likelihood of detecting a true effect, reducing the risk of Type II errors. Conversely, a small sample may lack the statistical power needed to identify differences, potentially leading to inaccurate conclusions.

8. Can hypothesis testing be used for non-numerical data?

Yes, hypothesis testing can be applied to non-numerical data through non-parametric tests. These tests are ideal when data doesn't meet parametric assumptions or when dealing with categorical data. Non-parametric tests, like the Chi-square or Mann-Whitney U test, provide robust methods for analyzing non-numerical data and drawing meaningful conclusions.

9. How do I choose the proper hypothesis test?

Selecting the right hypothesis test depends on several factors: the objective of your analysis, the type of data (numerical or categorical), and the sample size. Consider whether you're comparing means, proportions, or associations, and whether your data follows a normal distribution. The correct choice ensures accurate results tailored to your research question.

Find our PL-300 Microsoft Power BI Certification Training Online Classroom training classes in top cities:

NameDatePlace
12 Oct -27 Oct 2024,
Weekend batch
Your City
26 Oct -10 Nov 2024,
Weekend batch
Your City
9 Nov -24 Nov 2024,
Weekend batch
Your City

About the Author

Avijeet Biswal

Avijeet is a Senior Research Analyst at Simplilearn. Passionate about Data Analytics, Machine Learning, and Deep Learning, Avijeet is also interested in politics, cricket, and football.

IMAGES

  1. 5 Steps of Hypothesis Testing with Examples

    create a chart of various hypothesis test methods

  2. Hypothesis Test Flow Chart

    create a chart of various hypothesis test methods

  3. How to Optimize the Value of Hypothesis Testing

    create a chart of various hypothesis test methods

  4. Understanding various hypothesis testing steps

    create a chart of various hypothesis test methods

  5. Hypothesis Tests Explained. A quick overview of the concept of…

    create a chart of various hypothesis test methods

  6. Guide to Hypothesis Testing for Data Scientists

    create a chart of various hypothesis test methods

VIDEO

  1. Hypothesis testing overview (for the CFA Level 1 exam)

  2. Testing the Hypothesis-Large sample problem 1

  3. Hypothsis Testing in Statistics Part 2 Steps to Solving a Problem

  4. Hypothesis test(One sample mean) using Excel|| Ep-21|| ft.Nirmal Bajracharya

  5. How to chart a Hypothesis Test on Tableau

  6. Step-by-Step Guide to Hypothesis Testing: A Detailed Example of the 9 Essential Steps

COMMENTS

  1. Hypothesis Testing

    Table of contents. Step 1: State your null and alternate hypothesis. Step 2: Collect data. Step 3: Perform a statistical test. Step 4: Decide whether to reject or fail to reject your null hypothesis. Step 5: Present your findings. Other interesting articles. Frequently asked questions about hypothesis testing.

  2. What is Hypothesis Testing? Types and Methods

    All in all, there are 2 most common types of hypothesis testing methods. They are as follows - Frequentist Hypothesis Testing . The frequentist hypothesis or the traditional approach to hypothesis testing is a hypothesis testing method that aims on making assumptions by considering current data.

  3. PDF Harold's Statistics Hypothesis Testing Cheat Sheet

    Hypothesis A premise or claim that we want to test. Null Hypothesis: H 0 Currently accepted value for a parameter (middle of the distribution). Is assumed true for the purpose of carrying out the hypothesis test. • Always contains an "=" {=, , } • The null value implies a specific sampling distribution for the test statistic • H 0

  4. Which hypothesis test should I use? A flowchart

    A flowchart. A flowchart to decide what hypothesis test to use. Many years ago I taught a stats class for which one of the topics was hypothesis testing. Many of the students had a hard time remembering what situation each test was designed for, so I made a flowchart to help piece together the wild world of hypothesis tests.

  5. Hypothesis Testing

    Explore the intricacies of hypothesis testing, a cornerstone of statistical analysis. Dive into methods, interpretations, and applications for making data-driven decisions. In this Blog post we will learn: What is Hypothesis Testing? Steps in Hypothesis Testing 2.1. Set up Hypotheses: Null and Alternative 2.2. Choose a Significance Level (α) 2.3.

  6. PDF Hypothesis testing

    a. one b. two c. more than two. 1a. Hypothesis test about mean (one mean value) - the test is called hypothesis test about a population mean - we're interested if the population mean is equal to a specific value which is known (a constant) - notation (H0): µ=µ0. o if the population parameters are known ( µ,σ2,σ) we use the formula (1) to ...

  7. A Complete Guide to Hypothesis Testing

    2. Photo from StepUp Analytics. Hypothesis testing is a method of statistical inference that considers the null hypothesis H ₀ vs. the alternative hypothesis H a, where we are typically looking to assess evidence against H ₀. Such a test is used to compare data sets against one another, or compare a data set against some external standard.

  8. Hypothesis Testing: Uses, Steps & Example

    5 Steps of Significance Testing. Hypothesis testing involves five key steps, each critical to validating a research hypothesis using statistical methods: Formulate the Hypotheses: Write your research hypotheses as a null hypothesis (H 0) and an alternative hypothesis (H A). Data Collection: Gather data specifically aimed at testing the ...

  9. Use Control Charts with Hypothesis Tests

    Controls charts verify the assumption that a process is stable. We don't usually think of applying this assumption to hypothesis tests. However, data for a hypothesis test must also be stable otherwise the conclusions aren't reliable. To illustrate this point, suppose we need to compare test scores between two groups.

  10. Hypothesis Tests: A Comprehensive Guide

    Introduction to Hypotheses Tests. Hypothesis testing is a statistical tool used to make decisions based on data. It involves making assumptions about a population parameter and testing its validity using a population sample. Hypothesis tests help us draw conclusions and make informed decisions in various fields like business, research, and science.

  11. 10.29: Hypothesis Test for a Difference in Two Population Means (1 of 2)

    Step 1: Determine the hypotheses. The hypotheses for a difference in two population means are similar to those for a difference in two population proportions. The null hypothesis, H 0, is again a statement of "no effect" or "no difference.". H 0: μ 1 - μ 2 = 0, which is the same as H 0: μ 1 = μ 2. The alternative hypothesis, H a ...

  12. 1.2

    Step 1: State the Null Hypothesis. The null hypothesis can be thought of as the opposite of the "guess" the researchers made. In the example presented in the previous section, the biologist "guesses" plant height will be different for the various fertilizers. So the null hypothesis would be that there will be no difference among the groups of ...

  13. Statistical Hypothesis Testing

    Blue Segment: You are conducting a univariate analysis, so you should be checking the larger of the 2 Hypothesis Wheels and you should locate the entry of UV. Orange Segment: This is where The Hypothesis Wheel reveals the correct statistical test to use for your study: Step 4 - Choosing the Correct Statistical Test:

  14. PDF Hypothesis Test Flow Chart

    To test whether a population proportion is different than some hypothesized value. Hypothesis Test: 𝐻0: = 0 𝐻𝑎: ≠ 0 or >< 𝑧= ො− 0 01− 0 p-value=normalcdf(lower,upper,0,1) One-Sample t-test for mean To test whether there is a difference between a population mean and some hypothesized value. Hypothesis Test: 𝐻0:𝜇=𝜇0

  15. 6a.2

    Below these are summarized into six such steps to conducting a test of a hypothesis. Set up the hypotheses and check conditions: Each hypothesis test includes two hypotheses about the population. One is the null hypothesis, notated as H 0, which is a statement of a particular parameter value. This hypothesis is assumed to be true until there is ...

  16. Hypothesis Tests Explained. A quick overview of the concept of…

    Usually, parametric tests have the corresponding non-parametric test, as well described in [3]. The diagram featured at the top of this article reviews how to choose the right Hypothesis Test according to the sample. Parametric Tests. As already said, Parametric Tests assume a normal distribution in the data.

  17. Choosing the Right Statistical Test

    Categorical variables represent groupings of things (e.g. the different tree species in a forest). Types of categorical variables include: Ordinal: represent data with an order (e.g. rankings). Nominal: represent group names (e.g. brands or species names). Binary: represent data with a yes/no or 1/0 outcome (e.g. win or lose).

  18. 8

    mal places, or −2.58 if rounded to two decimal places. The value of the z score on the right is the opposite of the left-hand z s. Values for Specific α Values, Using Table E.Step 1 Draw the fig. re (the normal curve) and indicate the appropriate area.If the test is left-tailed, the critical region, with a.

  19. Understanding Hypothesis Testing

    Hypothesis testing is a statistical method that is used to make a statistical decision using experimental data. ... There are various hypothesis tests, each appropriate for various goal to calculate our test. ... The gain chart and lift chart are two measures that are used for Measuring the benefits of using the model and are used in business ...

  20. Hypothesis Testing in Statistics

    To put this company's claim to the test, create a null and alternate hypothesis. H0 (Null Hypothesis): Average = 95%. Alternative Hypothesis (H1): The average is less than 95%. Another straightforward example to understand this concept is determining whether or not a coin is fair and balanced.

  21. Steps of the Scientific Method

    The six steps of the scientific method include: 1) asking a question about something you observe, 2) doing background research to learn what is already known about the topic, 3) constructing a hypothesis, 4) experimenting to test the hypothesis, 5) analyzing the data from the experiment and drawing conclusions, and 6) communicating the results ...

  22. PDF Techniques Used in Hypothesis Testing in Research Methodology

    1.5 Numerical Steps in Testing of Hypothesis. Establish the null hypothesis and alternative hypothesis. set up a suitable significance level e.g.at 1%, 5%, 10% level of significance etc. Determine a suitable test tool like t, Z, F, Chi Square, ANOVA etc. Calculate the value of test statistic using any of test tools.