Hypothesis testing is a statistical method used to make decisions or inferences about a population parameter based on sample data.
- Population: The entire group being studied.
- Sample: A subset of the population used for analysis.
- Null Hypothesis (H₀): Assumes no effect or no difference.
- Alternative Hypothesis (H₁ or Ha): Assumes there is an effect or difference.
- Significance Level (α): Probability of rejecting H₀ when it is true (commonly 0.05).
- p-value: Probability of observing the data (or something more extreme) assuming H₀ is true.
- Test Statistic: A standardized value used to determine whether to reject H₀.
- Type I Error (α): Rejecting a true null hypothesis.
- Type II Error (β): Failing to reject a false null hypothesis.
| Condition | Decision |
|---|---|
| p-value ≤ α | Reject H₀ |
| p-value > α | Fail to reject H₀ |
Used to test whether the sample mean differs from a known or hypothesized population mean.
Example:
Is the average test score greater than 70?
Hypotheses:
- H₀: μ = 70
- H₁: μ > 70
Used to compare the means of two independent groups.
Example:
Do males and females have different average incomes?
Hypotheses:
- H₀: μ₁ = μ₂
- H₁: μ₁ ≠ μ₂
Used when comparing two related samples (e.g., before and after a treatment).
Example:
Did a training program improve test scores?
Hypotheses:
- H₀: μ_diff = 0
- H₁: μ_diff ≠ 0
Used to compare the means of three or more independent groups.
Example:
Do different teaching methods produce different average scores?
Hypotheses:
- H₀: μ₁ = μ₂ = μ₃
- H₁: At least one mean is different
Used to test whether two categorical variables are independent.
Example:
Is gender independent of survival on the Titanic?
Hypotheses:
- H₀: The variables are independent
- H₁: The variables are dependent
Used to compare proportions between two groups.
Example:
Does version B of a webpage have a higher click-through rate than version A?
Hypotheses:
- H₀: p₁ = p₂
- H₁: p₁ ≠ p₂
- State the hypotheses (H₀ and H₁)
- Choose the significance level (α)
- Select the appropriate test
- Calculate the test statistic and p-value
- Compare p-value with α
- Make a decision (Reject or Fail to Reject H₀)
- Interpret the result in context
- Interpreting “fail to reject H₀” as “accept H₀.”
- Ignoring test assumptions (normality, equal variances, independence).
- Treating p-value as the probability that H₀ is true.
- Drawing conclusions without considering effect size or confidence intervals.
| Test Type | Data Type | Groups | Typical Use Case |
|---|---|---|---|
| One-sample t-test | Continuous | 1 | Compare sample mean to a fixed value |
| Two-sample t-test | Continuous | 2 | Compare means of two independent groups |
| Paired t-test | Continuous (paired) | 2 | Compare means of related samples (before–after) |
| ANOVA | Continuous | 3+ | Compare means across multiple groups |
| Chi-square test | Categorical | 2+ | Test independence of categorical variables |
| A/B test (z-test) | Proportion | 2 | Compare proportions between two groups |
If p-value = 0.03 and α = 0.05
→ 0.03 < 0.05 ⇒ Reject H₀
→ There is sufficient evidence to suggest a significant difference or effect.