P-Value: Gauging Surprise, Not Certainty
A p-value measures surprise: it's the probability of seeing your results by chance, assuming your change had no effect. It's used in A/B testing to decide if an effect is noise or significant. A small p-value doesn't prove your hypothesis is true.
Why it exists
To provide a standardized way to assess whether an observed effect in an experiment is likely due to random chance or a genuine underlying phenomenon. Without a formal method, we're just guessing if a change we made actually had an impact or if the results are a fluke.
The mental model
A p-value is a 'surprise meter.' Imagine you're testing a new button color. The 'null hypothesis' is that the color makes no difference to clicks. The p-value tells you: if that null hypothesis is true, what are the odds you'd see a click difference as big as the one you just measured, just from random luck? A low p-value means 'very surprising,' suggesting the null hypothesis might be wrong.
How it works
In null-hypothesis significance testing, you start by assuming there is no effect. After collecting data, you calculate the p-value. This value is the probability of obtaining test results at least as extreme as the ones you actually observed, under the assumption that the null hypothesis is correct. A very small p-value means that such an extreme outcome would be very unlikely if there were truly no effect.
When to use it
Use p-values in quantitative fields when you need to perform null-hypothesis significance testing. This is common practice in academic publications and A/B testing to determine if an observed result is statistically significant or could be explained by random noise.
When not to use it
Do not use a p-value as the sole indicator of a result's importance. A statistically significant result (low p-value) is not necessarily a practically significant one. With a large enough sample size, you can find a tiny p-value for a trivial, unimportant effect. It also does not tell you the probability of your hypothesis being true.
One canonical example
You run an A/B test on a checkout button, with version A (current) and version B (new design). The null hypothesis is that the new design has no effect on clicks. After the test, version B shows a 2% higher click rate. You calculate a p-value of 0.03. This means that if the button design truly had no effect, there would only be a 3% chance of seeing a click-rate difference of 2% or more, just due to random variation. Because this is unlikely (typically below a 0.05 threshold), you reject the null hypothesis.
Interview question
If an A/B test for a new website feature yields a p-value of 0.02, what is the most accurate interpretation?
- a.There is a 98% probability that the new feature caused the observed difference.
- b.There is a 2% chance of observing results as extreme as these, assuming the new feature has no actual effect.Correct
- c.The probability that the null hypothesis is true is 0.02.
- d.The new feature is guaranteed to be more effective than the old one.
Why? this is the answer
A p-value indicates the probability of seeing your results by chance, assuming the null hypothesis (no effect) is true. It does not state the probability of the null hypothesis being true, nor does it guarantee the alternative hypothesis.
Just read this? Test yourself on what you have been reading.
Read the original → en.wikipedia.org
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on statistics — each one lists the topics its interview covers.
See open roles