Skip to content

Compatibility curves and S-values

A p-value tests one value and an interval reports one level. Read every value at once with a compatibility curve, and turn p into bits of surprise with the S-value.

Advanced ~11 min8 steps

What runs in CodeSplash

You will be able to

  • Read a confidence interval as the values compatible with the data
  • Convert a p-value into an S-value and explain it in coin flips
  • Draw a compatibility curve for a simple estimate

Read first

01

Zero isn't special

Predict

An ordinary p-value tests one value, usually zero. Nothing stops you from testing another.

Predict first

ToothGrowth's difference in means is 3.70, with a standard error of 1.93. Which hypothesized difference fits these data better: 0 or 7?

Zero fits betterSeven fits betterAbout equally
Reveal

About equally, and 7 fits slightly better. Testing 0 gives p = .061. Testing 7 gives t=(3.7−7)/1.93≈−1.71t = (3.7 - 7)/1.93 \approx -1.71 and p≈.093p \approx .093. You probably wouldn't call a difference of 7 "shown". The data have no more quarrel with it than with no difference at all.

02

Intervals are lists of unsurprising values

Read

A confidence intervalConfidence intervalA range of effect values compatible with your data at the chosen confidence level. is the set of values a test wouldn't reject at that level. So you can read a 95% interval as: "these are the differences these data are reasonably compatible with, given the model".

For ToothGrowth that list runs from −0.17 to 7.57. A value barely outside isn't refuted, and a value barely inside isn't proved. Compatibility fades gradually as you move away from the estimate.

03

Draw all the intervals at once

Read

Plot the p-value for every hypothesized difference and you get a compatibility curveCompatibility curveThe p-value for every hypothesized effect size, drawn as a curve that peaks at the estimate.. It peaks at the estimate, and each horizontal slice is one interval: p=.05p = .05 gives the 95% interval, and p=.10p = .10 gives the 90% interval.

CodeSplash reports one level at a time, set by the Confidence level option. This script draws the whole curve.

Python
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt

est, se, df = 3.7, 1.93184, 55.3094
values = np.linspace(-3, 11, 400)
p = 2 * stats.t.sf(np.abs((est - values) / se), df)
plt.plot(values, p)
plt.axhline(0.05, ls=":")
plt.xlabel("Hypothesized difference")
plt.ylabel("p-value")
plt.show()
R
est <- 3.7; se <- 1.93184; df <- 55.3094
values <- seq(-3, 11, length.out = 400)
p <- 2 * pt(abs((est - values) / se), df, lower.tail = FALSE)
plot(values, p, type = "l",
     xlab = "Hypothesized difference", ylab = "p-value")
abline(h = 0.05, lty = 3)
04

See an area become a p-value

Explore

The curve's height at each value is an area like this one. Move the observed statistic and read the p-value that a test of that value would give.

BExplorable · The p-value as an area

What exactly is a p-value a probability of?

Picture the reference curve and where the statistic falls. Will p land below α?

How sure?

Reference distribution

8

Used by the t and χ² references.

1.70

Alternative

0.050

If H₀ were true, a statistic at least as extreme as 1.70 would turn up 8.9% of the time: p = .089.

z = 1.70

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

05

Bits of surprise

Read

The S-valueS-valueA p-value on a scale of coin flips, s = −log₂(p), as surprising as s heads in a row. rescales p into something you can picture:

S=−log⁡2pS = -\log_2 p

It reads as coin flips: SS heads in a row from a coin you were told is fair. For ToothGrowth, testing zero gives S=−log⁡2(0.0606)≈4.0S = -\log_2(0.0606) \approx 4.0, about as surprising as four heads in a row. Worth noticing, and not a reason to accuse the coin.

Unlike p, S-values add up: independent evidence accumulates, and doubling the bits squares the p-value.

06

Check your understanding

Checkpoint

Check yourself

What is the S-value of p=0.05p = 0.05? Give two decimals.

Show the answer

Answer: 4.32

−log⁡2(0.05)≈4.32-\log_2(0.05) \approx 4.32: a bit more than four heads in a row. The conventional threshold is less surprising than it sounds.

Check yourself

A compatibility curve crosses p=.10p = .10 at 2 and 9. What is that?

Show the answer

Answer: b

The slice at p=αp = \alpha is the 1−α1-\alpha interval. It is a statement about the procedure and the data, not a probability about this one interval.

Check yourself

A result has p = .03 against zero, and the estimate is 2 with a 95% interval from 0.2 to 3.8. What is the best description?

Show the answer

Answer: c

Read the range. Nothing here has been proved or ruled out, and values near the edges are only slightly less compatible.

07

Try another level

In the app

Run a t test twice with different values of the Confidence level option and watch the interval change while the estimate stays still. Those two intervals are two slices of the curve above.

08

Recap

Recap
  • An interval is a list of values compatible with the data, and compatibility fades gradually at its edges.
  • A compatibility curve shows every interval at once.
  • S=−log⁡2pS = -\log_2 p turns a p-value into a number of fair coin flips.

Concepts in this lesson