CHAPTER 03 · TOPIC 03
Hypothesis Testing
Study null and alternative hypotheses, one- and two-sided tests, errors, power, p-values, critical values, and confidence intervals.
On this page
- Basic steps for hypothesis testing
- Null hypothesis and alternative hypothesis
- How the data is processed determines the reference distribution
- One-tailed and two-tailed tests
- Type I Error, Type II Error, and Statistical Power
- What Is a p-Value?
- The three judgment methods are looking at the same object
- 1. p-value method
- 2. Critical value method
- 3. Confidence interval method
Hypothesis testing is a method of formulating a testable hypothesis about unknown parameters and determining whether observed results are consistent with that hypothesis based on sample information. Rather than directly proving the truth of a hypothesis, it measures how rare the current result would be if the hypothesis were true.
Basic steps for hypothesis testing#
- Write the null hypothesis H₀ and alternative hypothesis H₁ (Hₐ) from the research problem
- Before looking at the results, decide on the significance level α and whether it is one-sided or two-sided.
- Choose test statistics based on data type, study design, and assumptions
- Define the sampling distribution of the statistic under H₀
- Calculate the statistic and p-value from the sample and also compare them with critical values and confidence intervals
- Decide whether or not to reject H₀, then return to the research question and interpret it.
Null hypothesis and alternative hypothesis#
It transforms a research question into two opposing statistical propositions about the relationship between parameters and populations.
| hypothesis | role | typical shape |
| Null hypothesis H₀ | Starting point for the test. There is no difference/relationship, or the parameter is equal to the specified value | H₀: μ=μ₀ |
| Alternative hypothesis H₁/Hₐ | The direction we expect the data to support | H₁: μ≠μ₀、μ>μ₀、μ<μ₀ |
How the data is processed determines the reference distribution#
Different statistics can be created from the same data depending on the question. The selection of Z, t, χ², and F is determined not by the name of the original data, but by which distribution the statistic after the specified operation follows under H₀.
| Statistics/research questions | Main reference distribution under H₀ |
| Standardized mean with known population standard deviation | Standard normal Z distribution |
| The mean of the unknown population standard deviation estimated by the sample standard deviation | t distribution |
| Sum of squares of standard normal variables, variance related, some categorical data | chi-square distribution |
| Ratio of two independent variance components | F distribution |
One-tailed and two-tailed tests#
The hem is more extreme than H₀ and supports H₁. A two-tailed test asks "are they different?" and places a rejection region at both ends, while a one-sided test specifies in advance the direction of "greater" or "lesser."
| Direction | Example alternative hypothesis | Rejection region |
| two-sided | μ≠μ₀ | Left and right each α/2 |
| right-tailed | μ>μ₀ | Right-tail area α |
| left-tailed | μ<μ₀ | Left-tail area α |
If you have a symmetric Z or t distribution, the direction of observation is consistent with a one-sided H₁, and you are comparing the same statistics, the two-sided p-value is usually twice the corresponding one-sided p-value. It is not applicable to all distributions or observations in the opposite direction.
Type I Error, Type II Error, and Statistical Power#
Statistical judgments can be wrong because there is random variation in the sample. Combine and distinguish between true states and judgments.
| Judgment/true state | H₀ is true | H₀ is false |
| Reject H₀ | Type I error, probability α | Correct judgment, power 1−β |
| Do not reject H₀ | Correct judgment, probability 1−α | Type II error, probability β |
If all other conditions are the same and only the rejection boundary is moved, the lower α is, the easier it is for β to rise. On the other hand, increasing sample size, reducing measurement variation, and increasing the true effect increase power without loosening α.
What Is a p-Value?#
The p-value is the probability of obtaining an extreme result that is as strong or more supportive of the observed test statistic, given that H₀ is true. The "more extreme" direction depends on the predetermined one or both sides.
Determine α (eg 0.05) before analysis, and if p≤α, reject H₀, and if p>α, do not reject. Although a smaller p-value provides stronger evidence against H₀, it does not mean that the effect is large, the study quality is high, or it is clinically important.
The three judgment methods are looking at the same object#
The p-value method, critical value method, and confidence interval method all return the observed results to the sampling distribution under H₀ and determine whether they exceed a pre-allowed range. These are different perspectives: area, location, and parameter range.
| method | What to compare | Conditions for rejecting H₀ |
| p-value method | Tail area under H₀ that is more extreme than the observed value | p≤α |
| critical value method | Statistics and rejection region boundaries | Exceeds the critical value and enters the rejection region |
| confidence interval method | Is the population value of H₀ within a reasonable estimation range? | In a two-tailed test, the null value corresponds to outside the (1−α) interval |
1. p-value method#
From the observed statistics, calculate the tail area that is more extreme than the same in the H₀ distribution and compare it with the predetermined α.
2. Critical value method#
α defines a rejection region of total area α on the H₀ distribution, and the boundary is called the critical value. A statistic crossing the boundary is equivalent to p≤α.
3. Confidence interval method#
A two-tailed test corresponding to the same model and α creates a (1−α)×100% confidence interval. If the specified value of H₀ is outside the interval, it will be rejected; if it is within the interval, it will not be rejected.
| Symbol | Meaning |
| H₀ | null hypothesis |
| H₁、Hₐ | alternative hypothesis |
| α | Significance level. Type I error probability when H₀ is true |
| β | Type II error probability when the specified H₁ is true |
| 1−β | statistical power |
| p | Probability of obtaining more extreme results than the current one under H₀ |
| CI | confidence interval |
| critical value | Boundary of rejection region |