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 H0 when H0 is actually true. To see how often that happens, we turn our p-value rule (p-value<α) into a cutoff line for the sample mean xˉ on the H0 bell curve.
Suppose our standard battery lasts 100 hours on average with an individual standard deviation of σ=15 hours. An engineer claims her new prototype lasts longer (H0:μ=100 hours,Ha:μ>100 hours), and we test a random sample of n=25 batteries at a significance level of α=0.025. Where does the cutoff line for xˉ sit, and what is the probability of a Type I error?
The Cutoff Line and Type I Error
Text solution
Step size on the H0 curveDivide the individual spread σ=15 hours by n to find how wide one standard error step is for a batch average of n=25 batteries.
step sizenσ=2515=515=3 hours
Cutoff line for α=0.025The top 2.5% tail of a normal curve begins 2 steps above the center (rounding 1.96 to 2 to keep the arithmetic clean, though a table gives 1.96), so we step up 2 times from 100 hours.
Cutoff=100+2(3)=100+6=106 hours
Type I error probabilityAny batch averaging more than 106 hours gives p-value<0.025 and makes us reject H0, so when H0 is true, a false alarm happens whenever a normal 100-hour batch lands in that 2.5% upper tail.
P(Type I Error)=α=0.025=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 α. The problem comes when Ha is actually true and the new battery really does last longer: a Type II error is failing to reject H0 when Ha is true, and its probability is β;statistical power (1−β) is the probability that we successfully reject H0 and detect the real improvement.
To measure β 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, suppose the prototype battery truly averages μ=106 hours. What are the Type II error rate β and the Power of the test?
Type II Error and Statistical Power
Text solution
Distance from the Ha center to the cutoffOn the bottom curve centered at the true average μ=106 hours with the same 3-hour step size, count how many steps the 106-hour cutoff sits from the center.
z=3106−106=30=0 steps
Type II error (β) and PowerBecause the cutoff line cuts the Ha curve right down the middle, half of the batches land to the left in the "fail to reject H0" zone and half land to the right in the "reject H0" zone.
Type II errorβ1−βPower=50%,=100%−50%=50%
3
Which Error Could You Have Made?
Once we actually test a sample and reach a decision, we still don't know whether H0 or Ha 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?
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
4
Trading Off Errors by Choosing Alpha
Before testing, we have to choose our significance level α, such as α=0.01 or α=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 α by asking which mistake hurts more in the real world.
Trading Off Errors by Choosing Alpha
Shifting the cutoff line to shrink the Type I error tail (α) on the top curve always expands the Type II error area (β) and lowers Power (1−β) 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 to rebuild a factory for a battery that is no better, we choose a smaller α (like 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 α (like 0.10) to pull the cutoff left and increase Power.
5
How Effect Size Changes Power
Sliding the cutoff line only trades α and β against each other. What happens to Power if we keep α=0.025 fixed at its 106-hour cutoff, and the engineer's new battery actually has a larger true improvement, averaging μ=109 hours instead of 106 hours?
How Effect Size Changes Power
Text solution
Cutoff line from the H0 curveBecause μ=100 hours, the 3-hour step size, and α=0.025 on the top curve have not changed, the cutoff stays at 106 hours.
Cutoff=100+2(3)=106 hours
Steps from the new Ha center to the cutoffOn the bottom curve centered at μ=109 hours, find how many 3-hour steps the 106-hour cutoff sits from the center (here the − sign means the cutoff sits to the left of the Ha center).
z=3106−109=3−3=−1.0 step
Type II error (β) and Power on the Ha curveOn a normal curve, 16% of the area lies more than 1 step below the center and 84% lies above it.
βPower=16%,=100%−16%=84%
Because the cutoff at 106 hours is fixed by the H0 curve and α, a larger true average shifts the Ha curve further right past that line, moving area from β 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 α. If the true average is μ=106 hours and α stays fixed at 0.025, how can we raise Power above 50%?
We have to make both bell curves narrower so they overlap less. That means shrinking the step size nσ from 3 hours down to 1 hour, either by testing a larger sample of n=225 batteries, or by running the test in a climate-controlled lab so the individual battery spread drops from σ=15 hours to σ=5 hours.
Boosting Power with Sample Size and Noise Reduction
Text solution
New step size nσIncreasing the sample size to n=225 (with σ=15) or reducing the individual spread to σ=5 (with n=25) shrinks the step size on both curves to 1 hour.
New cutoff line on the narrower H0 curveKeeping α=0.025 still places the cutoff 2 steps above 100 hours, which pulls the cutoff left from 106 hours to 102 hours.
Cutoff=100+2(1)=100+2=102 hours
Steps from the Ha center to the new cutoffMeasure how many 1-hour steps the new 102-hour cutoff sits below the Ha center at 106 hours.
z=1102−106=1−4=−4.0 steps
Type II error (β) and PowerOnly 0.003% of a normal curve lies more than 4 steps below the center, leaving almost the entire Ha curve in the reject zone.
βPower=0.003%,=100%−0.003%=99.997%
Narrowing the step size nσ on both curves pulls the 2.5% cutoff line closer to 100, leaving almost the entire Ha 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
Reject H0
H0 true
Ha true
correct
Type I Error
α
Type II Error
β
Power
1−β
nσ
Finding the cutoff, Type II error (β), and Power
takes two steps across the two curves, both using the step size nσ:
On the H0 curve, step out from the H0 center by the α tail distance to place the cutoff line (for μ=100, step size 3, and α=0.025: Cutoff=100+2(3)=106).
On the Ha curve, find how many steps that cutoff sits from the true Ha average (z=3106−109=−1.0⟹β=16% to the left, Power=1−β=84% to the right).
When not to recompute the cutoff: If only the true Ha average changes (say from 106 to 109), do not move the cutoff line. The cutoff depends only on H0,α, and the step size nσ. You only recompute the cutoff when α,σ, or n changes.
Identifying which error is possible
Before testing, the chance of a Type I error if H0 is true is α, and the chance of a Type II error if Ha is true is β.
After testing, look at which side of the cutoff the sample landed on: rejecting H0 (p-value<α, like xˉ=108>106) can only be a Type I error; failing to reject H0 (p-value>α, like xˉ=103<106) can only be a Type II error.
Controlling the errors
Changing α slides the cutoff to trade the errors against each other: pick a smaller α (0.01) when a false alarm hurts more, or a larger α (0.10) when missing a real effect hurts more.
Shrinking nσ (larger sample n or smaller spread σ) narrows both curves and pulls the cutoff toward H0 (step size 3→1 pulls the cutoff 106→102), increasing Power without raising α.
7
Practice
1
A solar panel manufacturer’s standard panel produces an average of 200 watts. An engineer tests a random sample of coated panels to see if the coating increases average output (H0:μ=200 watts,Ha:μ>200 watts) using a significance level of α=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: 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) to α (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 (2.5%). Because the p-value (0.06) is greater than α (0.025), the sample mean landed to the left of the cutoff line and the engineer fails to reject H0.(Watch the decimal place when comparing 0.06 to 0.025: treating 0.06 as smaller than 0.025 because 6<25 reverses the decision to "reject H0" and leads to the wrong answer that only a Type I error is possible; also don't report the p-value 0.06 as the pre-test Type I error rate, which is fixed at α=0.025.) A Type I error would mean concluding the coating increases output when the true average is still 200 watts; a Type II error means failing to detect that the coating truly increases output above 200 watts. Since the engineer failed to reject H0, 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 (H0: the batch is safe, Ha: the batch has dangerously fast battery drain). Rejecting H0 holds the shipment at the factory for extra testing; failing to reject H0 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 or α=0.10, and explain how that choice shifts the cutoff line and affects β 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.(Don't automatically pick α=0.01 just because it sounds "stricter" for a medical test: here H0 says the batch is safe, so choosing α=0.01 slides the cutoff right and makes it harder to catch a defective batch, increasing β and lowering Power.) Choosing α=0.10 instead of 0.01 slides the cutoff line to the left, which shrinks the Type II error rate (β) 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 with an individual standard deviation of σ=40 kg. An engineer tests a random sample of n=16 heat-treated cables to see if breaking strength has increased (H0:μ=500 kg,Ha:μ>500 kg) at α=0.025 (putting the cutoff 2 steps above the H0 center). If the heat-treated cables actually have a true mean breaking strength of 530 kg, what are the step size, the cutoff value, the Type II error rate (β), and the Power of the test?
Be careful not to divide by n=16 instead of 16=4, which gives a wrong step size of 2.5 kg and a cutoff of 505 kg.
To find the step size on the sample-mean curve, divide σ by n; once you place the cutoff on the 500 kg curve, measure how many steps that cutoff sits from the 530 kg center.
The step size is nσ=1640=10 kg.(Be careful not to divide by n=16 instead of 16=4, which gives a wrong step size of 2.5 kg and a cutoff of 505 kg.) On the H0 curve centered at 500 kg, the α=0.025 cutoff sits 2 steps up at 500+2(10)=520 kg. On the Ha curve centered at 530 kg with a 10 kg step size, 520 kg is 1 full step below the center (z=−1.0), so the Type II error rate is β=16% and Power is 1−β=84%.
4
A farm’s standard corn plots yield an average of 80 bushels per acre with an individual standard deviation of σ=24 bushels due to uneven field watering. An agronomist tests n=16 plots with a new fertilizer (H0:μ=80 bushels,Ha:μ>80 bushels) at α=0.025 (2 steps above 80). Suppose the fertilizer truly raises the average yield to 92 bushels. Find the original cutoff and Power, and then find the new step size, cutoff, Type II error (β), and Power if the agronomist runs the 16-plot test with precision irrigation that lowers σ from 24 bushels to 8 bushels while keeping α=0.025.
When σ drops to 8 bushels, find where 2 steps above 80 bushels puts the new cutoff before measuring its distance from 92 bushels.
Originally, the step size is 1624=6 bushels, putting the cutoff at 80+2(6)=92 bushels, right at the center of the Ha curve (z=0), so β=50% and Power=50%. Reducing σ to 8 bushels shrinks the step size to 168=2 bushels and pulls the α=0.025 cutoff left to 80+2(2)=84 bushels.(Don't keep the old cutoff at 92 bushels just because α=0.025 stayed the same: leaving the cutoff at 92 bushels keeps z=0 and gives the wrong answer of 50% Power.) On the Ha curve centered at 92 bushels with a 2-bushel step size, 84 bushels is 4 steps below the center (z=−4.0), dropping β to 0.003% and increasing Power to 99.997%.
5
A computer chip has a mean clock speed of 300 MHz under H0 with an individual standard deviation of σ=20 MHz. Engineers plan to test H0:μ=300 MHz against Ha:μ>300 MHz at α=0.025 (cutoff 2 steps above 300 MHz), and they want 84% Power (β=16%) to detect if the new design’s true mean clock speed is 312 MHz. What step size nσ is required, where will the cutoff line sit, and what sample size n must they test?
Don't subtract the steps as 2−1=1 step because z=−1.0 is negative, which gives a 12 MHz step size; the two centers sit on opposite sides of the cutoff, so their distances add.
Sketch the cutoff line between 300 MHz and 312 MHz: how many total steps fit between the two centers if the cutoff sits 2 steps above 300 MHz and 1 step below 312 MHz?
For α=0.025, the cutoff sits 2 steps above 300 MHz; for 84% Power (β=16%), the same cutoff must sit 1 step below the Ha center of 312 MHz (z=−1.0). That means the 12 MHz distance between 300 MHz and 312 MHz is 2+1=3 steps wide, giving a required step size of 312=4 MHz and a cutoff at 300+2(4)=308 MHz.(Don't subtract the steps as 2−1=1 step because z=−1.0 is negative, which gives a 12 MHz step size; the two centers sit on opposite sides of the cutoff, so their distances add.) Setting nσ=n20=4 gives n=5, so squaring both sides (don't stop at n=5 and report 5 chips) shows they must test n=25 chips.