Introduction
Welcome to the next lesson in our exploration of statistical inference. In our previous session, we established a powerful principle for designing hypothesis tests: the Neyman-Pearson Lemma. It showed that the Likelihood Ratio Test (LRT) is the most powerful test for a given significance level, . This means for a fixed probability of a Type I error (rejecting a true null hypothesis), the LRT gives you the best possible chance of correctly identifying a true effect.
This naturally leads to a crucial question: What is the relationship between the two types of errors? Can we simply make both the Type I error rate () and the Type II error rate () as small as we want?
In this lesson, we will dissect this very relationship. We will define and explore the mathematical trade-off between Type I and Type II errors and formally introduce the concept of statistical power. Understanding this trade-off is not just a theoretical exercise; it is fundamental to designing effective experiments and correctly interpreting their results.
1. The Four Outcomes of a Hypothesis Test
Every hypothesis test, like a verdict in a trial, has four possible outcomes. Two are correct decisions, and two are errors. Let's formalize this.
We start with our two hypotheses:
- Null Hypothesis (): There is no effect or no difference. This is the default assumption.
- Alternative Hypothesis (): There is an effect or a difference. This is what we are typically trying to find evidence for.
The four outcomes can be summarized in a confusion matrix:
| Reality: is True | Reality: is False ( is True) | |
|---|---|---|
| Decision: Fail to Reject | Correct Decision (True Negative) Probability = |
Type II Error (False Negative) Probability = |
| Decision: Reject | Type I Error (False Positive) Probability = |
Correct Decision (True Positive) Probability = |
- Type I Error (): The probability of rejecting the null hypothesis when it is actually true. This is also called the significance level of the test.
- Type II Error (): The probability of failing to reject the null hypothesis when it is actually false.
- Statistical Power (): The probability of correctly rejecting the null hypothesis when it is false. This is the test's ability to detect an effect when one truly exists. It is the probability of a "true positive."
To build a strong intuition for these concepts, please watch the following video. It uses a clear courtroom analogy before transitioning to the statistical definitions.
HYPOTHESIS TESTING BASICS: Type 1/Type 2 errors | Statistical power
This video from the zedstatistics channel provides an excellent introduction to Type I and Type II errors and power, using intuitive analogies and clear visualizations.
Watch the segments from 01:04 to 07:04. The first part uses the classic courtroom analogy, and the second part generalizes this to a typical statistical test framework. Focus on grasping the meaning of 'false positive,' 'false negative,' and the definition of power.
2. The Visual Trade-off Between and
For a fixed sample size, and have an inverse relationship. Decreasing one inevitably increases the other. The best way to understand this is by visualizing the sampling distributions of our test statistic under both the null and alternative hypotheses.
Imagine we are testing the mean of a population, , with vs. . Our test statistic is the sample mean, .
- Under , follows a distribution centered at .
- Under , follows a distribution centered at .
Our decision rule is to reject if exceeds some critical value, .

- (the blue shaded area) is the probability of getting an in the rejection region if is true.
- (the green shaded area) is the probability of getting an in the acceptance region if is true.
- Power () is the remaining area under the curve (the unshaded part of the green distribution).
Now, what happens if we change the critical value ?
- To decrease , we must make our test stricter by increasing (shifting the decision boundary to the right). As the diagram shows, this simultaneously increases the area of .
- To decrease (and increase power), we must make our test more lenient by decreasing (shifting the decision boundary to the left). This simultaneously increases the area of .
This illustrates the fundamental trade-off. For a fixed sample size, you can't have your cake and eat it too. The following segment of the video you started watching provides a dynamic visualization of this trade-off.
HYPOTHESIS TESTING BASICS: Type 1/Type 2 errors | Statistical power
Let's return to the zedstatistics video, which now beautifully visualizes the concepts from the diagram above using overlapping distribution curves.
Please watch the segment from 09:00 to 12:49. Pay close attention to how the areas representing \alpha and eta change in relation to each other as the decision threshold is conceptually moved.
3. Escaping the Trade-off: The Role of Sample Size and Effect Size
If we are stuck with this trade-off, how can we design a test that is both highly significant (low ) and highly powerful (low )? There are two main levers we can pull:
-
Increase the Sample Size (): As we've seen before, the standard error of the mean is . A larger sample size leads to a smaller standard error. This makes the sampling distributions for under both and much narrower, or "skinnier." When the distributions become narrower, their overlap decreases. This allows us to find a critical value that keeps low while also making small. This is the primary way researchers design powerful experiments.
-
Increase the Effect Size (): The "effect size" is the magnitude of the difference between the null and alternative hypotheses. If the true effect is very large (i.e., is far from ), their distributions will be far apart, with little overlap. This makes it very easy to distinguish between them, leading to a high-power test. While we usually can't control the true effect size, understanding its role is crucial for interpreting power.
The final part of the zedstatistics video explains these two points very clearly.
HYPOTHESIS TESTING BASICS: Type 1/Type 2 errors | Statistical power
This last segment of the video will complete our intuitive understanding by showing how sample size and the difference between hypotheses affect the power of a test.
Watch the final part from 12:49 to 14:50. Focus on the visual intuition of how fatter/skinnier curves (related to sample size) and the distance between curves (related to effect size) impact the overlapping area, and thus the power.
4. A Mathematical Formulation
As you appreciate the mathematical details, let's formalize the relationship we just visualized. We can derive an equation that connects , , sample size , variance , and the effect size.
The following document provides a concise and clear derivation.
[PDF] Power(ful) Guidelines for Experimental Economists
This guide from the European Bank for Reconstruction and Development, aimed at experimental economists, gives a very practical and clear mathematical derivation of statistical power.
Read pages 3-5, starting from the Null/Alternate Hypothesis definitions and ending at Equation (1). Follow the derivation closely. It starts by defining \alpha and eta in terms of the critical value 'c', standardizes them, and then combines the two expressions to solve for the sample size, n.
Let's summarize the key steps of the derivation for a one-sided test vs where .
-
Define : The probability of rejecting when it's true.
Standardizing this gives:
(Note: The resource uses which is the same as , the critical value for a one-tailed test). -
Define : The probability of failing to reject when it's false.
Standardizing this gives: -
Equate and Solve for : Since is the same in both equations, we can set them equal to each other and solve for the sample size :
Rearranging yields the famous sample size formula:
This equation is the mathematical embodiment of the trade-offs:
- To achieve smaller and (which means larger and ), you need a larger sample size .
- A larger effect size reduces the required sample size .
5. The Power Function
So far, we've focused on simple alternative hypotheses (). But what if our alternative is composite, like ? We can evaluate our test's performance by defining a power function, , which gives the probability of rejecting for any possible value of .
- Power Function: .
This function has two key properties:
- When is in the null region (e.g., ), the power function gives the Type I error rate: .
- When is in the alternative region, the power function gives the power: .
Ideally, we want a power function that is close to 0 for all under and close to 1 for all under . The following reading explains this concept formally.
[PDF] MATH 4752/6752 – Mathematical Statistics II Hypothesis Testing
These lecture slides from Georgia State University provide a formal definition of the power function and illustrate its properties with a clear example and graph.
Read pages 15-19. Focus on the definition of the power function \pi( heta) and look at the example graph. This will help you understand how a test's power changes as the true parameter value moves further away from the null hypothesis.
Conclusion
In this lesson, you explored the critical relationship between the errors in hypothesis testing. This is a crucial concept that separates elementary applications of statistics from the thoughtful design of experiments.
Key Takeaways:
- Hypothesis testing involves a trade-off between Type I error () and Type II error (). For a fixed sample size, they are inversely related.
- Statistical power () is the probability of detecting a real effect, making it a key measure of a test's sensitivity.
- The trade-off can be overcome by increasing the sample size (), which reduces the overlap between the distributions under and .
- Power is also higher for larger effect sizes (greater differences between the null and alternative hypotheses).
- The power function generalizes the concept of power to composite hypotheses, showing how a test's ability to reject changes as a function of the true parameter value.
Preview of the Next Lesson:
In our examples, we have often assumed the population variance is known. In the real world, this is rarely the case. In our next lesson, we will address this by deriving the one-sample t-test statistic, a workhorse of applied statistics used when both the mean and variance must be estimated from the data. This will involve introducing a new probability distribution: Student's t-distribution.