Skip to content

Significance tests

A test fixes a threshold before looking; moving it trades false alarms against misses, and only a bigger effect or more data cuts both.

Helps to know firstConfidence intervals

Helps to know first
This topic

First, the picture

A test sets a threshold on one number before the data arrive. Slide it, and watch two kinds of mistake trade places.

False alarms versus misses

The test statistic with no effect (A) and with an effect (B), and the threshold between "no" and "yes".

Bell A is the statistic when there is no effect; bell B, when there is one. Above the threshold c we say "effect".

threshold c
0.000
false alarms α
0.5000
misses β
0.0013

Predict first. Move the threshold to the right: the false-alarm area falls. What will the miss area do?

0.00 / 12.40 s
Describe this picture

One axis, “test statistic Z”, with two bell curves of the same width: bell A, “A: no effect”, centred on 0, drawn solid, and bell B, “B: effect”, centred on 3, drawn dashed in a second colour. A vertical line, the threshold cc, cuts the axis. The area of bell A to the right of the line is shaded as “false alarms”, and the area of bell B to the left of it as “misses”; readouts give cc and both areas to four decimals. Before the clip a question asks: when the threshold moves right, the false-alarm area falls; will the miss area fall, stay the same, or rise? A tap picks an answer and starts the clip. In the clip the threshold slides from 0 to 4 over 8 seconds, easing in and out, and the two readouts trace one area falling while the other rises; they are equal, 0.0668, at 1.5. Then the threshold returns to 1.645: false alarms 0.0500, misses 0.0877. After the clip a slider, “Threshold c”, moves it from 0 to 4 in steps of 0.005.

Two hypotheses and a threshold

A test starts from a question with two possible answers. The null hypothesis, H0H_0, says nothing is going on: the pill does nothing, the machine is set right, there is no tone in the noise. The alternative, H1H_1, says there is an effect.

From the data I compute one number, the test statistic. Here it is ZZ, and it behaves differently under the two answers. If H0H_0 is true, ZZ follows bell A, the standard bell N(0,1)\mathcal{N}(0,1). If H1H_1 is true, it follows bell B, the same bell shifted to 3. I call that shift δ\delta; here δ=3\delta=3.

Before looking at the data I fix a threshold cc. If ZZ lands above it I reject H0H_0, deciding there is an effect; otherwise I do not. The values above cc are the rejection region. This test is one-sided: only large values of ZZ count against H0H_0.

Two mistakes are possible:

TruthDecision: rejectDecision: do not reject
No effectfalse alarm, chance α\alphacorrect
Effectcorrectmiss, chance β\beta

The two shaded areas in the picture are those chances:

α=Pr⁡{Z>c∣H0}=1−Φ(c),β=Pr⁡{Z≤c∣H1}=Φ(c−δ),\begin{aligned} \alpha&=\Pr\{Z>c\mid H_0\}=1-\Phi(c),\\ \beta&=\Pr\{Z\le c\mid H_1\}=\Phi(c-\delta), \end{aligned}

with Φ\Phi the distribution function of the standard bell, as in The normal distribution. The false-alarm chance α\alpha is the test’s significance level. Here α\alpha and β\beta are this page’s two error chances; signal processing pages use the same letters for other things.

Moving the threshold

Before the clip you guessed. As the threshold moves right, false alarms fall and misses rise. The two areas trade places: any threshold that cuts one makes the other larger.

ThresholdFalse alarmsMisses
10.15870.0228
1.50.06680.0668
1.6450.05000.0877
20.02280.1587
2.3260.01000.2502
30.001350.5000

Halfway between the bells, at 1.5, the two errors are equal. The usual choice is to fix the false alarms first, at 5 %, with the threshold z0.95=1.645z_{0.95}=1.645: the point of the standard bell with 0.95 of the area below it. With the bells 3 apart, that leaves misses at 0.08770.0877.

Power, and what raises it

The chance of catching a real effect, 1−β1-\beta, is the test’s power. At the 5 % threshold with δ=3\delta=3 it is 0.91230.9123.

Moving the threshold cannot raise power without raising false alarms. Only pulling the bells further apart helps both. How far apart they sit depends on the data.

Say I test whether a mean exceeds a value μ0\mu_0, with known spread σX\sigma_X and nn draws. The statistic is the sample mean in units of its standard error, from Confidence intervals:

Z=Xˉn−μ0σX/n.Z=\frac{\bar X_n-\mu_0}{\sigma_X/\sqrt n}.

If the true mean is μ0+Δ\mu_0+\Delta, bell B sits at δ=Δn/σX\delta=\Delta\sqrt n/\sigma_X. A bigger effect Δ\Delta pulls it out; so does more data, but only as n\sqrt n.

More data pulls the bells apart

An effect of half a standard deviation, tested at 5 % false alarms with n draws.

n = 4: bell B sits at 1, and the power is 0.2595. An effect of half a standard deviation is easy to miss with four draws.

draws n
4
separation
1
power
0.2595
misses β
0.7405
0.00 / 11.00 s
Describe this picture

The same two bells, with the threshold fixed at 1.645 (5 % false alarms), for an effect of half a standard deviation: bell B sits at 0.5n0.5\sqrt n. Readouts give nn, the separation, the power and the misses. In the clip nn steps through 4, 16, 25, 36 and 64, holding at each; bell B moves out from 1 to 4 and the miss area shrinks: the power goes 0.2595, 0.6388, 0.8038, 0.9123, 0.9907. After the clip a slider, “Draws n”, sets nn to one of those five values.

Four times the data doubles the separation. For an effect of half a standard deviation at the 5 % level:

DrawsSeparationPower
410.2595
1620.6388
252.50.8038
3630.9123
6440.9907

To reach a chosen power, solve for nn. With z1−αz_{1-\alpha} and z1−βz_{1-\beta} the matching points of the standard bell,

n=((z1−α+z1−β) σXΔ)2.n=\left(\frac{(z_{1-\alpha}+z_{1-\beta})\,\sigma_X}{\Delta}\right)^2.

For power 0.80 at 5 %, z0.95=1.6449z_{0.95}=1.6449 and z0.80=0.8416z_{0.80}=0.8416. An effect of half a standard deviation needs ((1.6449+0.8416)/0.5)2=24.73\big((1.6449+0.8416)/0.5\big)^2=24.73, so 25 draws; an effect of 0.2 standard deviations needs 154.6, so 155.

Watch out

“Not rejected” does not mean “shown true”. If the bells overlap heavily, a real effect is missed most of the time, and not rejecting H0H_0 shows only that this test could not tell. And α\alpha is not the chance that H0H_0 is true: it is the chance of a false alarm when H0H_0 is true.

Worked example

1. A bottling line. The label says 500 g. The filling machine’s spread is known, σX=4\sigma_X=4 g. Each hour, 16 bottles are weighed, so the standard error is 4/16=14/\sqrt{16}=1 g. The machine is flagged if the mean is too low, with 5 % false alarms: when xˉ<500−1.645=498.355\bar x<500-1.645=498.355 g.

If the machine has drifted to 498 g, two standard errors low, the flag fires with chance Φ(0.35515)=0.6388\Phi(0.35515)=0.6388. At 499 g it fires with chance 0.25950.2595. To catch 498 g with power 0.80 takes 25 bottles: the standard error falls to 0.8 and the power to 0.80380.8038.

An hour’s 16 bottles average 497.6 g. That is below the line, so the machine is flagged.

2. Finding a tone. A sine of amplitude 0.5 that completes whole cycles in 72 samples is buried in noise of variance 1. Its energy is 72×0.25/2=972\times0.25/2=9. A matched filter that knows the tone’s frequency and phase turns the record into a statistic that follows bell A with noise alone and bell B, shifted by 9=3\sqrt9=3, with the tone: the bells of the picture.

A threshold of 1.645 raises a false alarm on 5 % of noise-only records and finds the tone 91.2 % of the time. A threshold of 3 cuts false alarms to 1 record in 741 and finds the tone only half the time. With an unknown phase the bells change shape; the matched-filter page deals with that case.

Try it yourself. With the bells 3 apart, the false-alarm chance at threshold 2 is 0.02280.0228. Doubling nn moves bell B to 32=4.2433\sqrt2=4.243, and the power at 5 % rises to 0.99530.9953. Raising the threshold lowers the power.

Where you’ll meet this

Clinical trials. A trial is sized before it starts: the false-alarm level is fixed, usually at 5 %, and the number of patients is chosen for a power of 80 or 90 % to detect the smallest effect that would matter.

Quality control. Production lines are checked by samples against limits, as with the bottles. The limits are set for a tolerable rate of false stops.

Detectors. Radar, sonar and smoke alarms decide “target” or “no target” by a threshold set for a false-alarm rate, then live with the misses that follow.

Experiments online. A/B tests compare two versions of a page; running one without enough visitors gives a test with little power, whose “no difference” means very little.

In signal processing · detection is a test

A radar decides whether a target is present by comparing a matched-filter output with a threshold set for the false-alarm rate: this page’s test, with noise as bell A. Matched filters and detection and Radar signal processing in the signal processing course work it through.

The next page, p-values, reports how far into bell A’s tail the observed statistic fell, instead of only “above or below the line”.

Reference card

QuantityFormulaNotes
HypothesesH0H_0 no effect; H1H_1 an effectchosen before the data
False alarmα=Pr⁡{Z>c∣H0}=1−Φ(c)\alpha=\Pr\{Z>c\mid H_0\}=1-\Phi(c)the significance level
Missβ=Pr⁡{Z≤c∣H1}=Φ(c−δ)\beta=\Pr\{Z\le c\mid H_1\}=\Phi(c-\delta)
Power1−β1-\betachance of catching the effect
5 % one-sided thresholdc=z0.95=1.645c=z_{0.95}=1.645
Statistic for a meanZ=(Xˉn−μ0)/(σX/n)Z=(\bar X_n-\mu_0)/(\sigma_X/\sqrt n)shift δ=Δn/σX\delta=\Delta\sqrt n/\sigma_X
Sample sizen=((z1−α+z1−β) σX/Δ)2n=\big((z_{1-\alpha}+z_{1-\beta})\,\sigma_X/\Delta\big)^225 for half a SD, power 0.8
Not rejectednot shown truethe test may lack power

Keep reading with a free account.

By creating an account you accept the terms of use.

Sign in

Already have an account? Use the service you signed up with.

Or keep reading: get new lessons by email

Are you 13 or over?

Accounts and email updates are for people aged 13 or over. We keep only your answer, never your date of birth.

End of the lesson

Where to go next.

Phasorium

Account

Sign inKeep your place on any device

Subjects

Site

Look