📊

Understanding Two-Sample Tests in Hypothesis Testing

Aug 4, 2024

Lecture Notes: Two-Sample Tests

Introduction to Two-Sample Tests

  • Comparison of two different samples.
  • Focus on independent and dependent samples.
  • Discussing Z test, testing proportions, and T-test.

Five-Step Process of Hypothesis Testing

  1. State the Null and Alternate Hypothesis
    • Null hypothesis: Assumed to be true (status quo).
    • Alternate hypothesis: What you aim to prove.
  2. Select Level of Significance
    • Common values: 0.05 or 0.01 (anything <= 0.1 can be significant).
  3. Identify the Test Statistic
    • Use Z if population standard deviation is known or for proportions.
    • Use T if population standard deviation is unknown.
  4. Formulate the Decision Rule
    • Identify critical value from Z or T table for comparison.
  5. Compute Test Statistic
    • Compare computed statistic to critical value to accept or reject the null hypothesis.
    • Rule: If computed value < critical value, do not reject null hypothesis.

Comparing Two Populations

Example: Residential Real Estate Values

  • Comparing values of real estate sold by males vs. females.
  • Test scores comparison between genders.

Z-test for Two Samples

  • Formula:

    [ Z = \frac{\bar{X}_1 - \bar{X}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}} ]

  • Example scenario: Grocery store comparing self-checkout vs. standard checkout times.

  • Steps to perform Z-test:

    1. State null (no difference in time) and alternate hypothesis (self-checkout is faster).
    2. Level of significance: 0.01.
    3. Use Z-test since population standard deviation is known.
    4. Determine critical Z value (1-tail, 0.01 significance) = 2.33.
    5. Compute Z value, compare with critical value, and decide.

Test of Proportions

  • Proportions compare yes/no data (e.g., pass/fail, preferences).

  • Steps for hypothesis test:

    1. State hypotheses (null: no difference, alternate: there is a difference).

    2. Use significance level of 0.05.

    3. Compute pooled proportion for Z test. Formula:

      [ P_{pooled} = \frac{x_1 + x_2}{n_1 + n_2} ]

  • Example: Perfume preference comparison between younger and older women.

  • Compute Z and compare with critical value to accept or reject the null hypothesis._

T-test for Two Samples

  • Use T-test when population standard deviations are unknown.
  • Example: Lawn mower assembly time comparison.
  • Steps:
    1. State hypotheses (null: no difference, alternate: there is a difference).
    2. Use significance level of 0.1.
    3. Calculate degrees of freedom and critical value.
    4. Compute T statistic using samples.

Dependent Samples

  • Dependent samples involve the same sample before and after (e.g., test scores before and after a course).
  • Example: House appraisal comparison by two companies.
  • Steps:
    1. State hypotheses (null: no difference, alternate: there is a difference).
    2. Significance level: 0.05.
    3. Calculate mean of differences, standard deviation of differences, and T statistic.
    4. Compare T statistic with critical value.

Conclusion

  • Recap of the five-step process for hypothesis testing.
  • Importance of using proper statistical tests based on data characteristics.