Hypothesis testing is the process of making inferences about population parameters based on sample statistics. It's a fundamental concept in statistical analysis that allows us to make decisions based on limited data.
Null Hypothesis (H₀): A statement that there is no effect, difference, or relationship. It represents the status quo.
Alternative Hypothesis (H₁): A statement that contradicts the null hypothesis, suggesting that there is an effect, difference, or relationship.
The significance level is the probability of rejecting the null hypothesis when it is true (Type I error).
Common values are 0.05 (5%), 0.01 (1%), and 0.10 (10%).
Denoted by α (alpha).
Different types of tests use different test statistics:
Z-test: For normally distributed data with known population variance
T-test: For normally distributed data with unknown population variance
Chi-squared test: For categorical data
Critical Region: The set of values for the test statistic that leads to rejection of the null hypothesis.
Critical Value: The value that separates the critical region from the acceptance region.
The probability of obtaining a test statistic at least as extreme as the one observed, assuming the null hypothesis is true.
If p-value < significance level, reject H₀.
Type I Error: Rejecting H₀ when it is true (false positive)
Type II Error: Not rejecting H₀ when it is false (false negative)
Used when testing a claim about a population mean when the population standard deviation is known.
Formula: z = (x̄ - μ) / (σ/√n)
Where:
x̄ = sample mean
μ = hypothesized population mean
σ = population standard deviation
n = sample size
Used when testing a claim about a population mean when the population standard deviation is unknown.
Formula: t = (x̄ - μ) / (s/√n)
Where:
s = sample standard deviation
Used to compare two population means when the population standard deviations are known.
Formula: z = (x̄₁ - x̄₂ - (μ₁ - μ₂)) / √(σ₁²/n₁ + σ₂²/n₂)
Used to compare two population means when the population standard deviations are unknown.
Formula: t = (x̄₁ - x̄₂) / √(s₁²/n₁ + s₂²/n₂)
Used when data points come in pairs, and we're testing for a difference between the pairs.
Formula: t = d̄ / (s_d/√n)
Where:
d̄ = mean of the differences
s_d = standard deviation of the differences
Used to determine whether a categorical variable follows a hypothesized distribution.
Formula: χ² = Σ [(Observed - Expected)² / Expected]
Used to determine whether two categorical variables are independent.
Formula: χ² = Σ [(Observed - Expected)² / Expected]
Where Expected = (row total × column total) / grand total
State the hypotheses:
Null hypothesis (H₀)
Alternative hypothesis (H₁)
Choose the significance level (α).
Select the appropriate test statistic.
Determine the critical region or compute the p-value.
Make a decision:
If test statistic falls in the critical region (or p-value < α), reject H₀.
Otherwise, do not reject H₀.
State the conclusion in context of the original problem.
Remember that "not rejecting H₀" is not the same as "accepting H₀"
Always state your conclusion in the context of the original problem
Be careful about the directionality of your tests (one-tailed vs. two-tailed)
Ensure your data meets the assumptions of the test you're using
Sample size matters - larger samples give more reliable results
Problem: A company claims that the mean lifetime of their light bulbs is 1000 hours. A random sample of 36 bulbs has a mean lifetime of 970 hours. The population standard deviation is known to be 90 hours. Test the claim at a 5% significance level.
Solution:
H₀: μ = 1000 hours H₁: μ ≠ 1000 hours
α = 0.05 (two-tailed test)
Test statistic: z = (970 - 1000) / (90/√36) = -30/15 = -2
Critical values: z = ±1.96 (for a two-tailed test at α = 0.05)
Decision: Since -2 < -1.96, the test statistic falls in the critical region.
Conclusion: Reject H₀. There is sufficient evidence to suggest that the mean lifetime of the light bulbs is not 1000 hours.
Problem: A survey asks 200 people whether they prefer tea or coffee, and whether they work in the morning or evening. The results are:
Tea | Coffee | Total | |
---|---|---|---|
Morning | 45 | 65 | 110 |
Evening | 55 | 35 | 90 |
Total | 100 | 100 | 200 |
Test at a 5% significance level whether drink preference is independent of work schedule.
Solution:
H₀: Drink preference is independent of work schedule H₁: Drink preference is dependent on work schedule
α = 0.05
Calculate expected values: E(Morning, Tea) = (110 × 100) / 200 = 55 E(Morning, Coffee) = (110 × 100) / 200 = 55 E(Evening, Tea) = (90 × 100) / 200 = 45 E(Evening, Coffee) = (90 × 100) / 200 = 45
Calculate χ²: χ² = (45-55)²/55 + (65-55)²/55 + (55-45)²/45 + (35-45)²/45 χ² = 1.82 + 1.82 + 2.22 + 2.22 = 8.08
Degrees of freedom = (rows-1)(columns-1) = (2-1)(2-1) = 1 Critical value at α = 0.05 with df = 1 is 3.84
Decision: Since 8.08 > 3.84, reject H₀
Conclusion: There is sufficient evidence to suggest that drink preference is dependent on work schedule.
Test | Formula | When to Use |
---|---|---|
Z-test (one sample) | z = (x̄ - μ) / (σ/√n) | Known σ, testing μ |
T-test (one sample) | t = (x̄ - μ) / (s/√n) | Unknown σ, testing μ |
Z-test (two sample) | z = (x̄₁ - x̄₂) / √(σ₁²/n₁ + σ₂²/n₂) | Known σ₁ and σ₂, comparing means |
T-test (two sample) | t = (x̄₁ - x̄₂) / √(s₁²/n₁ + s₂²/n₂) | Unknown σ₁ and σ₂, comparing means |
Paired T-test | t = d̄ / (s_d/√n) | Paired observations |
Chi-Square | χ² = Σ [(O - E)² / E] | Categorical data |