2026-03-09

What is a p-value?

  • Definition: A p-value is a number between 0 and 1 that tells you how likely it is that your result is due to random chance assuming that the null hypothesis is true.
  • If your p-value is <= 0.05, then your findings are considered statistically significant.
  • A null hypothesis is the hypothesis that there is no relationship between the things that are being studied.

The Null Hypothesis:

  • The p-value is used to determine if we can “reject” the null hypothesis.

No difference between groups: \[H_0: \mu = \mu_0\] There is a statistically significant difference between groups: \[H_a: \mu \neq \mu_0\]

P-Value Curve:

Code from previous slide:

ggplot(data.frame(x = c(-5, 5)), aes(x)) +
  stat_function(fun = dnorm) +
  stat_function(fun = dnorm, 
                xlim = c(1.96, 4), 
                geom = "area", fill = "red") +
  theme_minimal() +
  labs(title = "Shaded Area = p-value")

Null vs. Observed Hypothesese:

How Sample Size affects P-Value:

T-Tests:

To determine the p-value, we first convert our data into a test statistic. For a standard t-test, we use the following formula: The T-Statistic Formula\[t = \frac{\bar{x} - \mu_{0}}{s / \sqrt{n}}\]

  • \(\bar{x}\) is the observed sample mean.
  • \(\mu_{0}\) is the mean suggested by the Null Hypothesis.
  • \(s\) is the sample standard deviation.
  • \(n\) is the number of observations (sample size).