P-value hypothesis testing

Course Name: Stats Primer, Section No: 2, Unit No: 33, Unit type: Document

How to calculate p-value?

Hi Anshul,

Here's an explanation for building the p-value (reference):



The p-value for:

  • a lower-tailed test is specified by: p-value = P(TS  ts | H0 is true) = CDF(ts).
  • an upper-tailed test is specified by: p-value = P(TS  ts | H0 is true) = 1 - CDF(ts).
  • assuming that the distribution of the test statistic under H0 is symmetric about 0, a two-sided test is specified by: p-value = 2 * P(TS  |ts| | H0 is true) = 2 * (1 - CDF(|ts|)).



    Where:

    P: Probability of an event

    TS: Test statistic

    ts: the observed value of the test statistic calculated from your sample

    CDF(): Cumulative distribution function of the distribution of the test statistic (TS) under the null hypothesis.





    I hope this helps.