Introduction to Hypothesis Testing

Definition: Hypothesis testing evaluates claims about populations using observed data from samples.

Importance:

  • Informed Decisions: Provides a systematic framework for validating claims and minimizing errors.
  • Research Validation: Essential for validating findings and comparing groups, supporting evidence-based decisions.

Real World Example:

  • A Teacher can evaluate whether a new teaching method is more effective in raising student test scores as compared to traditional methods.

Steps in Hypothesis Testing

  1. Formulate the null and alternative hypotheses. The null and alternative hypothesis must be complementary to each other.
  2. Calculate the appropriate test statistic using the sample data.
  3. Compare test statistic to critical region.
  4. Calculate p-value
  5. Make the conclusion based on the test statistic and p-value and include significance \(\alpha\).

Types of Test Statistics

z-distribution Test

- Used for large sample sizes (\(n \geq 30\)).
- Population standard deviation is known and the distribution is normal.

\[ z = \frac{\overline{x} - \mu}{\frac{\sigma}{\sqrt{n}}} \]

t-distribution Test

- Used for small sample sizes (\(n < 30\)).
- Population data is normally distributed.

\[ t = \frac{\overline{x}-\mu}{\frac{s}{\sqrt{n}}} \]

Example of t-test

Data from R package dataset “women”

Check for normal distribution

Check for normal distribution

Hypothesis Testing

\[ \scriptsize H_0: \mu = 120 \quad (\text{population mean is equal to 120 pounds})\] \[ \scriptsize H_a: \mu \neq 120 \quad (\text{population mean is not equal to 120 pounds})\]

data("women")
sample_mean = mean(women$weight)
sample_sd = sd(women$weight)
t_test = (sample_mean - 120) / (sample_sd / sqrt(15))
p_value = 2 * pt(abs(t_test), df = 14)
t_test

[1] 4.181508

p_value

[1] 1.999077