Hypothesis Testing: Is Your Data Signal or Noise?
Hypothesis testing is a courtroom trial for your data: you assume a default 'null hypothesis' is true until your data provides enough evidence to reject it. It's used in A/B tests to validate changes.
The mental model
Statistical hypothesis testing is like a courtroom trial for your data. You begin by assuming a default state of 'innocence,' called the null hypothesis (H0), which typically represents 'no effect' or 'no difference.' Your data acts as the evidence. The goal is to see if this evidence is strong enough to 'convict' and reject the null hypothesis in favor of an alternative hypothesis (H1).
How it works
The process involves a few key steps. First, you state your null (e.g., 'the new button does not increase clicks') and alternative hypotheses. Second, you collect data from an experiment, like an A/B test. Third, you calculate a 'test statistic' (like a t-score or z-score) that summarizes how much your data deviates from the world described by the null hypothesis. Fourth, you compute a p-value from this statistic. The p-value is the probability of observing data at least as extreme as yours, assuming the null hypothesis is true. Finally, you compare your p-value to a pre-set significance level (alpha, often 0.05). If p < alpha, you reject the null hypothesis and declare the result 'statistically significant.'
When to use it
Use hypothesis testing when you need to make a decision based on sample data and want to quantify your confidence. Three common places this appears: first, in A/B testing to decide if a new feature improves a key metric; second, in manufacturing to verify if a process change reduced defects; third, in clinical trials to determine if a new drug is more effective than a placebo.
When not to use it
Avoid hypothesis testing for open-ended data exploration. Running many tests on the same dataset until you find a low p-value is an invalid practice called 'p-hacking' or 'data dredging.' Also, remember that statistical significance is not the same as practical significance. With a large enough sample, a tiny, meaningless effect (e.g., a 0.01% conversion lift) can become statistically significant, but it may not be worth implementing in the real world.
One canonical example
A website tests a new headline. The null hypothesis is that the new headline has no effect on user engagement time. After running the test, they calculate a p-value of 0.02. Since this is less than their chosen alpha of 0.05, they reject the null hypothesis. They conclude there is a statistically significant difference in engagement time and can confidently roll out the new headline.
Interview question
In hypothesis testing, if your p-value is 0.02 and your significance level (alpha) is 0.05, what does this imply?
- a.There is a 2% chance of observing data as extreme as yours, assuming the null hypothesis is true.Correct
- b.The probability that the null hypothesis is true is 2%.
- c.The observed effect is practically important and should be implemented.
- d.The alternative hypothesis is 98% likely to be correct.
Why? this is the answer
The card defines the p-value as "the probability of observing data at least as extreme as yours, assuming the null hypothesis is true." Since p (0.02) is less than alpha (0.05), you would reject the null hypothesis, indicating statistical significance. Option B and C misinterpret the p-value as the probability of the null or alternative hypothesis being true, which it is not. Option C confuses statistical significance with practical significance, a distinction the card explicitly highlights.
Just read this? Test yourself on what you have been reading.
Read the original → en.wikipedia.org
- #statistics
- #a/b testing
- #data analysis
- #metrics
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