How do you calculate the p-value in a hypothesis test?

1 Answer
Dec 12, 2017

p-value is the probability of getting as or more extreme sample, as observed, if null hypothesis was true. We test this in the direction of alternative hypothesis.

For example: if we test H0:μ=10 vs Ha:μ>10, and we get test statistic z=1.96, then p-value is the probability of getting this test statistic in the direction of alternative hypothesis, i.e, p-value = P(Z>1.96)=0.025

(probability is obtained from test-statistics distribution, here it came from z-table).