Introduction
A p-value is one of the most misunderstood concepts in statistics…
The Simple Explanation
If we assume the null hypothesis is true, the p-value tells us how likely we are to see results at least as extreme as ours.
Example
Suppose we test whether a coin is fair. We flip it 100 times and get 60 heads. Our p-value answers:
“If the coin were truly fair, how likely is it to get 60 or more heads just by chance?”
The Formula
The test statistic for this example:
$$z = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}$$
In Python
| |