2026-04-13

What is a P-value?

A p-value is the probability of observing a test statistic as extreme or more extreme than the one computed from your sample, assuming the null hypothesis is true.

  • A small p-value → evidence against \(H_0\)
  • A large p-value → no strong evidence against \(H_0\)

The p-value does NOT measure the probability that \(H_0\) is true.

Hypothesis Testing Framework

Every p-value comes from a hypothesis test:

\[H_0: \mu = \mu_0 \quad \text{(null hypothesis)}\] \[H_a: \mu \neq \mu_0 \quad \text{(alternative hypothesis)}\]

The test statistic for a one-sample t-test is:

\[t = \frac{\bar{X} - \mu_0}{s / \sqrt{n}}\]

Where \(\bar{X}\) is the sample mean, \(s\) is the sample standard deviation, and \(n\) is the sample size.

Significance Level

We compare the p-value to a pre-chosen significance level \(\alpha\):

\[\text{If } p < \alpha \Rightarrow \text{Reject } H_0\] \[\text{If } p \geq \alpha \Rightarrow \text{Fail to reject } H_0\]

Common choices:

  • \(\alpha = 0.05\) (most common)
  • \(\alpha = 0.01\) (stricter)
  • \(\alpha = 0.10\) (more lenient)

Visualizing the P-value

Rejection Regions at Alpha = 0.05

Example: Are Sleep Hours Different from 8?

set.seed(42)

sleep_hours <- c(6.5, 7.2, 5.8, 7.8, 6.1, 7.5, 6.9, 8.2,
                 5.5, 7.0, 6.3, 7.1, 6.8, 7.4, 6.0, 7.3,
                 5.9, 6.7, 7.6, 6.4, 7.9, 6.2, 7.0, 6.5,
                 7.1, 5.7, 6.8, 7.3, 6.6, 7.2)

result <- t.test(sleep_hours, mu = 8)
result
## 
##  One Sample t-test
## 
## data:  sleep_hours
## t = -9.5224, df = 29, p-value = 1.98e-10
## alternative hypothesis: true mean is not equal to 8
## 95 percent confidence interval:
##  6.55441 7.06559
## sample estimates:
## mean of x 
##      6.81

Interpreting the Result

From the t-test:

  • Sample mean: \(\bar{X} =\) 6.81 hours
  • Test statistic: \(t =\) -9.522
  • P-value: \(p =\) 1.98e-10

Since \(p < 0.05\), we reject \(H_0\).

There is statistically significant evidence that students sleep fewer than 8 hours on average.

Interactive P-value Explorer

Common Misconceptions

Misconception Truth
P-value = P(H0 is true) It assumes H0 is true
p < 0.05 means a big effect It only means statistical significance
p > 0.05 proves H0 It means insufficient evidence to reject
Lower p = more important result Effect size matters too

Statistical significance does not equal practical significance.

Summary

  • The p-value measures evidence against \(H_0\), not the probability \(H_0\) is true
  • We compare p-value to \(\alpha\) to make a decision
  • For our sleep example: \(p \ll 0.05\) → students sleep significantly less than 8 hours
  • Always consider effect size alongside the p-value

\[\text{Small p-value} \Rightarrow \text{Surprising data under } H_0 \Rightarrow \text{Reject } H_0\]