Two-Sample Tests of Hypothesis Study Notes Handout

Introduction to Two-Sample Hypothesis Testing

  • Conceptual Overview: In prior studies of hypothesis testing, researchers typically compared a single sample of data against a known or assumed population standard (a single numerical value). Two-sample hypothesis testing expands this concept by comparing two separate populations.
  • General Objective: The goal is to determine if a measurable and significant difference exists between the average values (μ1\mu_1 and μ2\mu_2) of two groups.
  • Methodology: Selection of two independent random samples, one from each population, to identify if differences are statistically significant or merely due to random chance.
  • Real-World Applications:     * Comparing real estate sales prices between male and female agents.     * Comparing average call counts between morning and afternoon customer service shifts.     * Determining if different supermarket checkout procedures result in different average times.

Independent Samples: Known Population Standard Deviations

  • Core Condition: This test is applied when samples are selected independently from two populations, both populations are assumed to follow a normal distribution, and the population standard deviations (σ1\sigma_1 and σ2\sigma_2) are known.
  • The Test Statistic (zz): The zz-distribution is used. The formula for the test statistic is:

z=xˉ1xˉ2σ12n1+σ22n2z = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}

Example 1: Supermarket Checkout Methods
  • Scenario: FoodTown supermarket compares "Standard" cashier-assisted checkout (SS) with "Fast Lane" self-checkout (FF). The goal is to see if the standard method takes longer.
  • Step 1: Hypotheses:     * Null Hypothesis (H0H_0): μSμF\mu_S \leq \mu_F (Standard is not slower than Fast Lane).     * Alternate Hypothesis (H1H_1): μS>μF\mu_S > \mu_F (Standard is slower than Fast Lane).
  • Step 2: Significance Level: α=0.01\alpha = 0.01.
  • Step 3: Test Statistic: zz distribution is used because distributions are assumed normal and σ\sigma is known.
  • Step 4: Decision Rule: Upper-tailed test. The critical zz value is 2.3262.326. Reject H0H_0 if z>2.326z > 2.326.
  • Step 5 & 6: Result: The computed zz value is 3.1233.123. Because 3.123>2.3263.123 > 2.326, the null hypothesis is rejected. The difference of 0.200.20 minutes is statistically significant.
  • P-value Reasoning: The p-value is the probability of obtaining a zz-value larger than 3.1233.123 when the null is true.
Example 2: Sales Associates Gender Comparison
  • Scenario: Tom Sevits (Appliance Patch) wants to know if men sell less than women on average.
  • Data:     * Men: n1=40,xˉ1=$1,400,σ1=$200n_1 = 40, \bar{x}_1 = \$1,400, \sigma_1 = \$200     * Women: n2=50,xˉ2=$1,500,σ2=$250n_2 = 50, \bar{x}_2 = \$1,500, \sigma_2 = \$250
  • Hypotheses:     * H0:μ1μ2H_0: \mu_1 \geq \mu_2     * H1:μ1<μ2H_1: \mu_1 < \mu_2 (Left-tailed test)
  • Parameters: α=0.05\alpha = 0.05. Critical z=1.645z = -1.645.
  • Decision: Computed z=2.11z = -2.11. Since 2.11<1.645-2.11 < -1.645, reject H0H_0. Women sell significantly more on average.
Example 3: E-commerce Website Sales
  • Scenario: Testing if Website A generates less daily sales than Website B.
  • Data:     * Website A: n1=45,xˉ1=$3,200,σ1=$600n_1 = 45, \bar{x}_1 = \$3,200, \sigma_1 = \$600     * Website B: n2=50,xˉ2=$3,450,σ2=$700n_2 = 50, \bar{x}_2 = \$3,450, \sigma_2 = \$700
  • Parameters: α=0.05\alpha = 0.05. Critical z=1.645z = -1.645.
  • Decision: Computed z=1.87z = -1.87. Since 1.87<1.645-1.87 < -1.645, reject H0H_0. Website B has significantly higher sales.
Example 4: Regional Sales Unit Comparison
  • Scenario: Comparing average sales (units) between two regions.
  • Data:     * Region 1: n1=50,xˉ1=200,σ12=25n_1 = 50, \bar{x}_1 = 200, \sigma_1^2 = 25     * Region 2: n2=60,xˉ2=220,σ22=30n_2 = 60, \bar{x}_2 = 220, \sigma_2^2 = 30
  • Hypotheses: H0:μ1=μ2,H1:μ1μ2H_0: \mu_1 = \mu_2, H_1: \mu_1 \neq \mu_2 (Two-tailed test).
  • Parameters: α=0.05\alpha = 0.05. Critical z=±1.96z = \pm 1.96.
  • Decision: Computed z=20z = 20 (absolute value). Since 20>1.96|20| > 1.96, reject H0H_0. There is a significant difference.

Independent Samples: Unknown Population Standard Deviations (Equal Variances)

  • Core Condition: Population standard deviations are unknown, but it is assumed that σ1=σ2\sigma_1 = \sigma_2. In this scenario, we use the tt distribution and a "pooled" estimate of the variance.
  • Pooled Sample Variance (sp2s_p^2): A weighted mean of the two sample standard deviations, where weights are the degrees of freedom provided by each sample.
Requirements and Assumptions
  1. Sampled populations are approximately normally distributed.
  2. Sampled populations are independent.
  3. Standard deviations of the two populations are equal (σ1=σ2\sigma_1 = \sigma_2).
Pooled Test Formulas
  • Degrees of Freedom: df=n1+n22df = n_1 + n_2 - 2
  • Pooled Variance Equation:

sp2=(n11)s12+(n21)s22n1+n22s_p^2 = \frac{(n_1 - 1)s_1^2 + (n_2 - 1)s_2^2}{n_1 + n_2 - 2}

  • Test Statistic (tt):

t=xˉ1xˉ2sp2(1n1+1n2)t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{s_p^2 (\frac{1}{n_1} + \frac{1}{n_2})}}

Example 5: Owens Lawn Care Mounting Procedures
  • Scenario: Comparing Welles method (W) vs. Atkins method (A) for engine mounting speed.
  • Data:     * Method W: nW=5,xˉW=4,sW=2.9n_W = 5, \bar{x}_W = 4, s_W = 2.9     * Method A: nA=6,xˉA=5,sA=2.1n_A = 6, \bar{x}_A = 5, s_A = 2.1
  • Hypotheses: H0:μW=μA,H1:μWμAH_0: \mu_W = \mu_A, H_1: \mu_W \neq \mu_A (Two-tailed).
  • Parameters: α=0.10,df=5+62=9\alpha = 0.10, df = 5 + 6 - 2 = 9. Critical t=±1.833t = \pm 1.833.
  • Decision: The computed value of tt falls between 1.833-1.833 and 1.8331.833. Fail to reject H0H_0. No significant difference in assembly times detected.

Independent Samples: Unknown Population Standard Deviations (Unequal Variances)

  • Core Condition: Standard deviations are unknown and it is not reasonable to assume they are equal (σ1σ2\sigma_1 \neq \sigma_2).
  • Methodology Changes: Use separate sample standard deviations (s1,s2s_1, s_2) and adjust degrees of freedom downward using a complex approximation formula.
  • Effect of Adjustment: Reducing degrees of freedom makes it more difficult to reject the null hypothesis (requires a larger test statistic).
Test Statistic Formula

t=xˉ1xˉ2s12n1+s22n2t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}

Degrees of Freedom Formula (Satterthwaite Approximation)

df=[(s12n1)+(s22n2)]2(s12n1)2n11+(s22n2)2n21df = \frac{[(\frac{s_1^2}{n_1}) + (\frac{s_2^2}{n_2})]^2}{\frac{(\frac{s_1^2}{n_1})^2}{n_1 - 1} + \frac{(\frac{s_2^2}{n_2})^2}{n_2 - 1}}

  • Note: If the result for dfdf is a fraction, it is always rounded down to the nearest integer.
Example 6: Paper Towel Absorbency
  • Data: Store Brand (n1=9,s1=3.321n_1=9, s_1=3.321), Name Brand (n2=12,s2=1.621n_2=12, s_2=1.621).
  • Significance: α=0.10\alpha = 0.10. Assumption: Unequal variances.
  • Degrees of Freedom Calculation: Rounded down to 1010. Critical t=±1.812t = \pm 1.812.
Example 7: Help Line Resolution Time
  • Scenario: testing if software issues (11) take longer than hardware issues (22).
  • Data:     * Software: n1=18,xˉ1=18,s1=4.2n_1 = 18, \bar{x}_1 = 18, s_1 = 4.2     * Hardware: n2=12,xˉ2=15.5,s2=3.9n_2 = 12, \bar{x}_2 = 15.5, s_2 = 3.9
  • Hypotheses: H0:μ1μ2,Ha:μ1>μ2H_0: \mu_1 \leq \mu_2, H_a: \mu_1 > \mu_2
  • Calculations: α=0.05,df=24.924\alpha = 0.05, df = 24.9 \rightarrow 24. Critical t=1.711t = 1.711.
  • Decision: Computed t=1.67t = 1.67. Since 1.67<1.7111.67 < 1.711, fail to reject H0H_0. Data does not prove software issues take longer.

Hypothesis Testing for Dependent Samples (Paired Observations)

  • Core Condition: Samples are not independent; they are related or matched. This is often termed a "paired sample."
  • Mechanism: Instead of comparing two group means directly, we analyze the distribution of the differences (dd) between each pair of observations. This reduces the problem to a one-sample test of the differences.
  • Notation: μd\mu_d represents the population mean of the distribution of differences.
  • Assumption: The distribution of population differences is approximately normal.
Test Statistic for Paired Samples

t=dˉsd/nt = \frac{\bar{d}}{s_d / \sqrt{n}}

  • Variables:     * nn: The number of paired observations.     * dfdf: n1n - 1.     * dˉ\bar{d}: The mean of the differences between paired observations.     * sds_d: The standard deviation of the differences.
Example 8: Real Estate Appraisal Consistency
  • Scenario: Nickel Savings and Loan uses two firms (Schadek and Bowyer) to appraise the same 1010 homes to check for consistency.
  • Data: n=10,dˉ=4.6,sd=4.402n = 10, \bar{d} = 4.6, s_d = 4.402.
  • Hypotheses: H0:μd=0,H1:μd0H_0: \mu_d = 0, H_1: \mu_d \neq 0 (Two-tailed).
  • Parameters: α=0.05,df=9\alpha = 0.05, df = 9. Critical t=±2.262t = \pm 2.262.
  • Result: Computed t=4.64.402/103.30t = \frac{4.6}{4.402 / \sqrt{10}} \approx 3.30. Since 3.30>2.2623.30 > 2.262, the null hypothesis is rejected. There is a significant difference between the two appraisal firms.

Practice Scenarios: Independent vs. Dependent Samples

  1. Before and After Software: Measuring productivity scores for the same employees before and after a change. (Dependent / Paired).
  2. Two Separate Schools: Comparing test scores of two unique groups of students from School A and School B. (Independent).
  3. Diet Plan Weight Loss: Measuring weight of the same participants before and after a 3-month diet. (Dependent / Paired).
  4. Two Fertilizers: Measuring yields from two separate groups of plants. (Independent).
  5. Therapy Anxiety Levels: Measuring anxiety for the same group of patients before and after therapy. (Dependent / Paired).
  6. New Technology Productivity: Comparing two different groups of employees after technology implementation. (Independent).

Multiple Choice Concept Check

  • Null Hypothesis in Two-Sample Mean Test: Generally H0:μ1=μ2H_0: \mu_1 = \mu_2.
  • Use of t-distribution: Used when the population variance (or standard deviation) is unknown.
  • Variance Assumption Importance: Knowing if variances are equal determines the choice of the test statistic (pooled vs. separate) and the calculation of degrees of freedom.

Formula Sheet Summary Reference

  • Independent known σ\sigma: z=xˉ1xˉ2σ12n1+σ22n2z = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}
  • Independent unknown σ\sigma (Equal): t=xˉ1xˉ2sp2(1n1+1n2)t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{s_p^2 (\frac{1}{n_1} + \frac{1}{n_2})}}; df=n1+n22df = n_1 + n_2 - 2.
  • Independent unknown σ\sigma (Unequal): t=xˉ1xˉ2s12n1+s22n2t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}; dfdf uses Satterthwaite approximation.
  • Dependent (Paired): t=dˉsd/nt = \frac{\bar{d}}{s_d / \sqrt{n}}; df=n1df = n - 1.