2026-02-09

Introduction

Hypothesis Testing is a statistical method that uses sample data to evaluate a hypothesis about a population parameter.

It is arguably the most common application of statistics in science, engineering, and business.

We typically compare two opposing views:

  • The status quo (Null Hypothesis).

  • The claim we want to prove (Alternative Hypothesis).

Defining the Hypotheses

To perform a test, we must mathematically define our assumptions. The Null Hypothesis (\(H_0\)):Standard assumption; “no difference” or “no effect”. \[ H_0: \mu = \mu_0 \] The Alternative Hypothesis (\(H_a\)):The claim we suspect is true (the research hypothesis). \[ H_a: \mu \neq \mu_0 \]

The Test Statistic

Once we collect data, we calculate a Test Statistic. This value tells us how many standard deviations our sample mean deviates from the null hypothesis mean. For a large sample (Z-test), the formula is: \[ Z = \frac{\bar{x} - \mu_0}{\frac{\sigma}{\sqrt{n}}} \] Where: \(\bar{x}\) is the sample mean. \(\mu_0\) is the hypothesized population mean. \(\sigma\) is the standard deviation. \(n\) is the sample size.

Visualizing Critical Regions

If the test statistic falls into the “Critical Region”, we reject the Null Hypothesis.

Power of a Test

Statistical Power is the probability that the test correctly rejects a false Null Hypothesis. As sample size (\(n\)) increases, power increases.

Bivariate Probability

In multivariate testing, we often look at joint distributions. Here is a 2D Contour visualization.

R Code Implementation

Here is the R code used to generate the Power vs. Sample Size plot shown on a previous slide.

The P-Value Decision Rule

The P-Value quantifies the evidence against \(H_0\).

Decision Rule:

If \(p\text{-value} \leq \alpha\) (usually 0.05), we reject \(H_0\).

  • Small P-value: Strong evidence against null hypothesis.
  • Large P-value: Weak evidence against null hypothesis.

Conclusion

Hypothesis testing provides a structured framework for making decisions based on data.

Key Takeaways:

  • Always define \(H_0\) and \(H_a\) clearly.
  • Choose an appropriate significance level (\(\alpha\)).
  • Check assumptions (Normality, Independence).
  • Use visualizations to understand the distribution of your data.