课代表立正
Increase sample size N to reduce standard error, which directly shrinks the minimum detectable effect while preserving target alpha and beta rates.
AI-assisted summary of Hypothesis Testing Explained|假设检验详解:Alpha、Beta、Power、MDE与样本量 — original source. Check the original for full context.
Source published:
Detailed notes
## Background This video was published on YouTube by 课代表立正 on August 29, 2026. According to the page description, it is a visual, formula-light tutorial co-produced with the Statsig data science team that rebuilds hypothesis testing from first principles, disentangling Fisher’s significance testing from the Neyman–Pearson framework. Presented by Yuzheng Sun, PhD, the guide covers fundamental experimentation concepts such as null vs. alternative hypotheses, Type I and Type II errors, statistical power, MDE, and sample size relationships.
## TL;DR Data science content creator Yuzheng Sun breaks down hypothesis testing into an intuitive mental model, addressing common misunderstandings rooted in blended textbook definitions. The walkthrough establishes the null hypothesis, standard error, Type I error (alpha), and critical value thresholds before introducing alternative hypotheses, Type II error (beta), and statistical power. Power is explored through graphical, real-world, and sample size lenses, illustrating how larger sample sizes narrow distribution curves and boost detection capability. Finally, the tutorial defines the Minimum Detectable Effect (MDE) and shows how increasing sample size lowers the MDE, framing the fundamental tradeoffs between speed, scale, and effect size in experimentation.
## Atmosphere & style The video has an educational, grounded, and candid tone, balancing high-level technical rigor with approachable visual explanations. Speaker Yuzheng Sun conveys an empathetic and relatable posture by sharing his own past struggles with textbook definitions, using light self-deprecating humor about data science misconceptions. The dynamic feels like a clear, step-by-step masterclass that demystifies abstract statistical jargon into intuitive physical concepts.
## Key takeaways - [00:00](https://www.youtube.com/watch?v=nCBIotZzPEM&t=0s) Standard textbooks and online sources often present an inconsistent blend of Fisher's p-value significance testing and the Neyman-Pearson decision framework, causing widespread confusion among data scientists. - [02:46](https://www.youtube.com/watch?v=nCBIotZzPEM&t=166s) Under the null hypothesis (H0), which assumes no treatment effect, the sample mean distribution approaches a normal distribution for sufficiently large sample sizes (N ≥ 30) by the Central Limit Theorem. - [02:46](https://www.youtube.com/watch?v=nCBIotZzPEM&t=166s) Standard deviation measures population variability, whereas standard error measures the error of the sample mean and decreases as sample size grows (SE = σ / √N). - [02:46](https://www.youtube.com/watch?v=nCBIotZzPEM&t=166s) Type I error (alpha) is the probability of falsely rejecting the null hypothesis when it is true, and its threshold is set by choosing a critical value. - [06:41](https://www.youtube.com/watch?v=nCBIotZzPEM&t=401s) An alternative hypothesis (H1) represents a theoretical construct; in practice, infinitely many potential alternative hypotheses exist. - [06:41](https://www.youtube.com/watch?v=nCBIotZzPEM&t=401s) Type II error (beta) is the probability of falsely accepting the null hypothesis when a specific alternative hypothesis is actually true. - [09:26](https://www.youtube.com/watch?v=nCBIotZzPEM&t=566s) Statistical power equals 1 - beta and represents the probability of correctly detecting a true treatment effect when one exists. - [09:26](https://www.youtube.com/watch?v=nCBIotZzPEM&t=566s) Increasing sample size shrinks standard error, narrowing distributions and shifting the critical value threshold to significantly increase statistical power. - [11:23](https://www.youtube.com/watch?v=nCBIotZzPEM&t=683s) Minimum Detectable Effect (MDE) is the smallest true treatment effect size that an experimental design can reliably detect at a given power threshold (e.g., 80%). - [11:23](https://www.youtube.com/watch?v=nCBIotZzPEM&t=683s) As sample size increases while holding alpha and beta constant, the Minimum Detectable Effect (MDE) decreases. - [14:26](https://www.youtube.com/watch?v=nCBIotZzPEM&t=866s) Variance reduction techniques like CUPED increase statistical power by reducing population variance (sigma) without needing larger sample sizes. - [14:26](https://www.youtube.com/watch?v=nCBIotZzPEM&t=866s) Practical experimentation requires balancing speed of execution, scale (sample size), and the expected Minimum Detectable Effect (MDE).
## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=nCBIotZzPEM&t=0s) Why Hypothesis Testing Matters
Having created over 500 videos as a data science content creator, speaker Yuzheng Sun introduces this tutorial as the first video he would classify as a absolute "must watch" for every data scientist. Hypothesis testing stands out as one of the most fundamental, universal concepts in data science, yet it remains notoriously confusing and widely misunderstood. In fact, Sun jokes that you could easily set up an arbitrage strategy by betting against fellow data scientists on these foundational concepts; most would eagerly take the bet thinking they understand the subject well, only to lose because the underlying principles are so frequently muddled.
The core reason for this widespread confusion is that standard academic textbooks present an inconsistent, frankensteinian blend of two distinct historical frameworks: Ronald Fisher’s $p$-value significance testing and the Neyman–Pearson decision-making framework. Online blog posts and articles only exacerbate the problem by churning out conflicting summaries. Sun candidly admits that despite holding a PhD and working as an experienced data scientist specializing in experimentation, he did not truly understand hypothesis testing at a first-principles level until recently. When he voiced this realization on LinkedIn, it resonated broadly across the professional community. Many data scientists admitted that whenever they need to discuss concepts like $\alpha$, $\beta$, or power, they still have to run back to textbook definitions—a clear signal that they lack a grounded, intuitive mental model.
To solve this, Sun collaborated with the experimentation data science team at Statsig, leveraging their years of hands-on experience helping customers navigate both theoretical and practical experimentation challenges. Through hundreds of client conversations and six thorough revisions, they distilled these concepts down into a visual, formula-light tutorial designed from first principles. The goal is to make these concepts so intuitive that even middle school students can grasp them, while remaining rigorous and technically consistent. The video covers ten core concepts introduced incrementally across four main stages: 1. The null hypothesis, Type I error, $\alpha$, and critical values 2. The alternative hypothesis, Type II error, $\beta$, and statistical power 3. How statistical power scales with sample size 4. The Minimum Detectable Effect (MDE) and its relationship to sample size
- The tutorial synthesizes years of experimentation consulting at Statsig into a formula-free, visual-first framework. - The presentation was rewritten six times to ensure complete technical consistency without sacrificing accessibility.
---
[02:46](https://www.youtube.com/watch?v=nCBIotZzPEM&t=166s) Null Hypothesis, Alpha, and the Critical Value
The walkthrough begins with the baseline case: the null hypothesis ($H_0$), which posits that there is no treatment effect whatsoever. In A/B testing, this is mathematically represented as the difference in means between the treatment and control groups being zero ($\mu_{\text{treatment}} - \mu_{\text{control}} = 0$). By the Central Limit Theorem, the distribution of this sample mean difference approaches a normal distribution as long as the sample size is sufficiently large—where a sample size of $N = 30$ is already enough for the theorem to hold.
At this point, Sun pauses to clarify a vital distinction that often trips people up: standard deviation versus standard error. Standard deviation measures the spread or error of the underlying population distribution. Standard error, on the other hand, measures the error of the sample mean itself. If you draw a single observation from the population, it can land anywhere across the population curve. However, when you draw a sample of observations and average them, the sample mean becomes much tighter and less variable for two reasons: individual observations are more likely to center around the mean, and extreme values on the left and right sides cancel each other out. Consequently, standard error equals standard deviation divided by the square root of the sample size ($\text{SE} = \frac{\sigma}{\sqrt{N}}$). Assuming a simplified null hypothesis where the underlying population distribution has a mean of $0$ and a standard deviation of $1$, a sample size of $N = 30$ yields a standard error of $1 / \sqrt{30} \approx 0.18$.
In hypothesis testing, we draw a sample mean and render a decision: do we accept or reject the null hypothesis? Sun anticipates a classic pedantic objection—addressing whether saying "accept the null hypothesis" rather than "fail to reject the null hypothesis" is technically wrong. He notes that in a simplified setup with only two defined choices, saying "accept the null" is logically sound and far more intuitive for building incremental understanding. Because we operate in a world of random sampling and probability, we can never be 100% certain. Any sample mean along the x-axis can occur by chance, so decision rules must intentionally trade off specific rates of error against the ability to make meaningful discoveries. If a decision rule is made too conservative, you will make zero false positives, but you will also never discover anything new.
To establish a decision rule, we pick a decision threshold along the x-axis known as the critical value. Observed sample means falling below this threshold lead us to accept the null hypothesis, while sample means above it prompt us to reject it. When considering *only* the null hypothesis, there is only one type of mistake possible: a Type I error, which occurs when the null hypothesis is true, but we accidentally reject it due to random noise. The probability of making a Type I error is represented by the area under the tail of the null distribution beyond the critical value, denoted as $\alpha$ (alpha). If an experimenter chooses a standard significance level of $\alpha = 0.05$ (5%), working backward from the sample mean distribution ($\text{SE} \approx 0.18$) yields a critical value threshold of $0.30$.
- **Null Hypothesis ($H_0$):** Assumes zero treatment effect ($\mu_{\text{treatment}} - \mu_{\text{control}} = 0$). - **Central Limit Theorem Rule of Thumb:** $N \ge 30$ is generally sufficient for sample means to approximate a normal distribution. - **Standard Error Formula:** $\text{SE} = \sigma / \sqrt{N}$. With $\sigma = 1$ and $N = 30$, $\text{SE} \approx 0.18$. - **Critical Value Example:** Setting $\alpha = 0.05$ under this specific setup places the decision threshold at a critical value of $0.30$.
---
[06:41](https://www.youtube.com/watch?v=nCBIotZzPEM&t=401s) Alternative Hypothesis, Beta, and Statistical Power
To move beyond avoiding false alarms and actually make scientific discoveries, an alternative hypothesis ($H_1$) must be introduced. Sun highlights a critical insight that standard textbooks rarely emphasize: in reality, there are infinitely many possible alternative hypotheses. An alternative hypothesis is a theoretical construct rather than a single fixed reality; given any observed data point, countless potential alternative distributions could be true with varying probabilities. While the tutorial later addresses how to navigate this infinite set via MDE, it first simplifies the picture by focusing on a single specific alternative hypothesis: one with a true underlying treatment effect mean of $0.5$ and a standard deviation of $1$.
Introducing this specific alternative hypothesis allows the decision rule to be updated. For a sample size of $N = 30$ with a critical value threshold of $0.30$: if the observed sample mean is above $0.30$, we reject $H_0$ and accept $H_1$; if it falls below $0.30$, we accept $H_0$ and reject $H_1$. However, if this alternative hypothesis actually reflects the ground truth, arriving at a sample mean below $0.30$ causes us to mistakenly reject $H_1$. This mistake is called a Type II error—falsely rejecting the alternative hypothesis when it is in fact true. The probability of making a Type II error is designated as $\beta$ (beta).
Sun stresses that $\beta$ is fundamentally tied to the specific alternative hypothesis selected. Shift the assumed alternative distribution left or right, and $\beta$ changes immediately. Three distinct factors dictate the magnitude of $\beta$: 1. The standard error of the alternative distribution 2. The assumed effect size (mean) of the alternative hypothesis 3. The chosen critical value (which is anchored to your target $\alpha$)
If you assume a conservative alternative hypothesis (a mean close to 0), $\beta$ will be very large. If you assume an extreme alternative hypothesis (a mean far to the right), $\beta$ becomes very small. This setup brings us directly to the core tradeoff between making mistakes and making discoveries.
- **Infinite Alternatives:** An infinite number of alternative hypotheses exist theoretically; selecting one allows for explicit decision parameterization. - **Example Alternative Setup:** Mean effect $\mu_1 = 0.5$, $\sigma = 1$. - **Type II Error ($\beta$):** The probability of failing to detect a real effect (falsely rejecting $H_1$ when $H_1$ is true). - **Key Drivers of $\beta$:** Standard error ($\text{SE}$), distance of the alternative mean from zero, and the chosen critical value.
---
[09:26](https://www.youtube.com/watch?v=nCBIotZzPEM&t=566s) Statistical Power in Three Views
Statistical power is the central engine of hypothesis testing, yet textbooks routinely gloss over it with a brief mathematical definition: $\text{Power} = 1 - \beta$. Sun argues that simply knowing this formula is insufficient and breaks power down into three complementary mental models:
1. **The Graphical View:** On the visual distribution plot, power is the shaded area under the alternative hypothesis curve that falls to the *right* of the critical value threshold ($1 - \beta$). It represents the precise probability of correctly accepting a specific alternative hypothesis under your decision rules and assumptions. 2. **The Intuitive Real-World Analogy:** Power measures how capable your test is at detecting a true effect if one exists. Sun illustrates this with a simple real-world example: trying to determine the most popular car manufacturer. If you stand on a corner and observe only a single car, your observation has virtually no statistical power to reveal real brand dominance. But if you survey one million cars across the country, your sample provides immense power to spot true market trends. In short, higher power means a better chance of detecting reality. 3. **The Sample Size & Distribution View:** To see how sample size directly generates power, consider shifting the sample size from $N = 30$ to $N = 100$. Increasing $N$ reduces the standard error ($\text{SE} = \sigma / \sqrt{N}$), causing both the null and alternative probability curves to become significantly narrower and taller. If we maintain our target Type I error rate at $\alpha = 0.05$, this narrower null distribution shifts the critical value threshold much closer to zero. Combining a smaller critical value with a tighter alternative distribution dramatically reduces the area under the left tail ($\beta$), leaving a much larger area to the right. Consequently, the test gains substantial statistical power to catch the effect.
- **Textbook Formula:** $\text{Power} = 1 - \beta$. - **Car Analogy:** Observing 1 car yields low power; observing 1,000,000 cars yields high power to detect true underlying patterns. - **Impact of Increasing Sample Size ($N = 30 \to 100$):** Standard error shrinks $\to$ distributions narrow $\to$ critical value shifts left (for fixed $\alpha$) $\to \beta$ collapses $\to$ statistical power increases significantly.
---
[11:23](https://www.youtube.com/watch?v=nCBIotZzPEM&t=683s) MDE and Sample Size
With the foundational concepts established, Sun resolves the puzzle of how to handle "infinitely many alternative hypotheses" by introducing the Minimum Detectable Effect (MDE). Because alternative hypotheses are theoretical constructs, an experimenter can evaluate any hypothetical mean along the axis. In a sample of $N = 30$ with $\alpha = 0.05$, an alternative hypothesis centered at $\mu = 0.50$ yields $\beta = 0.14$ (Power = $86\%$). If we evaluate a more conservative alternative centered closer at $\mu = 0.45$, the overlap with the critical value increases, raising $\beta$ to $0.20$ (Power = $80\%$).
Because practitioners always desire higher power to detect real improvements, any true effect size situated to the *right* of this $\mu = 0.45$ threshold will be detected with *even greater* power (lower $\beta$). Therefore, $0.45$ represents the Minimum Detectable Effect—the smallest true treatment effect size that the experimental design can reliably catch at the required power threshold (e.g., $80\%$).
To tie every concept in the tutorial together, Sun walks through how MDE scales when sample size increases from $N = 30$ to $N = 100$ while holding both $\alpha$ (5%) and $\beta$ (20%) strictly constant: - As $N$ grows from $30$ to $100$, the standard error contracts, narrowing the sampling distributions. - Holding $\alpha = 0.05$ pushes the critical value threshold to the left. - Holding $\beta = 0.20$ (80% power) forces the required alternative distribution to slide closer to the null mean. - As a direct result, the MDE drops from $0.45$ down to $0.25$.
This demonstrates the core rule of experimental design: **as sample size increases, MDE decreases.** A larger sample size allows an experiment to detect much smaller, subtle nuances. Conversely, if a feature change produces a massive treatment effect, an organization does not need billions of users or huge sample sizes to validate it—a small sample size will easily detect a large effect with high statistical power.
- **MDE Definition:** The smallest true effect size ($\mu_1$) that can be detected for a given $\alpha$, $\beta$, and sample size $N$. - **MDE Scaling Example:** Increasing sample size from $N = 30$ to $N = 100$ (with fixed $\alpha = 0.05, \beta = 0.20$) reduces the MDE from $0.45$ to $0.25$. - **Practical Implication:** Companies without massive user bases can still run reliable A/B tests, provided their product changes produce large impact sizes.
---
[14:26](https://www.youtube.com/watch?v=nCBIotZzPEM&t=866s) Key Takeaways and Practical Applications
Sun concludes by emphasizing that a deep, intuitive mastery of statistical power is the prerequisite foundation for almost every advanced topic in A/B testing and experimentation. Without a solid first-principles understanding of power, advanced techniques remain abstract and prone to misapplication.
He highlights several real-world experimentation challenges that tie directly back to power: - **Variance Reduction Techniques (e.g., CUPED):** While the tutorial held standard deviation constant at $\sigma = 1$, real-world data is noisy. Advanced techniques like CUPED reduce variance ($\sigma$), which shrinks the standard error and boosts statistical power without requiring larger user samples. - **Sequential Testing & Early Peeking:** Running underpowered tests or continually checking results without adjusting thresholds leads to false discoveries and poor business decisions. - **The Experimentation Tradeoff:** Practical A/B testing is a constant balancing act between three competing forces: execution speed, scale (sample size), and the expected minimum effect size you aim to detect.
Sun closes by encouraging viewers to use this visual mental model when explaining experimentation trade-offs to business stakeholders, saving hours of confusion down the road.
- **CUPED & Variance Reduction:** Reduces $\sigma$ directly, shrinking standard error to increase statistical power without extending runtime. - **The Triad of Experimentation:** Speed of iteration, sample scale, and target MDE are inherently linked through statistical power.
<ElicitationsGroup message="Where would you like to go next with these statistical concepts?"> <Elicitation label="Explain how CUPED reduces variance mathematically" query="Explain how CUPED (Controlled-Experiments Using Pre-Experiment Data) reduces variance and increases statistical power in A/B testing."/> <Elicitation label="Compare Fisher vs. Neyman-Pearson frameworks" query="Break down the historical and theoretical differences between Ronald Fisher's p-value significance testing and the Neyman-Pearson decision framework."/> <Elicitation label="Calculate required sample size for a custom A/B test" query="How do I calculate the required sample size for an A/B test given a target baseline conversion rate, MDE, alpha, and power?"/> </ElicitationsGroup>
## Notable quotes > [00:00](https://www.youtube.com/watch?v=nCBIotZzPEM&t=0s) Hypothesis testing stands out as one of the most fundamental, universal concepts in data science, yet it remains notoriously confusing and widely misunderstood. — Yuzheng Sun
> [00:00](https://www.youtube.com/watch?v=nCBIotZzPEM&t=0s) you could easily set up an arbitrage strategy by betting against fellow data scientists on these foundational concepts — Yuzheng Sun
> [00:00](https://www.youtube.com/watch?v=nCBIotZzPEM&t=0s) standard academic textbooks present an inconsistent, frankensteinian blend of two distinct historical frameworks: Ronald Fisher’s p-value significance testing and the Neyman–Pearson decision-making framework. — Yuzheng Sun
> [02:46](https://www.youtube.com/watch?v=nCBIotZzPEM&t=166s) Standard deviation measures the spread or error of the underlying population distribution. Standard error, on the other hand, measures the error of the sample mean itself. — Yuzheng Sun
> [02:46](https://www.youtube.com/watch?v=nCBIotZzPEM&t=166s) Any sample mean along the x-axis can occur by chance, so decision rules must intentionally trade off specific rates of error against the ability to make meaningful discoveries. — Yuzheng Sun
> [06:41](https://www.youtube.com/watch?v=nCBIotZzPEM&t=401s) in reality, there are infinitely many possible alternative hypotheses. — Yuzheng Sun
> [06:41](https://www.youtube.com/watch?v=nCBIotZzPEM&t=401s) Type II error—falsely rejecting the alternative hypothesis when it is in fact true. — Yuzheng Sun
> [09:26](https://www.youtube.com/watch?v=nCBIotZzPEM&t=566s) Statistical power is the central engine of hypothesis testing, yet textbooks routinely gloss over it with a brief mathematical definition — Yuzheng Sun
> [09:26](https://www.youtube.com/watch?v=nCBIotZzPEM&t=566s) If you stand on a corner and observe only a single car, your observation has virtually no statistical power to reveal real brand dominance. But if you survey one million cars across the country, your sample provides immense power to spot true market trends. — Yuzheng Sun
> [11:23](https://www.youtube.com/watch?v=nCBIotZzPEM&t=683s) as sample size increases, MDE decreases. — Yuzheng Sun
> [11:23](https://www.youtube.com/watch?v=nCBIotZzPEM&t=683s) a small sample size will easily detect a large effect with high statistical power. — Yuzheng Sun
> [14:26](https://www.youtube.com/watch?v=nCBIotZzPEM&t=866s) Practical A/B testing is a constant balancing act between three competing forces: execution speed, scale (sample size), and the expected minimum effect size you aim to detect. — Yuzheng Sun
## Mentioned Yuzheng Sun, Statsig, Ronald Fisher, Jerzy Neyman, Egon Pearson, YouTube, LinkedIn, CUPED
[Source](https://www.youtube.com/watch?v=nCBIotZzPEM)