P-Value Calculator Formula

Understand the math behind the p-value calculator. Each variable explained with a worked example.

Formulas Used

Approx. Two-Tailed P-Value

approx_two_tail = 2 * phi / abs_z

PDF at z

pdf_value = phi

Significant at 0.05?

significant_05 = (abs_z > 1.96) * 1

Significant at 0.01?

significant_01 = (abs_z > 2.576) * 1

Variables

VariableDescriptionDefault
zZ-Statistic (or test statistic)2.1
abs_zDerived value= abs(z)calculated
phiDerived value= (1 / sqrt(2 * pi)) * pow(e, -0.5 * pow(z, 2))calculated

How It Works

How to Interpret P-Values

Concept

The p-value is the probability of observing a test statistic as extreme or more extreme than the computed value, assuming the null hypothesis is true. A small p-value (typically < 0.05) provides evidence against the null hypothesis.

This calculator provides an approximation for the two-tailed p-value using the normal PDF. For exact values, consult a z-table or statistical software.

Worked Example

A z-test yields z = 2.1. Is this significant at the 5% level?

z = 2.1
  1. 01|z| = 2.1
  2. 02PDF at z=2.1: phi(2.1) = 0.04398
  3. 03Approximate two-tailed p ≈ 2 * 0.04398 / 2.1 ≈ 0.0419
  4. 04Since 0.0419 < 0.05, the result is statistically significant at the 5% level
  5. 05Since 0.0419 > 0.01, it is NOT significant at the 1% level

Ready to run the numbers?

Open P-Value Calculator