2025-10-19

What is a Null Hypothesis?

To better understand p-values, its important to first understand what a Null Hypothesis is.

Definition

  • The Null Hypothesis, H₀, is the baseline assumption.
  • The Alternative Hypothesis, H₁, is what is trying to be proven.

How its used

  • Statistical tests are done to decide whether to reject the Null Hypothesis.

What is a P-Value?

Definition

  • A p-value is the probability of obtaining results at least as extreme as the observed results of a statistical hypothesis test, assuming that the null hypothesis is true.
  • A p-value is NOT the probability that the null hypothesis is true or false, its a probability about the data.

How to Interpret a P-Value

When testing \(H_0: \mu = \mu_0\) versus \(H_a: \mu \neq \mu_0\):

  • If \(p\text{-value} < \alpha\): Reject \(H_0\)
    • Small p-value provides evidence against the null hypothesis
  • If \(p\text{-value} \geq \alpha\): Fail to reject \(H_0\)
    • Large p-value does not provide sufficient evidence against \(H_0\)

Where:

  • \(\alpha\) is the significance level (typically \(\alpha = 0.05\))

  • \(p\text{-value} = P(\text{observed or more extreme results} \mid H_0 \text{ is true})\)

Demonstration: Problem Description

A research lab has developed a new drug to reduce patient’s blood pressure.

How can the lab test the drugs effectiveness?

Demonstration: Test Setup

Null Hypothesis (\(H_0\)): \(\mu_{\text{drug}} = \mu_{\text{placebo}}\)

The drug has no effect on blood pressure reduction.

Alternative Hypothesis (\(H_a\)):\(\mu_{\text{drug}} > \mu_{\text{placebo}}\)

The drug reduces blood pressure more than placebo.

Where:

  • \(\mu_{\text{drug}}\): Mean reduction for drug group
  • \(\mu_{\text{placebo}}\): Mean reduction for placebo group
  • Significance level: \(\alpha = 0.05\)

Demonstration: Data Generation

library(ggplot2)

# generate blood pressure data for both groups
set.seed(123)
placebo = rnorm(50, mean = 5, sd = 3)  # small natural reduction
drug = rnorm(50, mean = 8, sd = 3)     # larger reduction with drug

bp_data = data.frame(
  reduction = c(placebo, drug),
  group = rep(c("Placebo", "Drug"), each = 50)
)

Demonstration: Plot

It appears that the mean reduction of blood pressure in patients using the drug is higher than those who do not use the drug, but what are the p-values? Is the difference significant enough to truly say the drug is effective?

Demonstration: Boxplot Visualization

This boxplot reaffirms that mean reduction of blood pressure in patients using the drugseems to be higher than those who do not use the drug, but what are the p-values?

Demonstration: P-Value Calculation

To determine if the difference between groups is statistically significant, we perform a one-sided t-test. This test calculates the probability (p-value) of observing our data if the null hypothesis were true.

## t-statistic: 6.072
## p-value: 0.000000012029
## Decision: Reject H₀ - Evidence suggests the drug is effective

As the P-value is exceptionally small, we reject H₀ and determine that the drug is effective.