Hypothesis Testing: Two Sample Tests

Hypothesis Testing with Two Samples

Null and Alternative Hypotheses

  • Null Hypothesis: No significant difference between the sample means of the two groups.
  • Alternative Hypothesis: There is a significant difference between the sample means of the two groups.

Critical Region

  • The critical region is determined by the alpha level α\alpha. For α=0.05\alpha = 0.05 in a two-tailed test, the critical values are ±1.96\pm 1.96.

Formulas for Test Statistic

The test statistic zz is calculated differently for two-sample tests. The general formula is:

z=xˉ<em>1xˉ</em>2(μ<em>1μ</em>2)Standard Deviation of Sampling Distributionz = \frac{\bar{x}<em>1 - \bar{x}</em>2 - (\mu<em>1 - \mu</em>2)}{\text{Standard Deviation of Sampling Distribution}}

Where:

  • xˉ<em>1\bar{x}<em>1 and xˉ</em>2\bar{x}</em>2 are the sample means of the two groups.
  • μ<em>1\mu<em>1 and μ</em>2\mu</em>2 are the population means of the two groups.

Under the null hypothesis, μ<em>1μ</em>2=0\mu<em>1 - \mu</em>2 = 0, so the formula simplifies to:

z=xˉ<em>1xˉ</em>2Standard Deviation of Sampling Distributionz = \frac{\bar{x}<em>1 - \bar{x}</em>2}{\text{Standard Deviation of Sampling Distribution}}

Expanding the Formula

The standard deviation of the sampling distribution needs to be calculated. The formula depends on whether the population standard deviations are known.

  • If population standard deviations are known:

    Standard Deviation of Sampling Distribution=σ<em>12n</em>1+σ<em>22n</em>2\text{Standard Deviation of Sampling Distribution} = \sqrt{\frac{\sigma<em>1^2}{n</em>1} + \frac{\sigma<em>2^2}{n</em>2}}

    Where:

    • σ<em>12\sigma<em>1^2 and σ</em>22\sigma</em>2^2 are the variances of the two populations.
    • n<em>1n<em>1 and n</em>2n</em>2 are the sample sizes of the two groups.
  • If population standard deviations are unknown:

    Standard Deviation of Sampling Distribution=s<em>12n</em>1+s<em>22n</em>2\text{Standard Deviation of Sampling Distribution} = \sqrt{\frac{s<em>1^2}{n</em>1} + \frac{s<em>2^2}{n</em>2}}

    Where:

    • s<em>12s<em>1^2 and s</em>22s</em>2^2 are the sample variances of the two groups.
    • n<em>1n<em>1 and n</em>2n</em>2 are the sample sizes of the two groups.

Decision Making

  • After calculating the test statistic zz, compare it to the critical values.
  • If |z| > 1.96 (for α=0.05\alpha = 0.05), reject the null hypothesis.
  • If z1.96|z| \leq 1.96, fail to reject the null hypothesis.

Factors Influencing the Decision

  1. Size of the Difference Between Sample Statistics:

    • If the difference between xˉ<em>1\bar{x}<em>1 and xˉ</em>2\bar{x}</em>2 is large, it is more likely to reject the null hypothesis. This means the calculated zz value will likely fall beyond the critical value.
    • Example: If group 1 scores 90% and group 2 scores 70%, the large difference increases the likelihood of rejecting the null hypothesis.
  2. Alpha Level:

    • A larger alpha level (e.g., α=0.10\alpha = 0.10) makes it more likely to reject the null hypothesis.
    • Analogy: A lenient teacher (higher alpha) is more likely to give higher grades, making it easier to score well.
  3. One-Tailed vs. Two-Tailed Test:

    • One-tailed tests are more likely to reject the null hypothesis because the entire alpha level is concentrated in one direction.
    • Two-tailed tests split the rejection region, making it more strict.
  4. Sample Size:

    • A larger sample size makes it more likely to reject the null hypothesis.
    • A larger sample size makes the denominator of the zz statistic smaller, resulting in a larger zz value if the numerator (difference in means) is constant.
    • If nn is large and the denominator is small, then zz is large.
    • A survey of 1000 people is more reliable than a survey of 10 people.

Example Question

  • Question: Do athletes in different sports (basketball vs. football) vary in terms of their readiness for college, based on college entrance exam scores?

Solving the Example

  1. Problem Statement: Determine if there is a significant difference in the average entrance exam scores of basketball and football players.

  2. Test Selection: Use an independent two-sample z-test.

    • The exam scores of football players do not impact the exam scores of basketball players, hence they are independent.
    • Sample sizes are greater than 30.
  3. Critical Values:

    • Given α=0.05\alpha = 0.05 in a two-tailed test, the critical values are ±1.96\pm 1.96.
  4. Formula:

    z=xˉ<em>1xˉ</em>2s<em>12n</em>1+s<em>22n</em>2z = \frac{\bar{x}<em>1 - \bar{x}</em>2}{\sqrt{\frac{s<em>1^2}{n</em>1} + \frac{s<em>2^2}{n</em>2}}}

  5. Calculations:

    • Given:

      • Basketball players: xˉ<em>1=460\bar{x}<em>1 = 460, s</em>1=92s</em>1 = 92, n1=102n_1 = 102
      • Football players: xˉ<em>2=442\bar{x}<em>2 = 442, s</em>2=57s</em>2 = 57, n2=117n_2 = 117
    • Standard Deviation of Sampling Distribution:

      922102+572117=8464102+3249117=83+27.77=10.52376\sqrt{\frac{92^2}{102} + \frac{57^2}{117}} = \sqrt{\frac{8464}{102} + \frac{3249}{117}} = \sqrt{83 + 27.77} = 10.52376

    • Z-score:

      z=46044210.52376=1810.52376=1.71z = \frac{460 - 442}{10.52376} = \frac{18}{10.52376} = 1.71

  6. Decision:

    • Since z=1.71z = 1.71 is between 1.96-1.96 and +1.96+1.96, fail to reject the null hypothesis.
  7. Conclusion:

    • There is no evidence to suggest that basketball and football players have significantly different college entrance exam scores. The observed difference is likely due to random chance.