Hypothesis Testing – STAT 211, Quiz 7 – Study Notes

Source: Quiz 7 Review, Principles of Statistics I (Texas A&M University)

Tags: hypothesis testing, null hypothesis, alternative hypothesis, t-test, z-test, one-sample test, test statistic, p-value, significance level, alpha, reject null, fail to reject, STAT 211, proportions test


TL;DR

Hypothesis testing is a structured method for deciding whether sample data provides enough evidence to reject a claim about a population parameter. You set up competing hypotheses (null vs. alternative), compute a test statistic, find the p-value, and compare it to your significance level to reach a conclusion. The choice between a Z-test and a T-test depends on whether you know the population standard deviation and whether you are testing a mean or a proportion.


Key Terms

Null hypothesis (H₀)

The default claim about the population parameter. It always contains an equality (=, ≤, or ≥). You assume it is true unless the data gives you strong enough evidence to reject it.

Alternative hypothesis (H₁ or Hₐ)

The competing claim you are trying to find evidence for. It can be one-sided (< or >) or two-sided (≠).

Test statistic

A standardised value calculated from your sample data, assuming H₀ is true. It measures how far your sample result is from what H₀ predicts. Larger absolute values suggest stronger evidence against H₀.

P-value

The probability of observing a test statistic as extreme as (or more extreme than) the one you calculated, assuming H₀ is true. A small p-value means the observed data would be unusual if H₀ were correct.

Significance level (α)

The threshold you set before testing. If your p-value falls at or below α, you reject H₀. Common values are 0.05 and 0.01.

One-tailed test (one-sided)

Used when H₁ specifies a direction (greater than or less than). The entire rejection region sits in one tail of the distribution.

Two-tailed test (two-sided)

Used when H₁ specifies "not equal to." The rejection region is split across both tails.

Degrees of freedom (df)

For a one-sample t-test: df = n − 1. This determines which t-distribution you use to find the p-value.

Sample proportion (p̂)

The proportion of successes in your sample: p̂ = X / n, where X is the number of successes and n is the sample size.


Core Content

Choosing the Right Test Statistic

There are three test statistics covered in this material, each suited to different conditions:

  • Z-test for a mean (σ known): use when the population standard deviation σ is given and the sample size is large, or the population is normal

    • Z* = (X̄ − μ₀) / (σ / √n)

  • T-test for a mean (σ unknown): use when the population standard deviation is not known and you rely on the sample standard deviation s instead; requires normality or large n

    • T* = (X̄ − μ₀) / (s / √n)

    • Degrees of freedom: df = n − 1

  • Z-test for a proportion: use when testing a population proportion p against a claimed value p₀

    • Z* = (p̂ − p₀) / √(p₀(1 − p₀) / n)

    • Conditions: np₀ ≥ 5 and n(1 − p₀) ≥ 5

The Five-Step Hypothesis Testing Procedure

  1. State the hypotheses: write H₀ (the claim with equality) and H₁ (what you want evidence for)

  1. Set the significance level (α): typically given in the problem

  1. Compute the test statistic: plug your sample values into the appropriate formula, assuming H₀ is true

  1. Find the p-value: the tail probability corresponding to your test statistic, matched to the direction of H₁

  1. Make your decision: if p-value ≤ α, reject H₀; if p-value > α, fail to reject H₀

How to Set Up Hypotheses Correctly

The wording of the research question tells you H₁:

  • "Is the true mean equal to 50?" → two-tailed: H₁: μ ≠ 50

  • "Do students drink more than 3 cups?" → right-tailed: H₁: μ > 3

  • "Is the proportion less than 49.4%?" → left-tailed: H₁: p < 0.494

  • "Has the average decreased?" → left-tailed: H₁: μ < 15.2

H₀ always takes the complementary form with equality included.


Worked Examples

Problem 1: One-Sample T-Test (Two-Tailed)

Setup: n = 6 steel beams, X̄ = 58 psi, s = 6 psi, α = 0.05. Test whether the true mean compressive strength is 50 psi. Normality assumed.

  • H₀: μ = 50

  • H₁: μ ≠ 50 (two-tailed, because the question says "whether" the mean is 50, not "greater" or "less")

  • σ is unknown, so use the t-test

  • T* = (58 − 50) / (6 / √6) = 8 / 2.449 ≈ 3.266

  • df = 6 − 1 = 5

  • P-value: find the two-tailed probability for T* = 3.266 with 5 df. This falls between 0.02 and 0.05 (approximately 0.022)

  • Since p-value < 0.05, reject H₀

Interpretation: At the 0.05 significance level, there is sufficient evidence to conclude that the true mean compressive strength of the steel is not 50 psi.

Problem 2: One-Sample T-Test (Right-Tailed)

Setup: n = 49 students, X̄ = 3.7 cups, s = 1.4 cups, α = 0.05. National average μ₀ = 3 cups. Test whether university students drink more coffee than the national average.

  • H₀: μ ≤ 3 (or μ = 3)

  • H₁: μ > 3 (right-tailed, because the question asks "more than")

  • σ is unknown, so use the t-test

  • T* = (3.7 − 3) / (1.4 / √49) = 0.7 / 0.2 = 3.5

  • df = 49 − 1 = 48

  • P-value: right-tail probability for T* = 3.5 with 48 df. This is very small (approximately 0.0005)

  • Since p-value < 0.05, reject H₀

Interpretation: At the 0.05 significance level, there is sufficient evidence to conclude that university students drink more coffee on average than the national average of 3 cups per day.

Problem 3: One-Sample Z-Test for a Proportion (Left-Tailed)

Setup: n = 40 gym members, X = 28 met guidelines, p₀ = 0.494, α = 0.01. Test whether the proportion of gym members meeting CDC physical activity guidelines is less than the national average.

  • p̂ = 28 / 40 = 0.70

  • H₀: p ≥ 0.494 (or p = 0.494)

  • H₁: p < 0.494 (left-tailed, because the question asks "less than")

  • Z* = (0.70 − 0.494) / √(0.494 × 0.506 / 40) = 0.206 / 0.0791 ≈ 2.604

  • The test statistic is positive (sample proportion is above, not below, the claimed value)

  • P-value for a left-tailed test with Z* = 2.604 is very large (approximately 0.9954)

  • Since p-value > 0.01, fail to reject H₀

Interpretation: At the 0.01 significance level, there is not sufficient evidence to conclude that the proportion of gym members meeting the CDC guidelines is less than the national average of 49.4%. In fact, the sample proportion (70%) is well above the national figure, so the data runs in the opposite direction of the alternative hypothesis.

Problem 4: One-Sample Z-Test (Left-Tailed, σ Known)

Setup: n = 35 calls, X̄ = 14.3 minutes, σ = 5 minutes (known), μ₀ = 15.2 minutes, α = 0.05. Test whether the average evening long-distance call has decreased.

  • H₀: μ ≥ 15.2 (or μ = 15.2)

  • H₁: μ < 15.2 (left-tailed, because the question asks "decreased")

  • σ is known, so use the z-test

  • Z* = (14.3 − 15.2) / (5 / √35) = −0.9 / 0.8452 ≈ −1.065

  • P-value: left-tail probability for Z* = −1.065 ≈ 0.1435

  • Since p-value > 0.05, fail to reject H₀

Interpretation: At the 0.05 significance level, there is not sufficient evidence to conclude that the average evening long-distance call duration has decreased from 15.2 minutes. Answer: No.


Formulas / Reference

Z-test for a mean (σ known):

Z* = (X̄ − μ₀) / (σ / √n)

T-test for a mean (σ unknown):

T* = (X̄ − μ₀) / (s / √n), with df = n − 1

Z-test for a proportion:

Z* = (p̂ − p₀) / √(p₀(1 − p₀) / n)

where p̂ = X / n


Why It Matters / Exam Flags

⚠️ The single most common decision point: use a T-test when the population standard deviation σ is unknown and you are substituting the sample standard deviation s. Use a Z-test when σ is given or when testing a proportion.

⚠️ A two-tailed test doubles the tail area. If your one-tailed p-value is 0.011, the two-tailed p-value is 0.022. Forgetting to double is a frequent error.

⚠️ "Fail to reject H₀" is not the same as "accept H₀." You never prove the null is true; you simply say the data did not give enough evidence against it.

⚠️ Always interpret your conclusion in plain language, in context. A bare "reject H₀" without a sentence about what that means for steel beams, coffee, or gym members will lose you marks.

⚠️ Check the direction of the test statistic against the direction of H₁. In Problem 3, the sample proportion was above the claimed value while H₁ was testing for below. The p-value was enormous, and the conclusion was to fail to reject. The numbers have to make directional sense.

⚠️ When testing proportions, verify the conditions np₀ ≥ 5 and n(1 − p₀) ≥ 5 before proceeding.


Practice Q&A

Q: You have a sample of 25 observations with X̄ = 72, s = 8, and you want to test H₀: μ = 70 at α = 0.05 (two-tailed). What test statistic do you use, and what is its value?

A: Use a t-test because σ is unknown. T* = (72 − 70) / (8 / √25) = 2 / 1.6 = 1.25, with df = 24.

Q: A researcher claims that more than 60% of households own a pet. In a sample of 200 households, 130 own a pet. State H₀ and H₁, and compute the test statistic.

A: H₀: p ≤ 0.60, H₁: p > 0.60. p̂ = 130/200 = 0.65. Z* = (0.65 − 0.60) / √(0.60 × 0.40 / 200) = 0.05 / 0.03464 ≈ 1.443.

Q: If your calculated p-value is 0.03 and α = 0.01, what is your decision?

A: Fail to reject H₀. The p-value (0.03) exceeds the significance level (0.01), so the evidence is not strong enough at the 1% level.

Q: Why do we use a t-distribution instead of the standard normal when σ is unknown?

A: Replacing σ with the sample standard deviation s introduces additional uncertainty. The t-distribution accounts for this by having heavier tails, which makes extreme values more likely and produces wider confidence intervals. As n increases, the t-distribution approaches the standard normal.

Q: In Problem 4, the population standard deviation σ is known to be 5 minutes. If it were not known and you had s = 5 instead, what would change?

A: You would use a t-test with df = 34 instead of a z-test. For large samples (n = 35), the t-distribution is very close to the normal, so the p-value would be nearly identical, but the procedure and notation change.


Related Terms / Search Tags

hypothesis testing, null hypothesis, alternative hypothesis, one-sample t-test, one-sample z-test, z-test for proportions, test statistic, p-value, significance level, alpha, type I error, reject null hypothesis, fail to reject, degrees of freedom, sample mean, sample proportion, population mean, population proportion, compressive strength, two-tailed test, one-tailed test, left-tailed, right-tailed, STAT 211, Texas A&M, principles of statistics, inferential statistics, statistical significance