Skip to content

Latest commit

 

History

History
133 lines (84 loc) · 4.46 KB

3. Hypothesis Testing.md

File metadata and controls

133 lines (84 loc) · 4.46 KB

Hypothesis Testing

Hypothesis testing is a statistical method used to make inferences about a population based on sample data. It evaluates whether there is enough evidence to support or reject a specific claim about a population parameter.


Key Concepts in Hypothesis Testing

  1. Null Hypothesis ($H_0$)
    The default assumption that there is no effect or difference.

    • Example: $H_0: \mu = 50$ (The population mean is 50).
  2. Alternative Hypothesis ($H_a$)
    The statement being tested, representing a potential effect or difference.

    • Example: $H_a: \mu \neq 50$ (The population mean is not 50).
  3. Significance Level ($\alpha$)
    The threshold for rejecting the null hypothesis, typically set at 0.05 (5%).

  4. Test Statistic
    A value calculated from the sample data used to compare with the critical value or p-value.

  5. P-Value
    The probability of observing a test statistic as extreme as, or more extreme than, the one observed, assuming $H_0$ is true.

  6. Decision Rule

    • Reject $H_0$ if $p$-value $\leq \alpha$.
    • Fail to reject $H_0$ if $p$-value $> \alpha$.

Steps in Hypothesis Testing

  1. State the Hypotheses:

    • Null hypothesis ($H_0$)
    • Alternative hypothesis ($H_a$)
  2. Set the Significance Level ($\alpha$):
    Common values are 0.01, 0.05, or 0.10.

  3. Choose the Test and Calculate the Test Statistic:
    Select the appropriate test (e.g., $t$-test, $z$-test) based on data type and sample size.

  4. Find the P-Value or Critical Value:
    Compare the test statistic to the critical value or use the $p$-value approach.

  5. Make a Decision:

    • Reject $H_0$ if there is sufficient evidence.
    • Fail to reject $H_0$ if there is insufficient evidence.
  6. Draw a Conclusion:
    State the results in the context of the problem.


Types of Hypothesis Tests

1. One-Tailed Test

  • Tests if a parameter is greater than or less than a specific value.
  • Example: $H_0: \mu \leq 50, , H_a: \mu > 50$

2. Two-Tailed Test

  • Tests if a parameter is not equal to a specific value.
  • Example: $H_0: \mu = 50, , H_a: \mu \neq 50$

Common Tests in Hypothesis Testing

  1. Z-Test

    • Used for large sample sizes ($n > 30$) or when population variance is known.
    • Example: Testing if the mean height of students differs from 170 cm.
  2. T-Test

    • Used for small sample sizes ($n \leq 30$) or when population variance is unknown.
    • Types: One-sample $t$-test, two-sample $t$-test, paired $t$-test.
  3. Chi-Square Test

    • Used for categorical data to test relationships or goodness of fit.
    • Example: Testing if the observed frequencies of colors in candy bags match the expected proportions.
  4. ANOVA (Analysis of Variance)

    • Used to compare means across three or more groups.
    • Example: Testing if the average test scores differ across schools.

Example: One-Sample T-Test

Problem:

A company claims the average lifetime of its batteries is 300 hours. A random sample of 25 batteries has a mean lifetime of 290 hours with a standard deviation of 20 hours. Is there evidence at the 0.05 significance level to reject the company’s claim?

Solution:

  1. State the Hypotheses:
    $H_0: \mu = 300$, $H_a: \mu \neq 300$

  2. Set the Significance Level:
    $\alpha = 0.05$

  3. Calculate the Test Statistic:

    $$t = \frac{\bar{x} - \mu}{\frac{s}{\sqrt{n}}} = \frac{290 - 300}{\frac{20}{\sqrt{25}}} = \frac{-10}{4} = -2.5$$

  4. Find the Critical Value or P-Value:
    From $t$-distribution tables, critical $t$-value at $\alpha = 0.05$ (two-tailed, $df = 24$) is approximately $\pm 2.064$.

  5. Decision:
    Since $-2.5 < -2.064$, reject $H_0$.

  6. Conclusion:
    There is sufficient evidence to reject the claim that the average battery lifetime is 300 hours.


Applications of Hypothesis Testing

  1. Healthcare: Testing the effectiveness of new treatments.
  2. Business: Comparing customer satisfaction between two products.
  3. Education: Evaluating the impact of new teaching methods.

Conclusion

Hypothesis testing is a powerful tool for making data-driven decisions. By systematically evaluating claims and interpreting results, it enables researchers and decision-makers to draw reliable conclusions.


Next Steps: Simple Linear Regression