Hypothesis testing is a way to ask whether sample data looks too inconsistent with a starting claim. That starting claim is called the null hypothesis, written .
The method does not prove true or false. It asks a narrower question: if were true, would data this extreme be unusual enough that we should doubt it?
The Core Idea
Every hypothesis test has two competing statements:
- The null hypothesis , which is the default claim being tested.
- The alternative hypothesis or , which is what you would support if the data gives enough evidence against .
You then choose a significance level , often , before looking at the result. This is the cutoff for how much evidence you require before rejecting .
Two outcomes are possible:
- Reject : the data is sufficiently inconsistent with the null model.
- Fail to reject : the data is not strong enough to rule out the null model.
"Fail to reject" is not the same as "accept as true." It only means the sample did not provide strong enough evidence against .
The Usual Steps
The workflow is usually:
- State and clearly.
- Choose and a test that matches the data and assumptions.
- Compute a test statistic from the sample.
- Turn that statistic into a -value or compare it with a critical value.
- Make the decision and interpret it in context.
The test statistic depends on the situation. A -test, -test, chi square test, and many others are all examples of hypothesis tests. There is no single formula for all of hypothesis testing.
What The -Value Means
A -value is the probability, assuming is true and the test assumptions hold, of getting a result at least as extreme as the one observed.
A small -value means the data would be unusual under . That is why small -values count as evidence against the null hypothesis.
It does not mean:
- The probability that is false.
- The probability that your result happened "by random chance" in a vague everyday sense.
- The size or importance of the effect.
Main Types Of Hypothesis Tests
There are two useful ways to group tests.
By Direction
A one-tailed test looks for change in one direction only.
- Right-tailed: values larger than the null claim support .
- Left-tailed: values smaller than the null claim support .
A two-tailed test looks for a difference in either direction. If is "not equal," the rejection region is split across both tails.
By Data Situation
- A -test is used for some mean-testing settings when population standard deviation is known or a justified large-sample approximation is being used.
- A -test is common for means when the population standard deviation is unknown and conditions are reasonable.
- A chi square test is used for categorical count data.
The right test depends on the variable type, sample design, and assumptions. Choosing the formula first and the question second is a common mistake.
Worked Example
Suppose a filling machine is supposed to average mL per bottle. A quality-control team takes a sample of bottles and gets a sample mean of mL.
Assume, for this example, that the population standard deviation is known to be mL and the sampling conditions justify a one-sample -test.
Set up the hypotheses:
This is a left-tailed test because the concern is underfilling.
The standard error is
So the test statistic is
If for a left-tailed -test, the critical value is about . Because , the result falls in the rejection region.
So the decision is to reject at the level. In context, the sample provides evidence that the machine is underfilling on average.
That conclusion depends on the test assumptions. If the assumptions are poor, the conclusion may be unreliable even if the arithmetic is correct.
Type I And Type II Errors
Hypothesis testing always involves error risk.
A Type I error means rejecting even though it is true. Its probability is controlled by .
A Type II error means failing to reject even though is true. Its probability is usually written .
Lowering makes false alarms less likely, but it can also make true effects harder to detect if nothing else changes. That tradeoff is one reason sample size matters.
Common Mistakes
One common mistake is saying a non-significant result proves there is no effect. Usually it only shows the data was not strong enough to detect one.
Another mistake is treating statistical significance as practical importance. A tiny effect can be statistically significant in a very large sample.
People also misuse tests by ignoring assumptions about independence, distribution shape, variance, or data type. A clean-looking -value does not rescue a mismatched test.
When Hypothesis Testing Is Used
Hypothesis testing is used in science, manufacturing, medicine, surveys, A/B testing, and policy analysis. The goal is usually the same: decide whether the sample gives enough evidence to question a default claim.
In practice, good testing is not just about the calculation. It also requires a sensible null hypothesis, a defensible design, and an interpretation that matches what the test can actually say.
Try Your Own Version
Take the same bottle-filling example, but change the sample mean to mL. Recompute the test statistic and see whether the decision changes at . That is a quick way to see how evidence gets stronger or weaker as the sample result moves closer to the null value.
Need help with a problem?
Upload your question and get a verified, step-by-step solution in seconds.
Open GPAI Solver →