p-value is a gauge used in statistical hypothesis testing which indicates the probability of getting resulting value atleast as extreme as a given point.
For example, consider an experiment of tossing a coin 20 times. We observe that there were 14 heads, and need to determine if the coin is biased or not.
We calculate p-value statistic of this experiment to know the answer. As we recall p-value is a measure of probbaility
To calcluate the probability of atleast 14 heads , we use cumulative distribution function of binomial distribution.
eg.,run the following command in Matlab: pvalue=1-binomial_cdf(13,20,0.5)
(0.5 is used for equal probability of sucess/failure)
It gives a value of 0.057659. What does it mean? It means that if a coin is unbiased there is a 5.76% chance that the no of heads will be 14 or more.
This p-value is finally used to compare with significance level α (usually 5%) for rejection of null hypotesis