September 16, 2026

Hypothesis Testing with Clinical Data

Using Patient Data to Test a Clinical Question


Clinical Question:

Does a treatment reduce average systolic blood pressure?


Tools: R, ggplot2, and Plotly

The dataset is simulated for educational purposes.

Why Use Hypothesis Testing?

Clinical researchers often want to know whether an observed difference provides evidence of a real difference.

Examples:

  • Does a treatment lower blood pressure?
  • Does a medication reduce heart rate?
  • Is a biomarker different between groups?
  • Does a treatment improve patient outcomes?

Hypothesis testing helps us use sample data to evaluate a claim about a population.

Population vs. Sample

Population

The population is the entire group we want to study.

Example: All patients who could receive a particular treatment.

Sample

The sample is the smaller group included in the study.

Example: 30 patients in our simulated dataset.

We use information from the sample to learn about the population.

Our Clinical Dataset

Our dataset contains information about:

  • 30 patients
  • Age
  • Treatment group
  • Systolic blood pressure
  • Heart rate

Two groups

Control: 15 patients

Treatment: 15 patients

Main variable

Systolic blood pressure (SBP)

Measured in mmHg.

Clinical Question

Suppose we want to know:

Does the treatment reduce average systolic blood pressure below 130 mmHg?

We will focus on the treatment group.

Our reference value is:

\[ \mu_0 = 130 \text{ mmHg} \]

We will use a one-sample t-test.

Null and Alternative Hypotheses

Null hypothesis

\[ H_0: \mu = 130 \]

The population average systolic blood pressure is 130 mmHg.

Alternative hypothesis

\[ H_a: \mu < 130 \]

The population average systolic blood pressure is less than 130 mmHg.

Because we are looking for a reduction, this is a one-sided test.

Significance Level

Before performing the test, we choose a significance level.

\[ \alpha = 0.05 \]

The significance level is our cutoff for making a statistical decision.

Decision rule

\[ p < \alpha \Rightarrow \text{Reject } H_0 \]

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

What Is a p-value?

The p-value tells us how unusual our sample result would be if the null hypothesis were true.

Simple interpretation

  • Small p-value → stronger evidence against \(H_0\)
  • Large p-value → not enough evidence against \(H_0\)

A p-value does not tell us the probability that the null hypothesis is true.

Systolic Blood Pressure by Group

The treatment group appears to have lower systolic blood pressure values.

The boxplot shows the distribution of the patient measurements.

Average Systolic Blood Pressure

The dashed line represents the reference value of 130 mmHg.

The treatment group’s average is below this value.

R Code: Performing the Test

We can perform the hypothesis test using t.test().

treatment = clinical$systolic_bp[
  clinical$group == "Treatment"
]

result = t.test(
  treatment,
  mu = 130,
  alternative = "less"
)

result
    One Sample t-test

data:  treatment
t = -6.8961, df = 14, p-value = 3.685e-06
alternative hypothesis: true mean is less than 130
95 percent confidence interval:
     -Inf 126.4756
sample estimates:
mean of x 
 125.2667 

R gives us: - t-statistic - degrees of freedom - p-value - confidence interval - sample mean

Calculating the Test Statistic

For a one-sample t-test:

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

Where:

  • \(\bar{x}\) = sample mean
  • \(\mu_0\) = reference mean
  • \(s\) = sample standard deviation
  • \(n\) = sample size

For our treatment group:

\[ \bar{x} = 125.27 \text{ mmHg} \]

\[ s = 2.66 \]

\[ n = 15 \]

Therefore:

\[ \boxed{t = -6.896} \]

Our Results

Sample Mean

125.27 mmHg

t-statistic

-6.896

p-value

3.685e-06

Significance Level

0.05

Making the Decision

We compare the p-value with our significance level.

\[ p = 3.685e-06 \]

\[ \alpha = 0.05 \]

Because:

\[ p < 0.05 \]

we reject \(H_0\).

There is enough statistical evidence to conclude that the treatment group’s average systolic blood pressure is below 130 mmHg.

Understanding the t-Distribution

The t-statistic is away from the center of the distribution.

This provides evidence against the null hypothesis.

3D Clinical Data Visualization

Each point represents one patient.

The 3D plot lets us look at three clinical variables at the same time:

  • Age
  • Heart rate
  • Systolic blood pressure

What Does Our Result Mean?

Our hypotheses were:

\[ H_0: \mu = 130 \]

\[ H_a: \mu < 130 \]

Our p-value was:

\[ p = 3.685e-06 \]

Since:

\[ p < 0.05 \]

we reject the null hypothesis.

There is statistically significant evidence that the treatment group’s average systolic blood pressure is below 130 mmHg.

What We Cannot Conclude

Rejecting \(H_0\) does not mean:

  • Every patient will have lower blood pressure.
  • The treatment works for every patient.
  • The treatment is automatically clinically important.
  • We have proven the alternative hypothesis with certainty.

Our conclusion is based on the evidence provided by this sample.

Statistical vs. Clinical Significance

A statistically significant result does not always mean that the difference is important in clinical practice.

Researchers should also consider:

  • How large is the difference?
  • How many patients were studied?
  • Is the sample representative?
  • Are other factors affecting blood pressure?
  • Is the difference clinically meaningful?

Statistical significance and clinical significance are not the same thing.

Key Takeaways

In this project, we:

1. Started with a clinical question

Does treatment reduce systolic blood pressure?

2. Created hypotheses

\[ H_0: \mu = 130 \]

\[ H_a: \mu < 130 \]

3. Used a one-sample t-test

4. Calculated a p-value

5. Compared the p-value with 0.05

6. Made a statistical conclusion

Final Conclusion

What Did We Learn?


The treatment group had an average systolic blood pressure below 130 mmHg.


Our hypothesis test provided statistical evidence supporting this finding.


Hypothesis testing helps turn clinical data into statistical evidence.

Thank You!

Hypothesis Testing with Clinical Data


Clinical question → Sample data → Statistical test → Evidence → Conclusion


Questions?