Analyze sample data. Test statistic. When the null hypothesis involves a mean or proportion, use either of the following equations to compute the test statistic. ...P-value. The P-value is the probability of observing a sample statistic as extreme as the test statistic, assuming the null hypotheis is true.