Tutorials › Biostatistics › Type I and Type II Errors in Hypothesis Testing

Hypothesis Testing

Type I and Type II Errors in Hypothesis Testing

A practical guide to false positives and false negatives in statistical hypothesis testing, including alpha, beta, statistical power, sample size, clinical trial examples, and how these errors affect interpretation of clinical research results.

Beginner 15 min read

What You'll Learn

  • What Type I and Type II errors mean
  • How alpha and beta relate to hypothesis testing
  • Why statistical power equals \(1-\beta\)
  • How errors appear in clinical trials
  • How sample size affects Type II error
  • How to interpret non-significant results correctly

Introduction

Hypothesis testing is one of the fundamental tools used in clinical biostatistics. Investigators use statistical tests to evaluate whether the observed data provide sufficient evidence against a prespecified null hypothesis.

However, statistical decisions are not infallible. Even when a hypothesis test is performed correctly, the decision can be wrong.

There are two fundamental types of statistical decision errors: Type I error and Type II error.

Key idea: A Type I error occurs when we reject a true null hypothesis. A Type II error occurs when we fail to reject a false null hypothesis.

These concepts are particularly important in clinical trials because both types of error can have practical consequences. A false positive may cause an ineffective treatment to appear beneficial, while a false negative may cause an effective treatment to be overlooked.

The Null and Alternative Hypotheses

Before defining the errors, it is important to understand the two competing hypotheses.

The null hypothesis, denoted \(H_0\), generally represents no treatment effect, no difference, or another reference state.

The alternative hypothesis, denoted \(H_1\) or \(H_A\), represents the effect or difference investigators are attempting to detect.

For example, suppose a randomized clinical trial compares a new treatment with a control treatment using a difference in mean response.

A two-sided hypothesis might be written as:

\[ H_0:\mu_T-\mu_C=0 \] \[ H_A:\mu_T-\mu_C\neq0 \]

The statistical test uses the observed data to decide whether to reject \(H_0\).

1
Specify \(H_0\).
Define the null hypothesis before examining the results.
2
Specify \(H_A\).
Define the alternative hypothesis and the direction of interest when applicable.
3
Choose the significance level.
A common choice is \(\alpha=0.05\).
4
Analyze the data.
Calculate the test statistic and corresponding p-value.
5
Make the statistical decision.
Reject or fail to reject \(H_0\).

What Is a Type I Error?

A Type I error occurs when the null hypothesis is actually true, but the statistical test rejects it.

In simpler language, a Type I error is a false positive.

\[ \text{Type I Error} = P(\text{Reject }H_0\mid H_0\text{ is true}) \]

The probability of making a Type I error is denoted by:

\[ \alpha \]

The significance level \(\alpha\) is therefore the probability of rejecting the null hypothesis when the null hypothesis is actually true.

Example: A False Positive Clinical Trial Result

Suppose a new drug actually has no treatment effect compared with placebo. Thus, the null hypothesis is true.

Nevertheless, because of random variation in the trial data, the analysis produces a p-value below the prespecified significance level.

The investigators reject \(H_0\) and conclude that the treatment differs from placebo.

If there truly is no difference, this conclusion is a Type I error.

Clinical interpretation: A Type I error can lead investigators to conclude that a treatment works when the underlying treatment effect is actually absent.

What Is a Type II Error?

A Type II error occurs when the null hypothesis is false, but the statistical test fails to reject it.

In simpler language, a Type II error is a false negative.

\[ \text{Type II Error} = P(\text{Fail to reject }H_0\mid H_0\text{ is false}) \]

The probability of making a Type II error is denoted by:

\[ \beta \]

Therefore:

\[ \beta=P(\text{Fail to reject }H_0\mid H_0\text{ is false}) \]

Example: A False Negative Clinical Trial Result

Suppose a new treatment truly improves the clinical outcome compared with control.

However, the clinical trial has a small sample size and substantial variability. The observed treatment difference does not produce a sufficiently small p-value.

The investigators fail to reject \(H_0\).

If the treatment really is effective, this is a Type II error.

Clinical interpretation: A Type II error can cause a genuinely effective treatment to appear statistically inconclusive.

Type I vs. Type II Errors

Type I

False Positive

Reject a true null hypothesis.

Type II

False Negative

Fail to reject a false null hypothesis.

Probability

\(\alpha\)

Probability of Type I error.

Probability

\(\beta\)

Probability of Type II error.

Reality Statistical Decision Result
\(H_0\) is true Reject \(H_0\) Type I error
\(H_0\) is true Fail to reject \(H_0\) Correct decision
\(H_0\) is false Reject \(H_0\) Correct decision
\(H_0\) is false Fail to reject \(H_0\) Type II error

The Relationship Between Alpha and Type I Error

The significance level \(\alpha\) is selected before the hypothesis test is performed.

Common values include:

  • \(\alpha=0.05\)
  • \(\alpha=0.01\)
  • \(\alpha=0.10\)

For example, if \(\alpha=0.05\), the statistical procedure is designed to have a 5% Type I error probability under the relevant null-hypothesis conditions.

\[ \alpha=0.05 \]

A smaller alpha makes the criterion for rejecting the null hypothesis more stringent.

For example:

\[ 0.01<0.05 \]

Therefore, a p-value of 0.03 would be statistically significant at the 5% level but not at the 1% level.

Important: A p-value is not the probability that the null hypothesis is true. Rather, the p-value describes how incompatible the observed data are with the null hypothesis under the statistical model used for the test.

The Relationship Between Beta and Statistical Power

Statistical power is directly related to the probability of a Type II error.

\[ \text{Power}=1-\beta \]

Therefore:

\[ \beta=1-\text{Power} \]

For example, if a clinical trial is designed with 80% power:

\[ \text{Power}=0.80 \]

then:

\[ \beta=1-0.80=0.20 \]

Thus, under the assumed effect size, variability, significance level, and other design assumptions, the Type II error probability is 20%.

Key relationship: Higher statistical power means a lower probability of Type II error for the specific alternative effect used in the power calculation.

Why Power Depends on the True Effect Size

One of the most important concepts in power analysis is that power is not usually a single universal number for every possible treatment effect.

Suppose a study is designed to detect a treatment difference of:

\[ \Delta=10 \]

The study may have 80% power to detect that difference.

But if the true difference is only 5 units, the probability of detecting it may be substantially lower.

Conversely, if the true difference is 15 units, the probability of detecting it may be higher.

Thus, power should be interpreted relative to a specified alternative hypothesis or effect size.

Sample Size and Type II Error

Sample size is one of the most important determinants of statistical power.

Holding other assumptions constant, increasing sample size generally reduces the standard error of an estimated treatment effect.

For a simple mean comparison, the standard error is related to sample size approximately through:

\[ SE\propto\frac{1}{\sqrt{n}} \]

As \(n\) increases, the estimate becomes more precise.

Greater precision generally makes it easier to distinguish a genuine treatment effect from random sampling variability.

1
Increase sample size.
More observations generally provide greater information.
2
Reduce the standard error.
The treatment-effect estimate becomes more precise.
3
Increase the ability to detect an effect.
A real effect becomes easier to distinguish from sampling noise.
4
Increase power.
For a specified alternative, the probability of Type II error decreases.

Effect Size and Power

Larger true effects are generally easier to detect than smaller effects, assuming the same sample size, variability, significance level, and analysis method.

For example, imagine two studies with the same number of patients.

True Effect Relative Difficulty of Detection
Very small More difficult
Moderate Intermediate
Large Easier

This is why sample-size calculations should specify a clinically meaningful effect rather than simply asking for a generic amount of statistical power.

Variability and Type II Error

Greater variability makes treatment effects harder to detect.

Suppose two clinical trials have the same treatment effect and the same sample size.

If one trial has much greater outcome variability, its treatment-effect estimate will generally be less precise.

That can reduce statistical power and increase the probability of Type II error.

\[ \text{More variability} \longrightarrow \text{larger standard error} \longrightarrow \text{lower precision} \longrightarrow \text{lower power} \]

Conversely:

\[ \text{Less variability} \longrightarrow \text{smaller standard error} \longrightarrow \text{higher precision} \longrightarrow \text{higher power} \]

What Happens When Alpha Is Changed?

There is an important relationship between the Type I and Type II error probabilities.

If the significance threshold is made more stringent, for example by changing alpha from 0.05 to 0.01, it generally becomes harder to reject the null hypothesis.

This can reduce the Type I error probability, but, holding other factors constant, it can also reduce power and increase Type II error probability for a specified alternative.

Change Typical Consequence
Decrease \(\alpha\) Lower Type I error probability
Decrease \(\alpha\) More stringent evidence required for rejection
Decrease \(\alpha\) Potentially lower power if other factors remain fixed
Increase sample size Generally increases power
Important: Type I and Type II error probabilities are not simply two independent "settings." Changing the rejection threshold can alter the probability of both types of error, depending on the underlying effect and study design.

Clinical Trial Example

Consider a randomized controlled trial evaluating a new treatment for a disease.

The primary endpoint is analyzed using a two-sided test with:

\[ \alpha=0.05 \]

The hypotheses are:

\[ H_0:\Delta=0 \] \[ H_A:\Delta\neq0 \]

Suppose the treatment truly has no effect.

If the study nevertheless produces a statistically significant result and rejects \(H_0\), the study has made a Type I error.

Now consider the opposite situation.

Suppose the treatment truly improves the outcome by a clinically meaningful amount, but the trial fails to achieve statistical significance.

That is a Type II error if the null hypothesis is false and the test fails to reject it.

A Useful Clinical Interpretation

Type I Error

False claim of benefit

The treatment is not truly effective, but the analysis concludes that evidence of a treatment effect exists.

Type II Error

Missed benefit

The treatment truly has an effect, but the study fails to demonstrate sufficient statistical evidence.

Both errors matter in drug development.

A Type I error can contribute to advancing an ineffective treatment based on a false-positive finding. A Type II error can cause a potentially useful treatment to be abandoned because the trial did not provide sufficiently strong statistical evidence.

Type II Error Does Not Mean the Treatment Has No Effect

This is one of the most important interpretation issues in hypothesis testing.

Suppose a study produces:

\[ p=0.12 \]

The result is not statistically significant at the conventional \(\alpha=0.05\) level.

The correct statistical conclusion is generally to fail to reject \(H_0\).

It is not automatically correct to say:

"The treatment has no effect." A non-significant result does not, by itself, prove that the null hypothesis is true.

The observed result may be compatible with no effect, a small effect, or an effect that the study was insufficiently powered to detect.

Confidence Intervals and Type II Error

Confidence intervals can provide important information beyond a binary significance decision.

Suppose a treatment effect estimate is:

\[ \hat{\Delta}=5 \]

with a confidence interval extending from a small negative effect to a moderate positive effect.

The study may fail to reject the null hypothesis, but the confidence interval can reveal the range of effects that remain compatible with the data.

This is particularly useful when evaluating whether a study was sufficiently informative to exclude clinically important effects.

Best practice: When interpreting a non-significant clinical trial result, examine the estimated treatment effect, confidence interval, sample size, variability, and prespecified power assumptions rather than interpreting the p-value alone.

One-Sided vs. Two-Sided Testing

The relationship between Type I and Type II errors also depends on whether the hypothesis test is one-sided or two-sided.

A two-sided test considers deviations in either direction:

\[ H_A:\Delta\neq0 \]

A one-sided test may instead focus on a prespecified direction:

\[ H_A:\Delta>0 \]

The choice should be made based on the scientific question and prespecified analysis plan rather than selected after seeing the data.

Multiple Testing and Type I Error

Clinical trials frequently perform more than one statistical test.

When multiple hypotheses are tested, the probability of obtaining at least one false-positive result can increase if no multiplicity control is applied.

For example, if several independent null hypotheses are each tested at \(\alpha=0.05\), the probability of observing at least one nominally significant result can exceed 5%.

For \(m\) independent tests, a simple illustration is:

\[ P(\text{at least one false positive}) = 1-(1-\alpha)^m \]

This is one reason clinical trial analyses often include multiplicity-control procedures for families of confirmatory hypotheses.

Clinical trial implication: The nominal significance level of an individual test is not always the same as the overall Type I error rate for an entire family of hypotheses.

Multiplicity Can Also Affect Power

Controlling Type I error across multiple hypotheses generally requires more stringent decision criteria for individual tests or other multiplicity adjustments.

More stringent criteria can reduce power for individual hypotheses unless the study design compensates through additional information, such as increased sample size.

Therefore, Type I error control and statistical power should be considered together during clinical trial design.

Type I and Type II Errors in Sample Size Planning

Clinical trial sample size calculations typically incorporate several key inputs.

Input Role
Type I error \(\alpha\) Controls the prespecified false-positive rate
Power \(1-\beta\) Controls the desired probability of detecting the specified effect
Effect size Defines the treatment difference the study is designed to detect
Variability Determines how precisely the treatment effect can be estimated
Sample size Determines how much information is available
Allocation ratio Determines how participants are distributed among treatment groups

A simplified conceptual representation is:

\[ n=f(\alpha,\beta,\Delta,\sigma,\text{design}) \]

where \(\Delta\) represents the effect size and \(\sigma\) represents variability.

A Simple Numerical Example

Suppose a trial is designed with:

  • \(\alpha=0.05\)
  • Power \(=80\%\)
  • Therefore, \(\beta=20\%\)

The relationship is:

\[ \beta=1-0.80=0.20 \]

This does not mean that there is a 20% probability that the specific completed trial has made a Type II error simply because it was designed for 80% power.

Rather, under the assumptions used in the design, the procedure has a 20% Type II error probability for the specified alternative effect.

Important distinction: Power is a property of a statistical design relative to specified assumptions and alternatives. It is not a probability statement that can automatically be assigned to the null or alternative hypothesis after observing the data.

Common Misunderstandings

Misunderstanding 1: A p-value above 0.05 proves the null hypothesis

It does not.

A non-significant result means the data did not provide sufficient evidence to reject the null hypothesis under the prespecified testing procedure.

Misunderstanding 2: A significant result proves the alternative hypothesis

A statistically significant result provides evidence against the null hypothesis under the model and testing framework. It does not establish absolute certainty that the alternative hypothesis is true.

Misunderstanding 3: Type II error is always 20%

No. A study designed for 80% power has \(\beta=20\%\) for the specified alternative used in the calculation, assuming the design assumptions hold. Power varies with the true effect size and other design characteristics.

Misunderstanding 4: Increasing sample size eliminates Type II error

Increasing sample size generally increases power, but it does not guarantee that Type II error becomes impossible.

Misunderstanding 5: Type I and Type II errors are the same as false positive and false negative diagnostic tests

The analogy is useful, but hypothesis-testing errors and diagnostic-test classification errors are not identical concepts. Their mathematical frameworks and interpretation depend on the context.

Type I and Type II Errors: Quick Reference

Concept Meaning
Type I error Rejecting a true null hypothesis
Type II error Failing to reject a false null hypothesis
\(\alpha\) Probability of Type I error under the null hypothesis
\(\beta\) Probability of Type II error for a specified alternative
Power \(1-\beta\)
False positive Common intuitive description of Type I error
False negative Common intuitive description of Type II error
Higher sample size Generally increases power
Larger effect size Generally easier to detect
Greater variability Generally decreases power

How the Concepts Fit Together

1
Reality contains a true state.
The null hypothesis is either true or false.
2
The study produces data.
Sampling variability means the observed result will not always perfectly represent the underlying truth.
3
A statistical test is applied.
The test compares the observed evidence with the null hypothesis.
4
A decision is made.
The investigator either rejects or fails to reject \(H_0\).
5
An error is possible.
If \(H_0\) is true and rejected, the error is Type I. If \(H_0\) is false and not rejected, the error is Type II.

The Most Important Equations

The essential relationships can be summarized by three equations.

\[ \alpha=P(\text{Reject }H_0\mid H_0\text{ is true}) \] \[ \beta=P(\text{Fail to reject }H_0\mid H_0\text{ is false}) \] \[ \text{Power}=1-\beta \]

These equations provide the foundation for understanding statistical decision errors in clinical research.

The key takeaway

Type I error: rejecting a true null hypothesis — a false positive.

Type II error: failing to reject a false null hypothesis — a false negative.

Alpha: controls the Type I error rate under the null hypothesis.

Beta: represents the Type II error probability for a specified alternative.

Power: \(1-\beta\), the probability of detecting the specified effect when it truly exists.

Final Practical Perspective

Type I and Type II errors are not merely theoretical concepts. They influence how clinical trials are designed, how sample sizes are selected, how multiplicity is handled, and how statistical results are interpreted.

A well-designed clinical trial attempts to control the probability of false positive conclusions while maintaining sufficient power to detect effects that are scientifically and clinically meaningful.

The most important habit is to avoid interpreting a statistical decision in isolation. A p-value, confidence interval, effect estimate, sample size, variability, significance level, and prespecified analysis plan all contribute to understanding the evidence.

In clinical research, the goal is therefore not simply to obtain a "significant" result. The goal is to design and analyze the study so that the probability of misleading statistical conclusions is appropriately controlled and the study has a reasonable ability to detect effects that matter.

Clinical Trials

See one-sided testing in real clinical trials

See the method applied to published trial results, with the estimates, confidence intervals and interpretation explained.

ODYSSEY OUTCOMES
Complete statistical analysis of ODYSSEY OUTCOMES, the randomized phase 3 trial of alirocumab versus placebo after acute coronary syndrome, including time-to-event endpoints,…
Phase 3 · n = 18,924
LEADER
Complete statistical analysis of the LEADER phase 3 trial of liraglutide versus placebo in type 2 diabetes, including trial design, cardiovascular time-to-event…
Phase 3 · n = 9,341
ARASENS
Independent statistical analysis of ARASENS, the randomized phase 3 trial of darolutamide plus standard androgen deprivation therapy and docetaxel in metastatic hormone-sensitive…
Phase 3 · n = 1,306
IMvigor130
Independent statistical analysis of IMvigor130, a randomized phase 3 trial of atezolizumab with platinum-based chemotherapy or as monotherapy in untreated locally advanced…
Phase 3 · n = 1,213
GRIPHON
Independent statistical analysis of the GRIPHON phase 3 trial of selexipag in pulmonary arterial hypertension, covering its randomized time-to-event endpoint, secondary analyses,…
Phase 3 · n = 1,156
SWOG S0777
Independent statistical analysis of SWOG S0777 (NCT00644228), a randomized phase 3 trial of lenalidomide and dexamethasone with or without bortezomib in previously…
Phase 3 · n = 525
See all 21 trials using one-sided testing →