Sub topic 4
Reading a p-value and making the decision
This chapter assumes you can state a null and an alternative hypothesis, and that you know what Type I error and the significance level (alpha) mean. It also assumes you have read basic output from a statistics package. Here you will learn what a p-value is, how to turn it into a decision, and which misreadings cause bad Analyze-phase conclusions.
What a p-value measures
A p-value is the probability of seeing data at least as extreme as yours if the null hypothesis were true. Both parts of that sentence matter.
- "At least as extreme" means the test statistic is as far from the null value as yours, or farther. For a two-sided test, extreme counts in both directions.
- "If the null were true" means the calculation starts from the assumption that nothing has changed. The p-value does not tell you whether that assumption is true.
Suppose a project team tests whether a new fixture changed the mean fill weight. The null hypothesis says the mean is unchanged. The test returns p = 0.012. If the fixture truly did nothing, data that different from the old process would turn up about 1.2% of the time through sampling noise alone. That makes "no change" a hard story to believe, but it does not give a probability for the story.
The decision rule
Before you look at the data, choose alpha, the Type I error rate you will accept. In most Six Sigma work it is 0.05. Then apply one rule:
- If p is less than or equal to alpha, reject the null hypothesis. The data are inconsistent enough with "no effect" to act as if there is one.
- If p is greater than alpha, fail to reject the null hypothesis. The data do not give enough evidence against it.
The wording matters. "Fail to reject" is not "accept". A large p-value can mean there is no effect, or it can mean your sample was too small to see one. The sample size chapter returns to this.
Worked example
The code below compares fill weights before and after a change, using a Welch two-sample t-test. The hypotheses are H0: the two means are equal, and Ha: the two means differ. Alpha is fixed in the code before the test runs.
import numpy as np
from scipy import stats
rng = np.random.default_rng(42)
before = rng.normal(loc=50.0, scale=2.0, size=30)
after = rng.normal(loc=51.5, scale=2.0, size=30)
alpha = 0.05 # chosen before looking at the result
result = stats.ttest_ind(before, after, equal_var=False)
print(f"t = {result.statistic:.3f}, p = {result.pvalue:.4f}")
if result.pvalue <= alpha:
print("Reject H0: the means differ at the 5% significance level.")
else:
print("Fail to reject H0: not enough evidence that the means differ.")
print(f"Observed mean difference = {after.mean() - before.mean():.2f}")Run it and read the three outputs together. The t statistic says how many standard errors apart the means are. The p-value says how surprising that gap would be under the null. The observed difference tells you how big the gap is in the units of the process. A decision needs all three.
Why alpha is a long-run rate
Alpha describes how the decision rule behaves across many tests, not any single result. If the null is true and you run the test repeatedly, you will wrongly reject it in about alpha of the runs. This simulation shows it.
import numpy as np
from scipy import stats
rng = np.random.default_rng(1)
alpha = 0.05
p_values = []
for _ in range(5000):
a = rng.normal(50.0, 2.0, 30)
b = rng.normal(50.0, 2.0, 30) # same distribution, so H0 is true
p_values.append(stats.ttest_ind(a, b, equal_var=False).pvalue)
p_values = np.array(p_values)
print("Share of p-values <= alpha:", np.mean(p_values <= alpha))The printed share should be close to 0.05. When the null is true, p-values are spread evenly between 0 and 1, so a p of 0.03 is just as likely as a p of 0.93. A single small p-value is therefore not proof of an effect. It is the kind of result you would see about one time in twenty with no effect at all.
Common misreadings
| Statement | Correct? | Why |
|---|---|---|
| "p = 0.03 means a 3% chance the null is true." | No | The p-value assumes the null is true. It cannot give the probability of that assumption. |
| "p = 0.03 means a 97% chance the effect is real." | No | This is the same error stated the other way round. |
| "p = 0.20 proves there is no difference." | No | It shows only that the data did not contradict the null. A small sample can hide a real difference. |
| "A smaller p means a bigger effect." | No | The p-value also depends on sample size and variation. A tiny effect in a huge sample can give a tiny p. |
| "p <= alpha means we would see this again if we repeated the study." | No | The p-value says nothing directly about replication. |
| "If p <= 0.05 we reject the null, and if the null is true we are wrong about 5% of the time." | Yes | This is the long-run meaning of alpha. |
Edge cases that change the number
One-sided versus two-sided tests
A two-sided test asks whether the mean differs in either direction. A one-sided test asks about one direction only, such as "the new process is slower". For the same data, the one-sided p-value is half the two-sided value when the effect lies in the stated direction. Choose the direction from the project question before you see the data. Switching to one-sided after a two-sided result narrowly misses alpha is a way of cheating the Type I error rate.
A p-value close to alpha
A p of 0.049 and a p of 0.051 are not different in any meaningful way. The cutoff exists so that the team's decision rule has a known error rate, not because evidence changes at 0.05. When p falls close to alpha, report the exact value, look at the effect size and interval, and consider collecting more data if the decision is costly.
Very small p-values
Software often prints p = 0.0000. Report this as p < 0.0001, because a probability is never exactly zero.
Large samples
With thousands of measurements, even a difference of 0.01 units on a process with a standard deviation of 2 can produce a tiny p-value. The test is working correctly. It is answering "is the difference exactly zero?", which is rarely the question the business cares about. The practical significance chapter covers what to do about this.
Reporting a decision to the project team
A defensible statement has four parts:
- The hypotheses in plain language.
- The test used and the alpha chosen in advance.
- The p-value and the observed effect, with units.
- The conclusion in process terms, including what it does not show.
For example: "We tested whether the mean fill weight changed after the fixture upgrade (alpha = 0.05, Welch t-test). The mean rose by 1.4 g and p = 0.008, so we reject the claim of no change. We have not yet shown the 1.4 g shift matters for the specification."
Summary of the rules
- Fix alpha before collecting or viewing data.
- Reject the null when p is less than or equal to alpha, and otherwise fail to reject it.
- Treat p as a measure of how surprising the data are under the null, not as the probability that the null is true.
- Always report the effect size next to the p-value.
- Never read "fail to reject" as proof of no effect.
Exercise
A team compares cycle times on two machines and gets p = 0.31 at alpha = 0.05, with only 8 measurements per machine. A manager says, "The test proves the machines perform the same." What is wrong with that claim, and what would you tell the team?
Show answer
The decision is to fail to reject the null, which is different from showing that the machines are equal. A p-value of 0.31 only says the data are not surprising if the means are equal. With 8 measurements per machine, the test may lack the power to detect a difference that matters. The team should say "no evidence of a difference was found", report the observed difference in seconds, and check the sample size and power before concluding the machines are the same.
Exercise
You run 20 independent tests where the null hypothesis is true in every case, using alpha = 0.05. About how many tests would you expect to reject the null by chance, and what does this say about treating a single p = 0.04 as strong proof?
Show answer
About one test in 20 (5%) is expected to reject by chance. A single p-value just below alpha is the kind of result that appears regularly when there is no effect, so it should be backed by effect size, a sensible mechanism, and ideally confirmation data.