Stat 211: Elementary Inferential Statistics - Unit 7: Two-Sample Inference

Stat 211: Elementary Inferential Statistics - Unit 7: Two-Sample Inference

Difference Between Two Sample Means

  • Introduction: Until now, we focused on analyzing a single population to estimate its mean or proportion, or to test claims about one average or percentage.

    • In real life, we often compare different groups to determine if there is a meaningful difference between them, for example:

    • Is Drug A more effective than Drug B?

    • Do students in online classes perform as well as those in in-person classes?

    • Do action movies earn less at the box office than dramas?

    • Are people willing to pay more for used furniture from a friend than from a stranger?

    • These situations focus on the difference between two means.

  • Shift to Two Independent Samples (TIS): We will analyze two independent samples to make inferences about how their populations compare.

Notation
  • For Populations:

    • Population Mean: μμ

  • For Samples:

    • Sample Mean: xx

    • Difference Between Means: x<em>1−x</em>2x<em>1 - x</em>2

Statistics of Interest
  • How far apart two means are is more important than each mean on its own.

  • • Difference Between Means Notation:

    • Sample Statistics: x2x_2

    • Standard Deviation of Differences: SD(x<em>1−x</em>2)=extsqrt(racVar<em>1n</em>1+racVar<em>2n</em>2)SD(x<em>1 - x</em>2) = ext{sqrt} \bigg( rac{Var<em>1}{n</em>1} + rac{Var<em>2}{n</em>2} \bigg) where Var<em>1Var<em>1 and Var</em>2Var</em>2 are the variances of the two samples, and n<em>1n<em>1 and n</em>2n</em>2 are the sample sizes.

    • Standard Error: SE(x<em>1−x</em>2)=extsqrt(racSD<em>12n</em>1+racSD<em>22n</em>2)SE(x<em>1 - x</em>2) = ext{sqrt} \bigg( rac{SD<em>1^2}{n</em>1} + rac{SD<em>2^2}{n</em>2} \bigg)

The Sampling Distribution

  • Distribution: The sampling distribution for the difference between two means is a t-distribution.

    • Characteristics:

    • Centered at the true difference between the population means: μ<em>1−μ</em>2μ<em>1 - μ</em>2.

    • Spread estimated using the standard error: SESE.

  • Confidence Interval for TIS:

    • Formula: extPointEstimateext±CriticalValueimesextStandardErrorext{Point Estimate} ext{± Critical Value} imes ext{Standard Error}

    • Calculation: x<em>1−x</em>2ext±t<em>dfimesSE(x</em>1−x2)x<em>1 - x</em>2 ext{±} t<em>{df} imes SE(x</em>1 - x_2)

    • Degrees of Freedom:

    • Complications arise in calculating df.

    • Exact formula: complex weighted average (Welch-Satterthwaite equation):
      df=rac(Var<em>1/n</em>1+Var<em>2/n</em>2)2rac(Var<em>1/n</em>1)2n<em>1−1+rac(Var</em>2/n<em>2)2n</em>2−1df = rac{(Var<em>1/n</em>1 + Var<em>2/n</em>2)^2}{ rac{(Var<em>1/n</em>1)^2}{n<em>1 - 1} + rac{(Var</em>2/n<em>2)^2}{n</em>2 - 1}}

    • Simplified: df=extmin(n<em>1−1,n</em>2−1)df = ext{min}(n<em>1 - 1, n</em>2 - 1)

    • A calculator will yield more accurate df automatically.

Example: Pay Gap

  • Background: According to the Bureau of Labor Statistics, earnings for men and women performing similar jobs are analyzed:

    • Sample statistics: 65,070 men averaged a weekly income of 1,3071,307 (SD = 1,2551,255), while 66,285 women averaged a weekly income of 1,0961,096 (SD = 1,0131,013).

  • Calculations:

    • Statistic: Difference = x<em>1−x</em>2=1,307−1,096x<em>1 - x</em>2 = 1,307 - 1,096

    • Standard Error: To be calculated using SD(x<em>1−x</em>2)SD(x<em>1 - x</em>2) formula.

    • 95% Critical Value: To be calculated from the t-distribution table based on degrees of freedom.

    • Confidence Interval: Showed to be between specific bounds derived from calculations.

  • Interpretation: We are 95% confident that the true difference in mean weekly earnings between men and women is within the calculated range, indicating that men earn more on average.

Confidence Intervals: Difference Between Means

  • Using course website tools and confidence interval calculator for practical computations:

    • Website URL: https://sites.google.com/mix.wvu.edu/wvustat211

  • Calculator Functions: Select statistic of interest, enter sample statistics, use degrees of freedom methods, and calculate confidence levels.

Two-Sample Hypothesis Testing

  1. Identify the population parameter being tested (e.g., Difference Between Means: μ<em>1−μ</em>2μ<em>1 - μ</em>2).

  2. State Hypotheses:

    • Null Hypothesis (H0): μ<em>1−μ</em>2=0μ<em>1 - μ</em>2 = 0 (no difference)

    • Alternative Hypothesis (H1): μ<em>1−μ</em>2<br>eq0μ<em>1 - μ</em>2 <br>eq 0 (there is a difference)

  3. Check Assumptions:

    • Random sampling from two populations

    • Samples must be independent

    • Sample size large enough (n>30n > 30) or populations are approximately normal.

  4. Compute p-value and test statistic using t-distribution methods, which are complicated due to degrees of freedom considerations.

  5. Decision Making:

    • If p−valueext≤αp-value ext{≤} α, reject H0; otherwise, fail to reject H0.

  6. Conclude the result based on the hypothesis test.

Example: Used Furniture Scenario
  • Study focus: Evaluating average offers on used furniture based on buyer familiarity (friend vs stranger).

    • Offers collected through a social experiment posted on Facebook Marketplace.

    • Sample data:

      • Friend: 275275, 280280, 290290, etc.

      • Stranger: 200200, 235235, 190190, etc.

  • Statistical Steps:

    • State hypotheses, check randomness, compute test statistic, evaluate p-value, and conclude are essential parts.

    • It concluded that friends offer statistically significantly higher amounts.

Example: Mummy's Curse & Surgery Example
  • Mummy’s Curse: Comparing lifespans of those exposed and those unexposed to the tomb led to comparative statistics on average lifespan.

  • Surgery Treatment Comparison: Measured recovery times in different treatment groups to analyze effectiveness through hypothesis testing.

Paired Differences

  • Scenario: Collecting two measurements from matched or same subjects.

  • Estimation: The data is analyzed through focusing on differences rather than treating them as two independent samples.

    • Examples of paired data analyses include treatment levels, twins' IQs, and more.

  • Sampling Distribution: Mean differences centered around true mean difference and estimated using standard error.

Confidence Intervals for Paired Differences

  • Formula: Point Estimate ± Critical Value × Standard Error for paired differences.

    • Careful consideration of order in subtraction affects interpretation of results.

Hypothesis Testing for Paired Differences

  • Follow similar hypothesis testing steps with matched data.

  • Test Statistics and p-values calculated specifically for paired differences.

Difference Between Proportions

  • Explaining how to assess traits between two groups, stated as one group being more or less likely; characterized with statistical representations similar to two means.

    • Example scenarios include voting behavior between genders and treatment effectiveness comparisons.

Conclusion & Additional Examples

  • Various examples highlight hypothesis testing through practical applications (e.g., internship completion rates across majors, vaccine efficacy, etc.).

  • Hypothesis Testing Summary: A structured approach emphasizing the identification of parameters, stating hypotheses, checking assumptions, calculating statistics, making decisions based on p-values, and concluding results effectively.

  • Hypothesis Testing Cheat Sheet: Summary of test types, population parameters, sample statistics, null hypotheses, standard errors, test statistics with degrees of freedom, and assumptions necessary for valid testing across various contexts.