P-VALUE CALCULATOR

P-value calculator

Enter a z or t statistic, get the p-value.

What is a p-value?

The probability of getting a result at least as extreme as yours if the null hypothesis were true. A small p-value means your result would be unusual under the null hypothesis. OpenStax (Introductory Statistics 2e, section 9.4) defines it as the probability, assuming the null hypothesis is true, that a sample would be as extreme or more extreme than the one you got.

How do I get a p-value from a z-score?

For a two-tailed test, p = 2 × (1 − Φ(|z|)). z = 1.96 gives p = 0.050; z = 2.576 gives p = 0.010. For a one-tailed test the p-value is the area in just one tail: the left tail for a “less than” claim, the right tail for a “greater than” claim.

And from a t-statistic?

The same idea with the t-distribution and its degrees of freedom: t = 2.228 with 10 degrees of freedom gives a two-tailed p of 0.050. The degrees of freedom come from the test that produced the t, for example n − 1 for a one-sample test and n − 2 for a correlation, so look them up there.

How do I use the p-value to decide?

Choose α before you look at the data, usually 0.05 or 0.01. If the p-value is below α, reject the null hypothesis; if it is α or above, do not reject it (OpenStax, section 9.4). Failing to reject is not proof that the null hypothesis is true; it only means the sample did not give enough evidence against it. The rule is identical to comparing your statistic with a critical value.

Worked example: t = −3.036 with 7 degrees of freedom

OpenStax Example 10.11 tests whether pain scores fall after hypnotism in 8 subjects and finds t = −3.036, with n − 1 = 7 degrees of freedom. Because the claim is that pain is lower, the p-value is the left-tail area: 0.0095. That is below α = 0.05, so the null hypothesis is rejected. A two-tailed test would give twice that, 0.0190, still significant, and its critical value is ±2.365, which |t| exceeds. The right tail would give 0.9905, which shows why you must pick the direction that matches your claim. For a z-statistic, −2.08 in a left-tailed test gives p = 0.0188.

One-tailed or two-tailed?

Two-tailed if you are testing for a difference in either direction; one-tailed only if you decided in advance that only one direction matters. The one-tailed p is half the two-tailed one, provided the statistic falls in the direction you predicted.

Is p < 0.05 proof?

No. 0.05 is a common convention, not a law. A p-value does not measure the size or importance of an effect — report the effect size and a confidence interval too. The American Statistical Association’s 2016 statement on p-values makes the same points: a p-value is not the probability that the hypothesis is true or that the data arose by chance alone, conclusions should not rest on whether a p-value crosses a threshold, and p-values say nothing about the size of an effect.

Common mistakes when reading p-values

First, taking p = 0.03 to mean a 3% chance that the null hypothesis is true; it is a statement about the data, given the null hypothesis. Second, reading p > 0.05 as “no effect”, when a small sample may simply lack the power to show one. Third, choosing the tail after seeing which way the data point. Fourth, running many tests and reporting only the significant ones: at α = 0.05, about one test in twenty will pass by chance even when nothing is going on. Fifth, entering the wrong degrees of freedom, which changes the p-value noticeably for small samples. Sixth, reporting “p = 0” when the value is just very small; write p < 0.0001 instead.

Sources: OpenStax, Introductory Statistics 2e, sections 9.2 (outcomes and Type I and II errors), 9.4 (rare events, the sample, decision and conclusion) and 10.4 (Example 10.11); Wasserstein, R. L. and Lazar, N. A. (2016), “The ASA statement on p-values: context, process, and purpose”, The American Statistician 70(2). Related: critical value calculator, z-score calculator, t-test calculator, chi-square calculator and confidence interval calculator.