This presentation explores hypothesis testing through the lens of a medical trial. We’ll use statistical tools to test if a new drug significantly reduces blood pressure compared to a placebo.
This presentation explores hypothesis testing through the lens of a medical trial. We’ll use statistical tools to test if a new drug significantly reduces blood pressure compared to a placebo.
In statistics, hypothesis testing is a method for evaluating a claim about a population using sample data.
We begin with two opposing hypotheses:
\[ H_0: \mu = \mu_0 \quad \text{(no effect)} \\\\ H_A: \mu \ne \mu_0 \quad \text{(drug has an effect)} \]
We define:
\[ \text{p-value} = P(\text{data} \mid H_0 \text{ is true}) \]
set.seed(301)
control <- rnorm(50, mean = 130, sd = 10)
treatment <- rnorm(50, mean = 122, sd = 10)
data <- data.frame(
group = rep(c("Placebo", "NewDrug"), each = 50),
bp = c(control, treatment)
)
| group | bp |
|---|---|
| Placebo | 132.4586 |
| Placebo | 101.4281 |
| Placebo | 132.9014 |
| Placebo | 134.2551 |
We bootstrap mean differences between groups and show them as a 3D plot.
Hypothesis testing is a core tool in medical and scientific analysis.
Using ggplot2, plotly, and t.test() in R helps present data transparently and interactively.