P-Value Examples: Formula, Interpretation and Step-by-Step Solutions

A p-value is the probability of obtaining a result at least as extreme as the one observed, assuming the null hypothesis is true. A small p-value suggests the observed data would be unusual under the null hypothesis. This page provides the formula, worked examples, and an interactive calculator.

10
Worked examples
0.05
Conventional alpha threshold
3
Test directions covered
8
Misconceptions addressed

What Is a P-Value?

Definition

A p-value is the probability of obtaining data at least as extreme as the observed data, under the assumption that the null hypothesis is true.

The p-value answers one specific question: "If the null hypothesis were true, how likely would it be to observe a result this extreme or more extreme by chance?" It is a probability, so it always falls between 0 and 1.

p-value = P(data as extreme or more extreme | H₀ is true)

The p-value does not measure:

  • The probability that the null hypothesis is true.
  • The probability the result will replicate in a future study.
  • The size or practical importance of an effect.
  • The probability that a mistake has been made.
🏛️
Courtroom analogy

Think of the null hypothesis as the assumption of innocence. Evidence is presented. The p-value measures how surprising that evidence would be if the defendant were truly innocent. Very surprising evidence (small p-value) challenges the assumption of innocence, but it does not automatically prove guilt.

First Example: Is a Coin Fair?

Introductory Example — One-Proportion Z-Test

Problem: A researcher flips a coin 100 times and observes 60 heads. Is there evidence the coin is biased at alpha = 0.05? Hypothetical

One-Proportion Z-Test Formula
z = (p̂ − p₀) / √[p₀(1−p₀)/n]
= sample proportion p₀ = null hypothesis proportion n = sample size
1

Hypotheses: H₀: p = 0.50 (fair coin)  |  H₁: p ≠ 0.50 (two-tailed test)

2

Calculate p̂: p̂ = 60/100 = 0.60

3

Standard error under H₀: SE = √[(0.50)(0.50)/100] = √[0.0025] = 0.05

4

Test statistic: z = (0.60 − 0.50) / 0.05 = 2.00

5

P-value (two-tailed): 2 × P(Z > 2.00) = 2 × 0.0228 = 0.0456

6

Decision: p = 0.0456 < α = 0.05. Reject H₀. The critical value is z = ±1.96; our z = 2.00 exceeds it.

Conclusion: At the 5% significance level, there is sufficient evidence the coin is not fair. This is a borderline result; the evidence is statistically significant but not strong.

P-Value Formula Reference

The formula for the test statistic depends on what you are testing. Once you have the test statistic, the p-value is the area in the tail(s) of the null distribution.

One-Proportion Z-Test
z = (p̂ − p₀) / √[p₀(1−p₀)/n]
= x/n (observed proportion) p₀ = null proportion n = sample size

P-value decision rules (always set alpha before collecting data):

P-Value Range Interpretation Typical Decision (α = 0.05)
p < 0.001Very strong evidence against H₀Reject H₀
0.001 ≤ p < 0.01Strong evidence against H₀Reject H₀
0.01 ≤ p < 0.05Moderate evidence against H₀Reject H₀
0.05 ≤ p < 0.10Weak or marginal evidence against H₀Do not reject H₀
p ≥ 0.10Little or no evidence against H₀Do not reject H₀
⚠️
These thresholds are conventions, not mathematical laws

The boundaries above are widely used guidelines. Different fields set different standards. In particle physics, a discovery requires p < 0.0000003 (the "5-sigma" threshold). In some exploratory research, alpha = 0.10 is acceptable.

P-Value Examples: Quick Reference Table

All scenarios below are illustrative and hypothetical. They are presented to show how p-values appear across different research contexts.

Scenario Test n Test Statistic P-Value Decision (α=0.05)
Coin fairness: 60 heads in 100 flips 1-prop z 100 z = 2.00 0.046 Reject H₀
Drug vs placebo recovery time (hypothetical) 2-sample t 100 t = 2.91 0.004 Reject H₀
Teaching method A vs B exam scores Indep. t 60 t = 1.74 0.087 Fail to reject
Manufacturing defect rate exceeds 2% 1-prop z 500 z = 1.92 0.027 Reject H₀
Customer satisfaction survey vs 45% target 1-prop z 400 z = −2.41 0.016 Reject H₀
Website A/B conversion test 2-prop z 2000 z = 1.45 0.147 Fail to reject
Exam scores before/after review session Paired t 30 t = 8.94 <0.001 Reject H₀
Home team wins: 283 of 500 matches 1-prop z 500 z = 2.95 0.003 Reject H₀
Blood pressure: treatment vs control 2-sample t 80 t = 2.18 0.032 Reject H₀
Quality control: 0 defects in 30 items 1-prop z 30 z = −1.26 0.896 Fail to reject

P-Value Illustrator and Calculator

Enter values below for a one-proportion z-test. The calculator shows the p-value, test statistic, and complete step-by-step solution. All calculations run locally in your browser.

One-Proportion Z-Test Calculator

P-Value Visualizer: Normal Curve

Adjust the z-statistic and tail direction to see how the shaded p-value region changes on the standard normal curve.

Sampling Distribution Under H₀

Worked P-Value Examples: Step by Step

Example 2: Medical Treatment vs Placebo

Worked Example 2 — Two-Sample T-Test Hypothetical

Problem: In a hypothetical clinical study, 50 participants receive a new treatment and 50 receive a placebo. Treatment group mean recovery: 8.2 days (SD 2.1). Placebo mean recovery: 9.5 days (SD 2.4). A two-sample t-test produces t = 2.91. Alpha = 0.05.

1

Hypotheses: H₀: μ₁ = μ₂ (no difference)  |  H₁: μ₁ ≠ μ₂ (two-tailed)

2

Test statistic: t = 2.91 (provided from software output). For a two-sample t-test with df ≈ 98, the critical value at alpha = 0.05 is t* = ±1.984.

3

P-value: p = 0.004. See the t-distribution table to verify.

4

Decision: p = 0.004 < alpha = 0.05. Reject H₀.

Conclusion (hypothetical): There is strong statistical evidence that the treatment group had a shorter mean recovery time. Important note: this example uses invented numbers for teaching purposes only.

Example 3: Customer Satisfaction Survey

Worked Example 3 — One-Proportion Z-Test Hypothetical

Problem: A company surveys 400 customers. 156 report being very satisfied. The target satisfaction rate is 45%. Does the observed proportion differ from 45%? Alpha = 0.05.

1

Hypotheses: H₀: p = 0.45  |  H₁: p ≠ 0.45 (two-tailed)

2

Sample proportion: p̂ = 156/400 = 0.39

3

Standard error under H₀: SE = √[(0.45)(0.55)/400] = √[0.000619] ≈ 0.0249

4

Test statistic: z = (0.39 − 0.45) / 0.0249 = −0.06 / 0.0249 ≈ −2.41

5

P-value (two-tailed): 2 × P(Z < −2.41) ≈ 2 × 0.0080 = 0.016

6

Decision: p = 0.016 < alpha = 0.05. Reject H₀.

Conclusion: There is sufficient evidence that the satisfaction proportion (39%) differs significantly from the claimed target of 45%.

Example 4: Exam Scores Before and After a Review Session

Worked Example 4 — Paired T-Test Hypothetical

Problem: 30 students complete a statistics exam before and after a structured review session. Mean score improvement: 6.2 points (SD of differences: 3.8 points). Alpha = 0.05.

1

Hypotheses: H₀: μ₂ = 0 (no improvement)  |  H₁: μ₂ > 0 (one-tailed, right-tailed)

2

Test statistic: t = (6.2 − 0) / (3.8/√30) = 6.2 / 0.694 ≈ 8.94. For the full method, see the paired samples t-test guide.

3

P-value: With df = 29 and t = 8.94, the p-value is far below 0.001.

4

Decision: p < 0.001 < alpha = 0.05. Reject H₀.

Conclusion: There is very strong statistical evidence of score improvement. Note: without a control group, we cannot rule out other explanations for the improvement.

Example 5: Manufacturing Defect Rate

Worked Example 5 — One-Proportion Z-Test (Right-tailed) Hypothetical

Problem: A factory claims a defect rate of at most 2%. An inspector examines 500 products and finds 16 defective. Is the defect rate above 2%? Alpha = 0.05.

1

Hypotheses: H₀: p = 0.02  |  H₁: p > 0.02 (right-tailed, one-tailed)

2

Sample proportion: p̂ = 16/500 = 0.032

3

Standard error under H₀: SE = √[(0.02)(0.98)/500] = √[0.0000392] ≈ 0.00626

4

Test statistic: z = (0.032 − 0.02) / 0.00626 ≈ 1.92

5

P-value (right-tailed): P(Z > 1.92) ≈ 0.027

6

Decision: p = 0.027 < alpha = 0.05. Reject H₀.

Conclusion: There is sufficient evidence the defect rate exceeds 2%. Verify this using the p-value calculator.

Example 6: A/B Test Conversion Rate

Worked Example 6 — Two-Proportion Z-Test Hypothetical

Problem: Version A of a product page: 42 purchases from 1,000 visitors. Version B: 56 purchases from 1,000 visitors. Do conversion rates differ? Alpha = 0.05.

1

Hypotheses: H₀: p₁ = p₂  |  H₁: p₁ ≠ p₂ (two-tailed)

2

Sample proportions: p̂₁ = 42/1000 = 0.042  |  p̂₂ = 56/1000 = 0.056

3

Pooled proportion: p̂ᵣ = (42 + 56) / 2000 = 0.049

4

Standard error: SE = √[0.049 × 0.951 × (1/1000 + 1/1000)] ≈ 0.00965

5

Test statistic: z = (0.056 − 0.042) / 0.00965 ≈ 1.45

6

P-value (two-tailed): ≈ 0.147

Decision: p = 0.147 > alpha = 0.05. Fail to reject H₀. There is insufficient evidence that conversion rates differ. This does not prove the rates are equal; the study may lack the statistical power to detect this difference. See how statistics powers A/B testing.

Example 7: Home Advantage in Sports

Worked Example 7 — One-Proportion Z-Test Hypothetical Data

Problem: Over 500 hypothetical soccer matches, 283 were won by the home team. Is the home win proportion above 50%?

1

Hypotheses: H₀: p = 0.50  |  H₁: p ≠ 0.50 (two-tailed)

2

p̂ = 283/500 = 0.566

3

SE = √[(0.50)(0.50)/500] = √[0.0005] ≈ 0.02236

4

z = (0.566 − 0.50) / 0.02236 ≈ 2.95

5

Two-tailed p-value: 2 × P(Z > 2.95) ≈ 0.003

Conclusion: Strong statistical evidence the home win proportion exceeds 50% in this hypothetical dataset. This is a method demonstration, not a finding about real sports data.

Example 8: Zero Successes (Edge Case)

Worked Example 8 — Edge Case Hypothetical

Problem: 30 items are sampled and 0 defects are found. Test H₀: p = 0.05 (right-tailed). Does zero defects prove the defect rate is negligible?

1

= 0/30 = 0

2

SE = √[(0.05)(0.95)/30] ≈ 0.0398

3

z = (0 − 0.05) / 0.0398 ≈ −1.26

4

Right-tailed p-value: P(Z > −1.26) ≈ 0.896

Decision: Fail to reject H₀. A sample of 30 with zero defects is entirely consistent with a true defect rate of 5%. Zero successes in a sample does not prove the event is impossible in the population. The sample is too small to rule out a 5% defect rate.

Reading a P-Value from a Frequency Table

Sometimes the values x and n must be extracted from a frequency table before applying the formula.

Table: Hypothetical survey responses (n = 200)
ResponseCount
Yes72
No128
Total200

Testing H₀: p = 0.40 vs H₁: p ≠ 0.40 at alpha = 0.05:

Worked Example — From Frequency Table Hypothetical

Extract: x = 72 (Yes responses), n = 200

1

= 72/200 = 0.36

2

SE = √[(0.40)(0.60)/200] ≈ 0.0346

3

z = (0.36 − 0.40) / 0.0346 ≈ −1.16

4

Two-tailed p-value: ≈ 0.246

Fail to reject H₀. There is insufficient evidence the proportion differs from 40%.

P-Value and Significance Level (Alpha)

The significance level alpha is set before conducting the test, based on how much risk of a false rejection you are willing to accept. The p-value is calculated from the data afterward. The comparison between the two determines the decision.

Decision Rule
  • p-value ≤ alpha: Reject H₀. The observed data are unlikely under the null hypothesis.
  • p-value > alpha: Fail to reject H₀. The data are consistent with the null hypothesis.
  • "Fail to reject" is not the same as accepting H₀ as true.

Why Is 0.05 Used as the Standard?

The 0.05 threshold traces back to Ronald Fisher's 1925 book Statistical Methods for Research Workers, where he described it as a rough guide for determining whether a result deserves further investigation. Fisher did not intend it as a universal cutoff. The convention became embedded in scientific practice through decades of widespread use, not because of any mathematical justification.

Different fields apply different standards:

  • Particle physics requires p < 0.0000003 (the "5-sigma" standard) for a major discovery.
  • Medical research often uses alpha = 0.01 for confirmatory trials.
  • Exploratory social science research sometimes uses alpha = 0.10.
  • Genomics applies Bonferroni-corrected thresholds far below 0.05 due to multiple comparisons. See Bonferroni correction.

What Does a P-Value of 0.05 Mean?

A p-value of exactly 0.05 means that, if the null hypothesis were true, there would be a 5% probability of observing data at least as extreme as the data actually collected. At alpha = 0.05, this result sits on the boundary. Convention dictates rejection when p ≤ alpha.

p = 0.05 does NOT mean any of the following

There is a 5% chance the null hypothesis is true. There is a 95% chance the result is correct. The effect is practically important. The result will replicate 95% of the time.

What Does a P-Value of 0.01 Mean?

A p-value of 0.01 means the observed data would occur only 1% of the time if the null hypothesis were true. At alpha = 0.05, this result clears the threshold by a substantial margin, providing strong (though not conclusive) evidence against H₀.

What Does a P-Value of 0.001 Mean?

A p-value of 0.001 means the observed data would occur only 1 time in 1,000 under the null hypothesis. At any conventional alpha level, this leads to rejection of H₀. The evidence against the null hypothesis is very strong, though statistical significance still says nothing about the practical importance of the finding.

Common P-Value Misconceptions

P-values are among the most misinterpreted concepts in applied statistics. The table below compares incorrect and correct interpretations.

What People Often Believe What Is Actually True
A p-value of 0.03 means there is a 3% probability H₀ is true. The p-value is the probability of the data (or more extreme data) given H₀, not the probability H₀ is true.
A small p-value means the result is practically important. Statistical significance and practical significance are separate. A large sample can produce a tiny p-value for a trivially small effect.
Failing to reject H₀ means H₀ is accepted as true. Failing to reject H₀ only means the data provide insufficient evidence against it. H₀ may still be false.
A p-value of 0.04 and a p-value of 0.06 represent meaningfully different amounts of evidence. Both values are close to the conventional threshold. The magnitude of evidence they represent is similar, and both should be interpreted cautiously.
P-values measure the probability that the result will replicate. P-values say nothing about replication probability. Replication depends on sample size, effect size, and research conditions.
Alpha = 0.05 is the scientifically correct threshold. 0.05 is a historical convention from Fisher's 1925 guidelines. The appropriate threshold depends on the field and the consequences of errors.
A large p-value proves the null hypothesis. A large p-value only indicates that the data are consistent with the null hypothesis, not that it is true.
The standard error in the p-value calculation uses the sample proportion (p̂). In a hypothesis test, the standard error uses the null proportion p₀: SE = √[p₀(1−p₀)/n]. The sample proportion is used in confidence intervals.
Wasserstein, R.L. & Lazar, N.A. (2016). The ASA Statement on p-Values: Context, Process, and Purpose. The American Statistician, 70(2), 129–133. Nuzzo, R. (2014). Scientific method: Statistical errors. Nature, 506, 150–152.

Statistical Significance vs Practical Significance

A p-value tells you whether a result is statistically unlikely under the null hypothesis. It tells you nothing about whether that result matters in practice.

Illustrative Contrast Hypothetical

Same effect, very different p-values based on sample size

A

Small study: n = 30, mean difference = 2.0 points, SD = 5. t ≈ 2.19, p ≈ 0.036. Statistically significant.

B

Large study: n = 10,000, mean difference = 0.1 points, SD = 5. t ≈ 2.00, p ≈ 0.046. Also statistically significant, but a 0.1-point difference may be meaningless in practice.

Both reach the p < 0.05 threshold. The p-values are similar, but the practical implications are very different. Always report effect size alongside p-values. See effect size and Cohen's d.

Standard Error and Sample Size

A larger sample produces a smaller standard error, which increases the test statistic for the same observed difference, which reduces the p-value. This is why large studies can yield very small p-values for effects that are trivially small in practice.

Standard error for a one-proportion z-test:

Standard Error Under H₀
SE = √[p₀(1 − p₀) / n]
p₀ = null hypothesis proportion n = sample size Use p₀, not p̂
💡
SE in tests vs confidence intervals

In a hypothesis test, the SE is calculated using the null proportion p₀ because we are computing probabilities under the null hypothesis. In a confidence interval, the SE is calculated using the sample proportion p̂ because no null hypothesis is assumed. See confidence intervals.

Where P-Values Are Used

💊

Clinical Research

Testing whether a drug differs from a placebo in recovery time, blood pressure, or other measurable outcomes.

🏭

Quality Control

Detecting whether defect rates exceed specified tolerance limits in manufacturing processes.

📈

Business Analytics

Evaluating A/B test results for conversion rates, pricing experiments, and user interface changes.

🏫

Education Research

Comparing exam scores, learning outcomes, or attendance rates across teaching approaches.

🔥

Social Science

Testing hypotheses about survey proportions, group differences, and behavioral outcomes.

🔀

Genetics and Biology

Multiple testing frameworks apply corrected alpha thresholds far below 0.05 when testing thousands of hypotheses simultaneously.

Practice Problems

Test your understanding. Click "Show answer" to reveal each solution.

All values are hypothetical. Calculations use the one-proportion z-test formula.

Practice 1

A researcher tests whether a call center answers more than 80% of calls within 60 seconds. In a sample of 200 calls, 168 met the threshold. Test H₀: p = 0.80 against H₁: p > 0.80 at alpha = 0.05. Calculate the test statistic and p-value.

p̂ = 168/200 = 0.84 | SE = √[(0.80)(0.20)/200] = √[0.0008] ≈ 0.02828 | z = (0.84 − 0.80)/0.02828 ≈ 1.41 | Right-tailed p-value: P(Z > 1.41) ≈ 0.079.
Decision: p = 0.079 > 0.05. Fail to reject H₀. There is insufficient evidence the rate exceeds 80%.

Practice 2

520 of 1,000 surveyed people prefer product X over product Y. Test H₀: p = 0.50 against H₁: p ≠ 0.50 at alpha = 0.05. What is the p-value and conclusion?

p̂ = 520/1000 = 0.52 | SE = √[(0.50)(0.50)/1000] = 0.0158 | z = (0.52 − 0.50)/0.0158 ≈ 1.27 | Two-tailed p-value: 2 × P(Z > 1.27) ≈ 0.204.
Decision: p = 0.204 > 0.05. Fail to reject H₀. A 52% preference is not statistically distinguishable from 50% in a sample of this size.

Practice 3

A website claims a 10% click-through rate. You observe 42 clicks from 300 impressions. Test H₀: p = 0.10 against H₁: p ≠ 0.10 at alpha = 0.01.

p̂ = 42/300 = 0.14 | SE = √[(0.10)(0.90)/300] = √[0.0003] ≈ 0.01732 | z = (0.14 − 0.10)/0.01732 ≈ 2.31 | Two-tailed p-value: 2 × P(Z > 2.31) ≈ 0.021.
Decision: p = 0.021 > 0.01 (alpha is 0.01, not 0.05). Fail to reject H₀ at the 1% level, though the result would be significant at alpha = 0.05. This shows how the choice of alpha affects conclusions.

Practice 4 (Exam Style)

A researcher randomly selects 400 people. 156 meet a specified criterion. Previous research suggests the true proportion is 0.35. Test at alpha = 0.01. Show all steps.

x = 156, n = 400, p̂ = 0.39, H₀: p = 0.35, H₁: p ≠ 0.35 | SE = √[(0.35)(0.65)/400] = √[0.000569] ≈ 0.02385 | z = (0.39 − 0.35)/0.02385 ≈ 1.68 | Two-tailed p-value: ≈ 0.093 | Decision at alpha = 0.01: p = 0.093 > 0.01. Fail to reject H₀. At the 1% level, there is insufficient evidence the proportion differs from 0.35. At alpha = 0.10, this same result would lead to rejection, illustrating why the choice of alpha matters.

P-Value Cheat Sheet

ConceptFormula or Rule
P-value definitionP(data as extreme or more | H₀ is true)
One-proportion z-testz = (p̂ − p₀) / √[p₀(1−p₀)/n]
Standard error in testUses p₀, not p̂
Standard error in CIUses p̂, not p₀
Reject H₀ whenp-value ≤ alpha
Two-tailed p-value2 × P(Z > |z|)
Right-tailed p-valueP(Z > z)
Left-tailed p-valueP(Z < z)
Type I error (alpha)Probability of rejecting a true H₀
Type II error (beta)Probability of failing to reject a false H₀
Normal approximation conditionnp₀ ≥ 10 and n(1−p₀) ≥ 10

Frequently Asked Questions

A p-value tells you how surprising your data would be if the null hypothesis were true. A small p-value (below your significance level) indicates the data are unlikely under the null hypothesis, giving you reason to question it.
The significance level (alpha) is set before the test as the threshold for rejection, typically 0.05. The p-value is calculated from the data after collection. If the p-value falls below alpha, you reject the null hypothesis. The p-value is a result; alpha is a decision criterion.
No. A p-value is a probability, so it always falls between 0 and 1 inclusive. A calculated p-value outside this range indicates a computational error.
No. A small p-value provides evidence against the null hypothesis, but it does not prove the alternative is true. The result could be due to a violation of test assumptions, a confounding variable, or random chance in small-probability events.
A two-tailed test checks whether the observed result differs from the null hypothesis in either direction. A one-tailed test checks for a difference in one specific direction only. The two-tailed p-value is twice the one-tailed p-value for symmetric distributions. Choose the tail direction based on your hypothesis before collecting data, not based on which gives a smaller p-value. See one vs two-tailed tests.
For a one-proportion z-test: calculate the sample proportion (p̂ = x/n), compute the standard error using the null proportion (SE = √[p₀(1−p₀)/n]), find the z-statistic ((p̂ − p₀)/SE), and look up the tail probability from a z-table. For a two-tailed test, double the one-tailed probability.
When p = 0.05 exactly and alpha = 0.05, the conventional rule is to reject H₀ (reject when p ≤ alpha). In practice, a result exactly on the boundary should be interpreted cautiously. It is not strong evidence against the null hypothesis.
The significance level alpha is the maximum tolerable probability of a Type I error (rejecting a true null hypothesis). By setting alpha = 0.05, you accept a 5% chance of falsely rejecting H₀ when it is actually true. See Type I and Type II errors.

P-values are one part of hypothesis testing. These pages cover the surrounding concepts: