4. Statistics

Hypothesis Testing

Formulating and conducting hypothesis tests for means, proportions and variances with significance levels.

Hypothesis Testing

Hey students! 👋 Welcome to one of the most powerful tools in statistics - hypothesis testing! In this lesson, you'll learn how to make informed decisions about populations using sample data, just like scientists and researchers do every day. By the end of this lesson, you'll understand how to formulate hypotheses, choose appropriate tests for means, proportions, and variances, and interpret results using significance levels. Think of hypothesis testing as being a detective 🕵️ - you have a theory about the world, and you're using evidence to prove or disprove it!

Understanding Hypothesis Testing Fundamentals

Hypothesis testing is a systematic method for making decisions about population parameters based on sample data. Imagine you're the quality control manager at a chocolate factory 🍫, and you need to determine if your machines are producing chocolate bars with the correct average weight of 50 grams.

The process begins with formulating two competing statements: the null hypothesis (H₀) and the alternative hypothesis (H₁ or Hₐ). The null hypothesis represents the status quo or the claim we're testing against, while the alternative hypothesis represents what we suspect might be true instead.

In our chocolate factory example:

  • H₀: μ = 50g (the machine is working correctly)
  • H₁: μ ≠ 50g (the machine needs adjustment)

The significance level (α) is the probability of rejecting a true null hypothesis, typically set at 0.05 (5%) or 0.01 (1%). This represents how much risk we're willing to take of making a Type I error - concluding something is wrong when it's actually fine.

A test statistic is a single number calculated from our sample data that helps us make our decision. Common test statistics include z-scores, t-scores, and chi-square values. The p-value represents the probability of obtaining our observed results (or more extreme) if the null hypothesis were true.

Testing Population Means

When testing hypotheses about population means, we use different approaches depending on whether we know the population standard deviation and our sample size.

Z-Test for Means (when σ is known or n ≥ 30):

The test statistic 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 population standard deviation, and $n$ is the sample size.

T-Test for Means (when σ is unknown and n < 30):

The test statistic is: $$t = \frac{\bar{x} - \mu_0}{\frac{s}{\sqrt{n}}}$$

Where $s$ is the sample standard deviation, and we use the t-distribution with (n-1) degrees of freedom.

Let's work through a real example! 📊 A coffee shop claims their large coffee contains an average of 16 ounces. You suspect they're serving less, so you measure 25 cups and find a sample mean of 15.8 ounces with a standard deviation of 0.5 ounces.

Setting up the test:

$- H₀: μ = 16 ounces$

  • H₁: μ < 16 ounces (one-tailed test)

$- α = 0.05$

Since we don't know the population standard deviation and n < 30, we use a t-test:

$$t = \frac{15.8 - 16}{\frac{0.5}{\sqrt{25}}} = \frac{-0.2}{0.1} = -2.0$$

With 24 degrees of freedom and α = 0.05 (one-tailed), the critical value is -1.711. Since -2.0 < -1.711, we reject H₀ and conclude the coffee shop is serving less than 16 ounces on average.

Testing Population Proportions

Proportion tests are used when dealing with categorical data, like success/failure or yes/no responses. These tests are incredibly common in market research, medical studies, and quality control.

The test statistic for proportions is: $$z = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}$$

Where $\hat{p}$ is the sample proportion, $p_0$ is the hypothesized population proportion, and $n$ is the sample size.

Consider this scenario: A pharmaceutical company claims their new medication is effective for 80% of patients. In a clinical trial of 200 patients, 150 showed improvement. Is there evidence that the true effectiveness rate is different from 80%? 💊

Setting up the test:

$- H₀: p = 0.80$

  • H₁: p ≠ 0.80 (two-tailed test)

$- α = 0.05$

  • Sample proportion: $\hat{p} = \frac{150}{200} = 0.75$

$$z = \frac{0.75 - 0.80}{\sqrt{\frac{0.80(0.20)}{200}}} = \frac{-0.05}{\sqrt{0.0008}} = \frac{-0.05}{0.0283} = -1.77$$

For a two-tailed test with α = 0.05, the critical values are ±1.96. Since -1.77 is between -1.96 and 1.96, we fail to reject H₀. There's insufficient evidence to conclude the effectiveness rate differs from 80%.

Testing Population Variances

Variance tests help us understand the consistency or variability in a population. These tests use the chi-square distribution and are particularly important in quality control and manufacturing processes.

The test statistic for variance is: $$\chi^2 = \frac{(n-1)s^2}{\sigma_0^2}$$

Where $s^2$ is the sample variance, $\sigma_0^2$ is the hypothesized population variance, and the test follows a chi-square distribution with (n-1) degrees of freedom.

Imagine you're managing a factory producing ball bearings ⚙️. The specification requires that the diameter variance shouldn't exceed 0.25 mm². You test 16 bearings and find a sample variance of 0.35 mm². Is there evidence that the process variance exceeds the specification?

Setting up the test:

$- H₀: σ² = 0.25$

  • H₁: σ² > 0.25 (one-tailed test)

$- α = 0.05$

$$\chi^2 = \frac{(16-1)(0.35)}{0.25} = \frac{15 \times 0.35}{0.25} = 21.0$$

With 15 degrees of freedom and α = 0.05 (one-tailed), the critical value is 24.996. Since 21.0 < 24.996, we fail to reject H₀. There's insufficient evidence to conclude that the process variance exceeds the specification.

Making Decisions and Interpreting Results

The decision-making process in hypothesis testing involves comparing our test statistic to critical values or comparing our p-value to the significance level. If the test statistic falls in the rejection region (or p-value < α), we reject the null hypothesis; otherwise, we fail to reject it.

It's crucial to understand that "failing to reject H₀" doesn't mean we've proven it true - we simply don't have enough evidence to conclude it's false. This is like a court trial: we either find someone guilty (reject H₀) or not guilty (fail to reject H₀), but "not guilty" doesn't necessarily mean innocent! ⚖️

Type I Error: Rejecting a true null hypothesis (false positive) - probability = α

Type II Error: Failing to reject a false null hypothesis (false negative) - probability = β

The power of a test (1 - β) represents the probability of correctly rejecting a false null hypothesis. Higher sample sizes generally increase the power of our tests.

Conclusion

Hypothesis testing is a powerful statistical tool that allows us to make informed decisions about populations using sample data. Whether testing means with z-tests or t-tests, proportions with z-tests, or variances with chi-square tests, the fundamental process remains the same: formulate hypotheses, choose an appropriate significance level, calculate the test statistic, and make a decision based on critical values or p-values. Remember that hypothesis testing helps us quantify uncertainty and make objective decisions, but it's essential to interpret results carefully and understand the limitations of our conclusions.

Study Notes

• Null Hypothesis (H₀): The statement being tested, usually representing no effect or no difference

• Alternative Hypothesis (H₁): The statement we suspect might be true instead of H₀

• Significance Level (α): The probability of Type I error, commonly 0.05 or 0.01

• Test Statistic: A single value calculated from sample data used to make decisions

• P-value: Probability of obtaining observed results (or more extreme) if H₀ is true

• Z-test for means: Used when σ is known or n ≥ 30: $z = \frac{\bar{x} - \mu_0}{\frac{\sigma}{\sqrt{n}}}$

• T-test for means: Used when σ is unknown and n < 30: $t = \frac{\bar{x} - \mu_0}{\frac{s}{\sqrt{n}}}$

• Z-test for proportions: $z = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}$

• Chi-square test for variance: $\chi^2 = \frac{(n-1)s^2}{\sigma_0^2}$

• Type I Error: Rejecting true H₀ (probability = α)

• Type II Error: Failing to reject false H₀ (probability = β)

• Power of test: Probability of correctly rejecting false H₀ = (1 - β)

• Decision rule: Reject H₀ if test statistic is in rejection region or if p-value < α

Practice Quiz

5 questions to test your understanding

Hypothesis Testing — A-Level Mathematics | A-Warded