StatisticsHypothesis Tests6 of 8
Hypothesis Tests · 6

Type I and II Errors and Power

When we run a hypothesis test on a random sample, random chance can still lead us to the wrong conclusion, and we want to see how those errors happen and how to control them.

1

The Cutoff Line and Type I Error

A Type I error is a false alarm: rejecting the null hypothesis H0H_0 when H0H_0 is actually true. To see how often that happens, we turn our p-value rule (p-value<α\share{\text{p-value}} < \cutoff{\alpha}) into a cutoff line for the sample mean xˉ\stat{\bar{x}} on the H0H_0 bell curve.

Suppose our standard battery lasts 100 hours\truth{100}\text{ hours} on average with an individual standard deviation of σ=15 hours\spread{\sigma} = \spread{15}\text{ hours}. An engineer claims her new prototype lasts longer (H0:μ=100 hoursH_0: \truth{\mu} = \truth{100}\text{ hours}, Ha:μ>100 hoursH_a: \truth{\mu} > \truth{100}\text{ hours}), and we test a random sample of n=25n = 25 batteries at a significance level of α=0.025\cutoff{\alpha} = \cutoff{0.025}. Where does the cutoff line for xˉ\stat{\bar{x}} sit, and what is the probability of a Type I error?

The Cutoff Line and Type I Error
100 hours100 \text{ hours}
>100 hours ?> 100 \text{ hours}\,?
H0:μ=100H_0 : \htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{100}
Ha:μ>100H_a : \htmlClass{lc-violet}{\mu} > \htmlClass{lc-violet}{100}
nn
=25{} = 25
σ\htmlClass{lc-pink}{\sigma}
=15{} = \htmlClass{lc-pink}{15}
α\htmlClass{lc-orange}{\alpha}
=0.025{} = \htmlClass{lc-orange}{0.025}
Cutoff\htmlClass{lc-orange}{\text{Cutoff}}
=?{} = {?}
P(Type I Error)P(\text{Type I Error})
=?{} = {?}
Text solution
Step size on the H0H_0 curveDivide the individual spread σ=15 hours\spread{\sigma} = \spread{15}\text{ hours} by n\sqrt{n} to find how wide one standard error step is for a batch average of n=25n = 25 batteries.
σn⏟step size\displaystyle \underbrace{\frac{\spread{\sigma}}{\sqrt{n}}}_{\text{step size}} =1525\displaystyle = \frac{\spread{15}}{\sqrt{25}} =155\displaystyle = \frac{\spread{15}}{5} =3 hours\displaystyle = \spread{3}\text{ hours}
Cutoff line for α=0.025\cutoff{\alpha} = \cutoff{0.025}The top 2.5%\cutoff{2.5\%} tail of a normal curve begins 2\steps{2} steps above the center (rounding 1.96\steps{1.96} to 2\steps{2} to keep the arithmetic clean, though a table gives 1.96\steps{1.96}), so we step up 2\steps{2} times from 100 hours\truth{100}\text{ hours}.
Cutoff\displaystyle \cutoff{\text{Cutoff}} =100+2(3)\displaystyle = \truth{100} + \steps{2}(\spread{3}) =100+6\displaystyle = \truth{100} + 6 =106 hours\displaystyle = \cutoff{106}\text{ hours}
Type I error probabilityAny batch averaging more than 106 hours\cutoff{106}\text{ hours} gives p-value<0.025\share{\text{p-value}} < \cutoff{0.025} and makes us reject H0H_0, so when H0H_0 is true, a false alarm happens whenever a normal 100-hour\truth{100}\text{-hour} batch lands in that 2.5%\cutoff{2.5\%} upper tail.
P(Type I Error)\displaystyle P(\text{Type I Error}) =α\displaystyle = \cutoff{\alpha} =0.025\displaystyle = \cutoff{0.025} =2.5%\displaystyle = \cutoff{2.5\%}
2

Type II Error and Statistical Power

If we only cared about avoiding false alarms, we could slide the cutoff line far to the right by picking a tiny α\cutoff{\alpha}. The problem comes when HaH_a is actually true and the new battery really does last longer: a Type II error is failing to reject H0H_0 when HaH_a is true, and its probability is β\err{\beta}; statistical power (1−β1 - \err{\beta}) is the probability that we successfully reject H0H_0 and detect the real improvement.

To measure β\err{\beta} and Power, we draw a second bell curve underneath the first one, centered at a specific true average for the new battery. Keeping our cutoff at 106 hours\cutoff{106}\text{ hours}, suppose the prototype battery truly averages μ=106 hours\truth{\mu} = \truth{106}\text{ hours}. What are the Type II error rate β\err{\beta} and the Power of the test?

Type II Error and Statistical Power
Fail to reject H0\text{Fail to reject } H_0
Reject H0\text{Reject } H_0
H0 is trueH_0 \text{ is true}
(μ=100)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{100})
Type I Error\htmlClass{lc-orange}{\text{Type I Error}}
(α=2.5%)(\htmlClass{lc-orange}{\alpha} = \htmlClass{lc-orange}{2.5\%})
100\htmlClass{lc-violet}{100}
106\htmlClass{lc-orange}{106}
3\htmlClass{lc-pink}{3}
xˉ (hours)\htmlClass{lc-blue}{\bar{x}} \text{ (hours)}
if Ha is true (μ=106):β=?Power=?\text{if } H_a \text{ is true } (\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{106})\text{:}\quad \htmlClass{lc-orange}{\beta} = {?}\quad \htmlClass{lc-green}{\text{Power}} = {?}
Fail to reject H0\text{Fail to reject } H_0
Reject H0\text{Reject } H_0
H0 is trueH_0 \text{ is true}
(μ=100)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{100})
100\htmlClass{lc-violet}{100}
106\htmlClass{lc-orange}{106}
3\htmlClass{lc-pink}{3}
Type I Error\htmlClass{lc-orange}{\text{Type I Error}}
(α=2.5%)(\htmlClass{lc-orange}{\alpha} = \htmlClass{lc-orange}{2.5\%})
Ha is trueH_a \text{ is true}
(μ=106)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{106})
Type II Error\htmlClass{lc-orange}{\text{Type II Error}}
(β=50%)(\htmlClass{lc-orange}{\beta} = \htmlClass{lc-orange}{50\%})
Power\htmlClass{lc-green}{\text{Power}}
(1−β=50%)(1 - \htmlClass{lc-orange}{\beta} = \htmlClass{lc-green}{50\%})
100\htmlClass{lc-mute}{100}
106\htmlClass{lc-violet}{106}
3\htmlClass{lc-pink}{3}
xˉ (hours)\htmlClass{lc-blue}{\bar{x}} \text{ (hours)}
Text solution
Distance from the HaH_a center to the cutoffOn the bottom curve centered at the true average μ=106 hours\truth{\mu} = \truth{106}\text{ hours} with the same 3-hour\spread{3}\text{-hour} step size, count how many steps the 106-hour\cutoff{106}\text{-hour} cutoff sits from the center.
z\displaystyle \steps{z} =106−1063\displaystyle = \frac{\cutoff{106} - \truth{106}}{\spread{3}} =03\displaystyle = \frac{0}{3} =0 steps\displaystyle = \steps{0}\text{ steps}
Type II error (β\err{\beta}) and PowerBecause the cutoff line cuts the HaH_a curve right down the middle, half of the batches land to the left in the "fail to reject H0H_0" zone and half land to the right in the "reject H0H_0" zone.
β⏟Type II error=50%,Power⏟1−β=100%−50%=50%\displaystyle \begin{aligned} \underbrace{\err{\beta}}_{\text{Type II error}} &= \err{50\%}, \\ \underbrace{\power{\text{Power}}}_{1 - \err{\beta}} &= 100\% - \err{50\%} = \power{50\%} \end{aligned}
3

Which Error Could You Have Made?

Once we actually test a sample and reach a decision, we still don't know whether H0H_0 or HaH_a is true in the real world, so we want to know which of the two errors we could be making right now.

Which Error Could You Have Made?
Fail to reject H0\text{Fail to reject } H_0
Reject H0\text{Reject } H_0
xˉ=108\htmlClass{lc-blue}{\bar{x}} = \htmlClass{lc-blue}{108}
H0 is trueH_0 \text{ is true}
(μ=100)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{100})
Type I Error\htmlClass{lc-orange}{\text{Type I Error}}
100\htmlClass{lc-violet}{100}
106\htmlClass{lc-orange}{106}
Ha is trueH_a \text{ is true}
(μ=106)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{106})
Type II Error\htmlClass{lc-orange}{\text{Type II Error}}
Power\htmlClass{lc-green}{\text{Power}}
100\htmlClass{lc-mute}{100}
106\htmlClass{lc-violet}{106}
xˉ (hours)\htmlClass{lc-blue}{\bar{x}} \text{ (hours)}
Reject H0: which error is possible?\text{Reject } H_0\text{: which error is possible?}

Because the cutoff line puts the two error regions on opposite sides, our decision tells us which side of the line our sample landed on and rules out the error on the other side:

xˉ>106(p-value<α)  ⟹  Reject H0  ⟹  only a Type I error is possiblexˉ<106(p-value>α)  ⟹  Fail to reject H0  ⟹  only a Type II error is possible\displaystyle \begin{aligned} &\stat{\bar{x}} > \cutoff{106} \quad (\share{\text{p-value}} < \cutoff{\alpha}) \\ &\implies \text{Reject } H_0 \\ &\implies \text{only a Type I error is possible} \\[0.8em] &\stat{\bar{x}} < \cutoff{106} \quad (\share{\text{p-value}} > \cutoff{\alpha}) \\ &\implies \text{Fail to reject } H_0 \\ &\implies \text{only a Type II error is possible} \end{aligned}
4

Trading Off Errors by Choosing Alpha

Before testing, we have to choose our significance level α\cutoff{\alpha}, such as α=0.01\cutoff{\alpha} = \cutoff{0.01} or α=0.10\cutoff{\alpha} = \cutoff{0.10}. Because a single cutoff line cuts through both curves at once, moving the cutoff to shrink one error automatically makes the other error larger, so we pick α\cutoff{\alpha} by asking which mistake hurts more in the real world.

Trading Off Errors by Choosing Alpha
smaller α or larger α ?\text{smaller } \htmlClass{lc-orange}{\alpha} \text{ or larger } \htmlClass{lc-orange}{\alpha}\,?
H0 is trueH_0 \text{ is true}
(μ=100)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{100})
Type I Error\htmlClass{lc-orange}{\text{Type I Error}}
(α=0.025)(\htmlClass{lc-orange}{\alpha} = \htmlClass{lc-orange}{0.025})
100\htmlClass{lc-violet}{100}
106\htmlClass{lc-orange}{106}
Ha is trueH_a \text{ is true}
(μ=106)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{106})
Type II Error\htmlClass{lc-orange}{\text{Type II Error}}
(β)(\htmlClass{lc-orange}{\beta})
Power\htmlClass{lc-green}{\text{Power}}
100\htmlClass{lc-mute}{100}
106\htmlClass{lc-violet}{106}
xˉ (hours)\htmlClass{lc-blue}{\bar{x}} \text{ (hours)}

Shifting the cutoff line to shrink the Type I error tail (α\cutoff{\alpha}) on the top curve always expands the Type II error area (β\err{\beta}) and lowers Power (1−β1 - \err{\beta}) on the bottom curve, and shifting it the other way increases Power at the cost of more false alarms.

Because one cutoff line goes through both curves, moving it to shrink one error always makes the other error grow.

When a Type I error is the disaster, like spending $500 million\$500\text{ million} to rebuild a factory for a battery that is no better, we choose a smaller α\cutoff{\alpha} (like 0.01\cutoff{0.01}) to push the cutoff right. When a Type II error is the disaster, like certifying an overheating batch of phone batteries as safe, we choose a larger α\cutoff{\alpha} (like 0.10\cutoff{0.10}) to pull the cutoff left and increase Power.

5

How Effect Size Changes Power

Sliding the cutoff line only trades α\cutoff{\alpha} and β\err{\beta} against each other. What happens to Power if we keep α=0.025\cutoff{\alpha} = \cutoff{0.025} fixed at its 106-hour\cutoff{106}\text{-hour} cutoff, and the engineer's new battery actually has a larger true improvement, averaging μ=109 hours\truth{\mu} = \truth{109}\text{ hours} instead of 106 hours\truth{106}\text{ hours}?

How Effect Size Changes Power
μ=109:β=?Power=?\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{109}\text{:}\quad \htmlClass{lc-orange}{\beta} = {?}\quad \htmlClass{lc-green}{\text{Power}} = {?}
H0 is trueH_0 \text{ is true}
(μ=100)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{100})
α=0.025\htmlClass{lc-orange}{\alpha} = \htmlClass{lc-orange}{0.025}
100\htmlClass{lc-violet}{100}
106\htmlClass{lc-orange}{106}
3\htmlClass{lc-pink}{3}
Ha is trueH_a \text{ is true}
(μ=106)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{106})
β=50%\htmlClass{lc-orange}{\beta} = \htmlClass{lc-orange}{50\%}
Power=50%\htmlClass{lc-green}{\text{Power}} = \htmlClass{lc-green}{50\%}
100\htmlClass{lc-mute}{100}
106\htmlClass{lc-violet}{106}
xˉ (hours)\htmlClass{lc-blue}{\bar{x}} \text{ (hours)}
Text solution
Cutoff line from the H0H_0 curveBecause μ=100 hours\truth{\mu} = \truth{100}\text{ hours}, the 3-hour\spread{3}\text{-hour} step size, and α=0.025\cutoff{\alpha} = \cutoff{0.025} on the top curve have not changed, the cutoff stays at 106 hours\cutoff{106}\text{ hours}.
Cutoff\displaystyle \cutoff{\text{Cutoff}} =100+2(3)\displaystyle = \truth{100} + \steps{2}(\spread{3}) =106 hours\displaystyle = \cutoff{106}\text{ hours}
Steps from the new HaH_a center to the cutoffOn the bottom curve centered at μ=109 hours\truth{\mu} = \truth{109}\text{ hours}, find how many 3-hour\spread{3}\text{-hour} steps the 106-hour\cutoff{106}\text{-hour} cutoff sits from the center (here the −- sign means the cutoff sits to the left of the HaH_a center).
z\displaystyle \steps{z} =106−1093\displaystyle = \frac{\cutoff{106} - \truth{109}}{\spread{3}} =−33\displaystyle = \frac{-3}{3} =−1.0 step\displaystyle = \steps{-1.0}\text{ step}
Type II error (β\err{\beta}) and Power on the HaH_a curveOn a normal curve, 16%\err{16\%} of the area lies more than 1\steps{1} step below the center and 84%\power{84\%} lies above it.
β=16%,Power=100%−16%=84%\displaystyle \begin{aligned} \err{\beta} &= \err{16\%}, \\ \power{\text{Power}} &= 100\% - \err{16\%} = \power{84\%} \end{aligned}

Because the cutoff at 106 hours\cutoff{106}\text{ hours} is fixed by the H0H_0 curve and α\cutoff{\alpha}, a larger true average shifts the HaH_a curve further right past that line, moving area from β\err{\beta} into Power:

Because the cutoff line is locked to the top curve and its alpha level, a bigger real improvement slides more of the bottom curve past that fixed cutoff into Power without changing Type I error.
6

Increasing Power with Sample Size and Less Spread

In practice, we cannot change what the new battery's true average actually is, and we usually aren't allowed to raise α\cutoff{\alpha}. If the true average is μ=106 hours\truth{\mu} = \truth{106}\text{ hours} and α\cutoff{\alpha} stays fixed at 0.025\cutoff{0.025}, how can we raise Power above 50%\power{50\%}?

We have to make both bell curves narrower so they overlap less. That means shrinking the step size σn\tfrac{\spread{\sigma}}{\sqrt{n}} from 3 hours\spread{3}\text{ hours} down to 1 hour\spread{1}\text{ hour}, either by testing a larger sample of n=225n = 225 batteries, or by running the test in a climate-controlled lab so the individual battery spread drops from σ=15 hours\spread{\sigma} = \spread{15}\text{ hours} to σ=5 hours\spread{\sigma} = \spread{5}\text{ hours}.

Boosting Power with Sample Size and Noise Reduction
step=σn=1525=3\htmlClass{lc-pink}{\text{step}} = \dfrac{\htmlClass{lc-pink}{\sigma}}{\sqrt{n}} = \dfrac{\htmlClass{lc-pink}{15}}{\sqrt{25}} = \htmlClass{lc-pink}{3}
Power>50% with the same α ?\htmlClass{lc-green}{\text{Power}} > \htmlClass{lc-green}{50\%}\text{ with the same } \htmlClass{lc-orange}{\alpha}\,?
H0 is trueH_0 \text{ is true}
(μ=100)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{100})
α=2.5%\htmlClass{lc-orange}{\alpha} = \htmlClass{lc-orange}{2.5\%}
100\htmlClass{lc-violet}{100}
106\htmlClass{lc-orange}{106}
3\htmlClass{lc-pink}{3}
Ha is trueH_a \text{ is true}
(μ=106)(\htmlClass{lc-violet}{\mu} = \htmlClass{lc-violet}{106})
β=50%\htmlClass{lc-orange}{\beta} = \htmlClass{lc-orange}{50\%}
Power=50%\htmlClass{lc-green}{\text{Power}} = \htmlClass{lc-green}{50\%}
100\htmlClass{lc-mute}{100}
106\htmlClass{lc-violet}{106}
3\htmlClass{lc-pink}{3}
xˉ (hours)\htmlClass{lc-blue}{\bar{x}} \text{ (hours)}
Text solution
New step size σn\tfrac{\spread{\sigma}}{\sqrt{n}}Increasing the sample size to n=225n = 225 (with σ=15\spread{\sigma} = \spread{15}) or reducing the individual spread to σ=5\spread{\sigma} = \spread{5} (with n=25n = 25) shrinks the step size on both curves to 1 hour\spread{1}\text{ hour}.
σn=15225=1515=1 hourorσn=525=55=1 hour\displaystyle \begin{aligned} \frac{\spread{\sigma}}{\sqrt{n}} &= \frac{\spread{15}}{\sqrt{225}} = \frac{\spread{15}}{15} = \spread{1}\text{ hour} \\ &\qquad \text{or} \\ \frac{\spread{\sigma}}{\sqrt{n}} &= \frac{\spread{5}}{\sqrt{25}} = \frac{\spread{5}}{5} = \spread{1}\text{ hour} \end{aligned}
New cutoff line on the narrower H0H_0 curveKeeping α=0.025\cutoff{\alpha} = \cutoff{0.025} still places the cutoff 2\steps{2} steps above 100 hours\truth{100}\text{ hours}, which pulls the cutoff left from 106 hours\cutoff{106}\text{ hours} to 102 hours\cutoff{102}\text{ hours}.
Cutoff\displaystyle \cutoff{\text{Cutoff}} =100+2(1)\displaystyle = \truth{100} + \steps{2}(\spread{1}) =100+2\displaystyle = \truth{100} + 2 =102 hours\displaystyle = \cutoff{102}\text{ hours}
Steps from the HaH_a center to the new cutoffMeasure how many 1-hour\spread{1}\text{-hour} steps the new 102-hour\cutoff{102}\text{-hour} cutoff sits below the HaH_a center at 106 hours\truth{106}\text{ hours}.
z\displaystyle \steps{z} =102−1061\displaystyle = \frac{\cutoff{102} - \truth{106}}{\spread{1}} =−41\displaystyle = \frac{-4}{1} =−4.0 steps\displaystyle = \steps{-4.0}\text{ steps}
Type II error (β\err{\beta}) and PowerOnly 0.003%\err{0.003\%} of a normal curve lies more than 4\steps{4} steps below the center, leaving almost the entire HaH_a curve in the reject zone.
β=0.003%,Power=100%−0.003%=99.997%\displaystyle \begin{aligned} \err{\beta} &= \err{0.003\%}, \\ \power{\text{Power}} &= 100\% - \err{0.003\%} \\ &= \power{99.997\%} \end{aligned}

Narrowing the step size σn\tfrac{\spread{\sigma}}{\sqrt{n}} on both curves pulls the 2.5%\cutoff{2.5\%} cutoff line closer to 100\truth{100}, leaving almost the entire HaH_a curve in the Power region to the right of the line:

With both centers and the false-alarm tail fixed, shrinking the step size pulls the cutoff line left and pushes Power toward 100%.

Key concepts

Instead of memorizing a two-by-two table, we can read every error probability and trade-off directly off the two aligned bell curves.

The Two-Curve Picture of Errors and Power
Fail to reject H0\text{Fail to reject } H_0
Reject H0\text{Reject } H_0
H0 trueH_0 \text{ true}
Ha trueH_a \text{ true}
correct\text{correct}
Type I Error\htmlClass{lc-orange}{\text{Type I Error}}
α\htmlClass{lc-orange}{\alpha}
Type II Error\htmlClass{lc-orange}{\text{Type II Error}}
β\htmlClass{lc-orange}{\beta}
Power\htmlClass{lc-green}{\text{Power}}
1−β1 - \htmlClass{lc-orange}{\beta}
σn\dfrac{\htmlClass{lc-pink}{\sigma}}{\sqrt{n}}
Finding the cutoff, Type II error (β\err{\beta}), and Power

takes two steps across the two curves, both using the step size σn\dfrac{\spread{\sigma}}{\sqrt{n}}:

  • On the H0H_0 curve, step out from the H0H_0 center by the α\cutoff{\alpha} tail distance to place the cutoff line (for μ=100, step size 3, and α=0.025: Cutoff=100+2(3)=106\text{for } \truth{\mu} = \truth{100}\text{, step size } \spread{3}\text{, and } \cutoff{\alpha} = \cutoff{0.025}\text{: }\cutoff{\text{Cutoff}} = \truth{100} + \steps{2}(\spread{3}) = \cutoff{106}).
  • On the HaH_a curve, find how many steps that cutoff sits from the true HaH_a average (z=106−1093=−1.0  ⟹  β=16% to the left, Power=1−β=84% to the right\steps{z} = \dfrac{\cutoff{106} - \truth{109}}{\spread{3}} = \steps{-1.0} \implies \err{\beta} = \err{16\%}\text{ to the left, }\power{\text{Power}} = 1 - \err{\beta} = \power{84\%}\text{ to the right}).
  • When not to recompute the cutoff: If only the true HaH_a average changes (say from 106\truth{106} to 109\truth{109}), do not move the cutoff line. The cutoff depends only on H0H_0, α\cutoff{\alpha}, and the step size σn\dfrac{\spread{\sigma}}{\sqrt{n}}. You only recompute the cutoff when α\cutoff{\alpha}, σ\spread{\sigma}, or nn changes.
Identifying which error is possible

  • Before testing, the chance of a Type I error if H0H_0 is true is α\cutoff{\alpha}, and the chance of a Type II error if HaH_a is true is β\err{\beta}.
  • After testing, look at which side of the cutoff the sample landed on: rejecting H0H_0 (p-value<α\share{\text{p-value}} < \cutoff{\alpha}, like xˉ=108>106\stat{\bar{x}} = \stat{108} > \cutoff{106}) can only be a Type I error; failing to reject H0H_0 (p-value>α\share{\text{p-value}} > \cutoff{\alpha}, like xˉ=103<106\stat{\bar{x}} = \stat{103} < \cutoff{106}) can only be a Type II error.
Controlling the errors

  • Changing α\cutoff{\alpha} slides the cutoff to trade the errors against each other: pick a smaller α\cutoff{\alpha} (0.01\cutoff{0.01}) when a false alarm hurts more, or a larger α\cutoff{\alpha} (0.10\cutoff{0.10}) when missing a real effect hurts more.
  • Shrinking σn\dfrac{\spread{\sigma}}{\sqrt{n}} (larger sample nn or smaller spread σ\spread{\sigma}) narrows both curves and pulls the cutoff toward H0H_0 (step size 3→1 pulls the cutoff 106→102\text{step size } \spread{3} \to \spread{1}\text{ pulls the cutoff } \cutoff{106} \to \cutoff{102}), increasing Power without raising α\cutoff{\alpha}.
7

Practice

1

A solar panel manufacturer’s standard panel produces an average of 200 watts\truth{200}\text{ watts}. An engineer tests a random sample of coated panels to see if the coating increases average output (H0:μ=200 wattsH_0: \truth{\mu} = \truth{200}\text{ watts}, Ha:μ>200 wattsH_a: \truth{\mu} > \truth{200}\text{ watts}) using a significance level of α=0.025\cutoff{\alpha} = \cutoff{0.025}. Before running the test, what is the probability of making a Type I error? Then suppose the sample gives a p-value of 0.06\share{0.06}: state the decision, explain what a Type I and a Type II error mean in this situation, and state which single error the engineer could now be making.

Compare the p-value (0.06\share{0.06}) to α\cutoff{\alpha} (0.025\cutoff{0.025}) to see which side of the cutoff line the sample mean landed on, and check which error is on that side.

Before testing, the probability of a Type I error is α=0.025\cutoff{\alpha} = \cutoff{0.025} (2.5%\cutoff{2.5\%}). Because the p-value (0.06\share{0.06}) is greater than α\cutoff{\alpha} (0.025\cutoff{0.025}), the sample mean landed to the left of the cutoff line and the engineer fails to reject H0H_0. (Watch the decimal place when comparing 0.06\share{0.06} to 0.025\cutoff{0.025}: treating 0.06\share{0.06} as smaller than 0.025\cutoff{0.025} because 6<256 < 25 reverses the decision to "reject H0H_0" and leads to the wrong answer that only a Type I error is possible; also don't report the p-value 0.06\share{0.06} as the pre-test Type I error rate, which is fixed at α=0.025\cutoff{\alpha} = \cutoff{0.025}.) A Type I error would mean concluding the coating increases output when the true average is still 200 watts\truth{200}\text{ watts}; a Type II error means failing to detect that the coating truly increases output above 200 watts\truth{200}\text{ watts}. Since the engineer failed to reject H0H_0, the only error that could have been made is a Type II error.
2

A medical device team inspects batches of pacemakers for a battery-drain defect (H0H_0: the batch is safe, HaH_a: the batch has dangerously fast battery drain). Rejecting H0H_0 holds the shipment at the factory for extra testing; failing to reject H0H_0 sends the pacemakers to hospitals to be implanted in patients. Describe the real-world consequence of a Type I error and a Type II error here, decide whether the team should choose α=0.01\cutoff{\alpha} = \cutoff{0.01} or α=0.10\cutoff{\alpha} = \cutoff{0.10}, and explain how that choice shifts the cutoff line and affects β\err{\beta} and Power.

Write out what happens to patients under each error first, then decide which error tail needs to be smaller.

A Type I error is a false alarm that delays a safe shipment for extra checks, whereas a Type II error certifies a dangerous batch as safe and puts patients at risk. Because a Type II error is far worse, the team should choose the larger significance level, α=0.10\cutoff{\alpha} = \cutoff{0.10}. (Don't automatically pick α=0.01\cutoff{\alpha} = \cutoff{0.01} just because it sounds "stricter" for a medical test: here H0H_0 says the batch is safe, so choosing α=0.01\cutoff{\alpha} = \cutoff{0.01} slides the cutoff right and makes it harder to catch a defective batch, increasing β\err{\beta} and lowering Power.) Choosing α=0.10\cutoff{\alpha} = \cutoff{0.10} instead of 0.01\cutoff{0.01} slides the cutoff line to the left, which shrinks the Type II error rate (β\err{\beta}) and increases Power to catch defective batches, at the acceptable cost of more false alarms.
3

Standard steel cables have a mean breaking strength of 500 kg\truth{500}\text{ kg} with an individual standard deviation of σ=40 kg\spread{\sigma} = \spread{40}\text{ kg}. An engineer tests a random sample of n=16n = 16 heat-treated cables to see if breaking strength has increased (H0:μ=500 kgH_0: \truth{\mu} = \truth{500}\text{ kg}, Ha:μ>500 kgH_a: \truth{\mu} > \truth{500}\text{ kg}) at α=0.025\cutoff{\alpha} = \cutoff{0.025} (putting the cutoff 2\steps{2} steps above the H0H_0 center). If the heat-treated cables actually have a true mean breaking strength of 530 kg\truth{530}\text{ kg}, what are the step size, the cutoff value, the Type II error rate (β\err{\beta}), and the Power of the test?

To find the step size on the sample-mean curve, divide σ\spread{\sigma} by n\sqrt{n}; once you place the cutoff on the 500 kg\truth{500}\text{ kg} curve, measure how many steps that cutoff sits from the 530 kg\truth{530}\text{ kg} center.

The step size is σn=4016=10 kg\tfrac{\spread{\sigma}}{\sqrt{n}} = \tfrac{\spread{40}}{\sqrt{16}} = \spread{10}\text{ kg}. (Be careful not to divide by n=16n = 16 instead of 16=4\sqrt{16} = 4, which gives a wrong step size of 2.5 kg2.5\text{ kg} and a cutoff of 505 kg505\text{ kg}.) On the H0H_0 curve centered at 500 kg\truth{500}\text{ kg}, the α=0.025\cutoff{\alpha} = \cutoff{0.025} cutoff sits 2\steps{2} steps up at 500+2(10)=520 kg\truth{500} + \steps{2}(\spread{10}) = \cutoff{520}\text{ kg}. On the HaH_a curve centered at 530 kg\truth{530}\text{ kg} with a 10 kg\spread{10}\text{ kg} step size, 520 kg\cutoff{520}\text{ kg} is 1\steps{1} full step below the center (z=−1.0\steps{z} = \steps{-1.0}), so the Type II error rate is β=16%\err{\beta} = \err{16\%} and Power is 1−β=84%1 - \err{\beta} = \power{84\%}.
4

A farm’s standard corn plots yield an average of 80 bushels\truth{80}\text{ bushels} per acre with an individual standard deviation of σ=24 bushels\spread{\sigma} = \spread{24}\text{ bushels} due to uneven field watering. An agronomist tests n=16n = 16 plots with a new fertilizer (H0:μ=80 bushelsH_0: \truth{\mu} = \truth{80}\text{ bushels}, Ha:μ>80 bushelsH_a: \truth{\mu} > \truth{80}\text{ bushels}) at α=0.025\cutoff{\alpha} = \cutoff{0.025} (2\steps{2} steps above 80\truth{80}). Suppose the fertilizer truly raises the average yield to 92 bushels\truth{92}\text{ bushels}. Find the original cutoff and Power, and then find the new step size, cutoff, Type II error (β\err{\beta}), and Power if the agronomist runs the 1616-plot test with precision irrigation that lowers σ\spread{\sigma} from 24 bushels\spread{24}\text{ bushels} to 8 bushels\spread{8}\text{ bushels} while keeping α=0.025\cutoff{\alpha} = \cutoff{0.025}.

When σ\spread{\sigma} drops to 8 bushels\spread{8}\text{ bushels}, find where 2\steps{2} steps above 80 bushels\truth{80}\text{ bushels} puts the new cutoff before measuring its distance from 92 bushels\truth{92}\text{ bushels}.

Originally, the step size is 2416=6 bushels\tfrac{\spread{24}}{\sqrt{16}} = \spread{6}\text{ bushels}, putting the cutoff at 80+2(6)=92 bushels\truth{80} + \steps{2}(\spread{6}) = \cutoff{92}\text{ bushels}, right at the center of the HaH_a curve (z=0\steps{z} = \steps{0}), so β=50%\err{\beta} = \err{50\%} and Power=50%\power{\text{Power}} = \power{50\%}. Reducing σ\spread{\sigma} to 8 bushels\spread{8}\text{ bushels} shrinks the step size to 816=2 bushels\tfrac{\spread{8}}{\sqrt{16}} = \spread{2}\text{ bushels} and pulls the α=0.025\cutoff{\alpha} = \cutoff{0.025} cutoff left to 80+2(2)=84 bushels\truth{80} + \steps{2}(\spread{2}) = \cutoff{84}\text{ bushels}. (Don't keep the old cutoff at 92 bushels\cutoff{92}\text{ bushels} just because α=0.025\cutoff{\alpha} = \cutoff{0.025} stayed the same: leaving the cutoff at 92 bushels\cutoff{92}\text{ bushels} keeps z=0z = 0 and gives the wrong answer of 50%50\% Power.) On the HaH_a curve centered at 92 bushels\truth{92}\text{ bushels} with a 2-bushel\spread{2}\text{-bushel} step size, 84 bushels\cutoff{84}\text{ bushels} is 4\steps{4} steps below the center (z=−4.0\steps{z} = \steps{-4.0}), dropping β\err{\beta} to 0.003%\err{0.003\%} and increasing Power to 99.997%\power{99.997\%}.
5

A computer chip has a mean clock speed of 300 MHz\truth{300}\text{ MHz} under H0H_0 with an individual standard deviation of σ=20 MHz\spread{\sigma} = \spread{20}\text{ MHz}. Engineers plan to test H0:μ=300 MHzH_0: \truth{\mu} = \truth{300}\text{ MHz} against Ha:μ>300 MHzH_a: \truth{\mu} > \truth{300}\text{ MHz} at α=0.025\cutoff{\alpha} = \cutoff{0.025} (cutoff 2\steps{2} steps above 300 MHz\truth{300}\text{ MHz}), and they want 84%\power{84\%} Power (β=16%\err{\beta} = \err{16\%}) to detect if the new design’s true mean clock speed is 312 MHz\truth{312}\text{ MHz}. What step size σn\tfrac{\spread{\sigma}}{\sqrt{n}} is required, where will the cutoff line sit, and what sample size nn must they test?

Sketch the cutoff line between 300 MHz\truth{300}\text{ MHz} and 312 MHz\truth{312}\text{ MHz}: how many total steps fit between the two centers if the cutoff sits 2\steps{2} steps above 300 MHz\truth{300}\text{ MHz} and 1\steps{1} step below 312 MHz\truth{312}\text{ MHz}?

For α=0.025\cutoff{\alpha} = \cutoff{0.025}, the cutoff sits 2\steps{2} steps above 300 MHz\truth{300}\text{ MHz}; for 84%\power{84\%} Power (β=16%\err{\beta} = \err{16\%}), the same cutoff must sit 1\steps{1} step below the HaH_a center of 312 MHz\truth{312}\text{ MHz} (z=−1.0\steps{z} = \steps{-1.0}). That means the 12 MHz\spread{12}\text{ MHz} distance between 300 MHz\truth{300}\text{ MHz} and 312 MHz\truth{312}\text{ MHz} is 2+1=3 steps\steps{2} + \steps{1} = \steps{3}\text{ steps} wide, giving a required step size of 123=4 MHz\tfrac{\spread{12}}{\steps{3}} = \spread{4}\text{ MHz} and a cutoff at 300+2(4)=308 MHz\truth{300} + \steps{2}(\spread{4}) = \cutoff{308}\text{ MHz}. (Don't subtract the steps as 2−1=1 step2 - 1 = 1\text{ step} because z=−1.0\steps{z} = \steps{-1.0} is negative, which gives a 12 MHz12\text{ MHz} step size; the two centers sit on opposite sides of the cutoff, so their distances add.) Setting σn=20n=4\tfrac{\spread{\sigma}}{\sqrt{n}} = \tfrac{\spread{20}}{\sqrt{n}} = \spread{4} gives n=5\sqrt{n} = 5, so squaring both sides (don't stop at n=5\sqrt{n} = 5 and report 55 chips) shows they must test n=25 chipsn = 25\text{ chips}.