2025-11-16

Introduction

Hypothesis testing is a method of testing an assumption about a population by examining data from a sample.

The test determines whether the pattern we observe in the sample can be explained by coincidence or whether it reflects true differences or effects in the population.

What is a Hypothesis?

A hypothesis is a claim or assumption about a population parameter that we want to test using sample data.

There are two types of hypotheses:

  • Null hypothesis (H₀): a statement of equality or no effect.
    Example: the average height in the population is 66 inches.

  • Alternative hypothesis (H₁): a statement that contradicts the null and represents what we want to test.

What are we Testing?

We are testing to see if the average height of a woman is equal to 66 inches. We will do this by using a one-sample t-test from the ‘women’ dataset to determine average height.

Null hypothesis(H₀): \[ H_0 : \mu = 66\] Alternative Hypothesis(H₁): \[ H_1 : \mu \neq 66 \] —

One-Sample t-Test

We compute the t-statistic using the formula:

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

Where:

  • \(\bar{x}\) is the sample mean
  • \(\mu_0\) is the hypothesized population mean
  • \(s\) is the sample standard deviation
  • \(n\) is the sample size

Heights Compared to Hypothesized Mean

Boxplot of Women’s Heights

Height Vs Weight Plot

R-code Slide

## 
##  One Sample t-test
## 
## data:  women$height
## t = -0.86603, df = 14, p-value = 0.4011
## alternative hypothesis: true mean is not equal to 66
## 95 percent confidence interval:
##  62.52341 67.47659
## sample estimates:
## mean of x 
##        65

Conclusion

There is not enough evidence to conclude the average height is different from 66 inches. The sample mean is 65 inches with a p-value of .401. Given this date, we fail to rejct the null hypothesis.