Learn statistics

What is a p-value? A simple explanation with examples

What a p-value really tells you, how to read it, and what it does not mean.

By the StudyLama network of industry experts. Updated

A p-value tells you how surprising your data is if nothing special is going on. That is the whole idea. The rest of this page makes it concrete. (Hindi mein: p-value kya hota hai? Neeche FAQ mein.)

The idea in one sentence

The p-value is the probability of getting a result at least as extreme as yours, assuming the null hypothesis is true. The null hypothesis is the “nothing special is happening” claim: the coin is fair, the new medicine does nothing, the two classes score the same on average.

A coin example, worked out

You suspect a coin is biased towards heads. You flip it 10 times and get 9 heads.

  • Null hypothesis (H0): the coin is fair, so P(heads) = 0.5.
  • Question: if the coin really is fair, how likely is a result as extreme as 9 heads or more?

With 10 fair flips there are 1,024 equally likely sequences. Exactly 10 heads can happen in 1 way, and exactly 9 heads in 10 ways. So:

P(9 or more heads) = (10 + 1) / 1024 ≈ 0.0107

That is about 1.1%, so the one-sided p-value is roughly 0.011. If a fair coin gave a result this lopsided only about once in 100 tries, you have good reason to doubt the coin is fair. (A two-sided test, which also counts 9 or more tails, doubles this to about 0.021.)

How to read a p-value

p-value What it suggests
Below 0.01 Strong evidence against the null hypothesis
0.01 to 0.05 Evidence against the null hypothesis
Above 0.05 Not enough evidence to reject the null hypothesis

The cut-off you compare against is called the significance level, written α. Most courses use α = 0.05. You decide α before you look at the data.

The steps of a test

  1. State H0 (nothing special) and H1 (what you suspect).
  2. Choose α, usually 0.05.
  3. Collect data and compute the test statistic (a z-score, t-value and so on).
  4. Find the p-value for that statistic.
  5. If p ≤ α, reject H0. If p > α, do not reject H0.

What a p-value is not

  • Not the probability that H0 is true. A p-value of 0.03 does not mean the null has a 3% chance of being true.
  • Not the size of an effect. With a very large sample, a tiny and useless difference can still give a small p-value.
  • Not proof when it is large. p = 0.40 does not prove the null is true. It means the data did not show enough.
  • Not a pass mark. p = 0.049 and p = 0.051 are almost the same evidence, even though they fall on different sides of 0.05.

Where it connects

The p-value sits inside hypothesis testing, together with type 1 and type 2 errors and confidence intervals. A 95% confidence interval and a test at α = 0.05 agree with each other: if the interval for a difference excludes zero, the two-sided p-value is below 0.05.

New to these words? Start with what statistics is and probability, because the p-value is a probability.

To learn hypothesis testing step by step, with an example before every formula, see the Statistics for Data Science course, taught in Hindi.

More from StudyLama

Questions people ask

What is a p-value in simple words?

It is the chance of seeing a result at least as extreme as yours if nothing special is going on (the null hypothesis is true). A small p-value means your result would be surprising under "nothing special".

What does p < 0.05 mean?

If the null hypothesis were true, results this extreme would show up less than 5 times in 100. By convention, that is small enough to reject the null hypothesis. The 0.05 line is a habit, not a law of nature.

Is the p-value the probability that the null hypothesis is true?

No. It is the probability of the data (or more extreme data) assuming the null hypothesis is true. It does not give the probability that the null hypothesis itself is true.

What if the p-value is large?

You fail to reject the null hypothesis. That does not prove the null hypothesis is true. It only means your data did not give strong enough evidence against it.

P-value kya hota hai?

P-value यह बताती है कि अगर कुछ खास नहीं हो रहा (null hypothesis सही है), तो आपके जैसा या उससे भी ज्यादा अजीब नतीजा आने की संभावना कितनी है। संख्या जितनी छोटी, नतीजा उतना ही चौंकाने वाला।