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

Frequently Asked Questions

What does a p-value of 0.05 mean?

If the null hypothesis is true, there is a 5% chance of getting a result this extreme or more extreme by random sampling. It does not mean there is a 5% chance the null is true.

Is a smaller p-value always better?

A smaller p-value provides stronger evidence against the null, but statistical significance does not imply practical significance. Always consider effect size alongside the p-value.

What is the difference between one-tailed and two-tailed p-values?

A two-tailed p-value tests for any difference (positive or negative) and is double the one-tailed value. One-tailed tests have more power but assume you know the direction of the effect in advance.

Learn More

Guide

Hypothesis Testing Guide

Learn how hypothesis testing works step by step. Covers null and alternative hypotheses, test statistics, p-values, significance levels, and common pitfalls to avoid.

Ready to run the numbers?

Open P-Value Calculator