Lecture 26 - Inference for Means: Comparing Independent Populations and Excel Procedures

Administrative Reminders and Excel Assignment Overview

  • Assignment Deadlines: Today, May 22, is the final day for students to finalize details regarding their Excel assignments. Students must either see the instructor in person or send an email regarding the peer component they wish to undertake.

  • Question 1: Regression Analysis: This topic has not been covered yet. It will be addressed next week, after which students can attempt this portion of the assignment.

  • Question 2: Sampling Distributions and the Central Limit Theorem: This topic was covered multiple weeks ago, including a live class demonstration. Students should be fully prepared to handle this question using Excel.

  • Question 3: Polling Data and Proportions:

    • Methodology Critique: The first part requires a critique of data collection methods, identifying population of interest and sampling frames.

    • Coverage Error: A specific type of error occurring when a sampling frame (the list of all units that can be sampled) does not clearly reflect the population as a whole. It results from a poor sampling frame lacking complete coverage.

    • Hypothesis Testing for Proportions: Students must evaluate if it is plausible that a candidate (e.g., Donald Trump) will receive more than 50% of the vote using a one-sided hypothesis test in Excel. Correct null (H0H_0) and alternative (HaH_a) hypotheses must be stated.

    • Confidence Intervals: Students must calculate a 95% confidence interval based on a claim that a candidate might receive as low as 40% of the vote.

    • Chi-Square Test: Question 3d involves using a pivot table for a two-by-two contingency table and a chi-square test, which has not yet been taught.

  • Question 4: Experimental Data with Means:

    • Experimental Design: Students must distinguish between a randomized experiment and an observational study, focusing on concepts like random assignment.

    • Flow Diagrams: Requirement to layout a completely randomized design or a block design.

    • Placebos: Understanding the role of a standard feed group acting as a placebo.

    • t-tests: Includes a one-sample t-test (comparing a mean to a fixed value like 4kg4\,kg) and a two-sample t-test (comparing two different means).

    • ANOVA (Analysis of Variance): Used for comparing more than two populations; scheduled for next week.

Fundamental Principles of Statistical Inference

  • The Inference Framework:

    • Population Parameters: Fixed and unknown values we wish to estimate (e.g., population mean μ\mu or population proportion π\pi).

    • Sample Statistics: Calculated values from a representative sample used to make inferences about parameters (e.g., sample mean xˉ\bar{x} or sample proportion pp).

  • Types of Procedures:

    • Hypothesis Tests: Checking the plausibility of a specific hypothesized value (e.g., testing if the average New Zealand wage is precisely $60,000\$60,000).

    • Confidence Intervals: Providing a range of plausible values (e.g., stating the average wage is between $55,000\$55,000 and $70,000\$70,000).

Estimation with Two Independent Populations

  • Conceptual Shift: Moving from a single population (e.g., average wages of New Zealanders) to comparing two independent populations (e.g., average wages of New Zealanders vs. Australians).

  • Definition of Independence: Two separate populations where the observations in one do not influence the observations in the other.

  • Examples of Comparative Studies:

    • Average lengths of black rats vs. brown rats.

    • VCS graduates vs. BMS (Bachelor of Management Studies) graduates.

    • Service time for manual customer service vs. self-service machines or AI.

    • Weight gain across different experimental groups (e.g., the chicken feed study).

  • The Parameter of Interest: The difference between two population means, expressed mathematically as μ1μ2\mu_1 - μ_2.

  • The Statistic of Interest: The difference between the two sample means, expressed as xˉ1xˉ2\bar{x}_1 - \bar{x}_2.

  • The Visualization Model:

    • Population 1: Parameters include μ1\mu_1, σ1\sigma_1, and size N1N_1.

    • Population 2: Parameters include μ2\mu_2, σ2\sigma_2, and size N2N_2.

    • Samples: A sample is taken from each, producing xˉ1\bar{x}_1, s1s_1, n1n_1 and xˉ2\bar{x}_2, s2s_2, n2n_2.

Hypothesis Testing Procedure for Two Means

  • Step 1: Construct Hypothesis Statements:

    • Null Hypothesis (H0H_0): μ1μ2=0\mu_1 - μ_2 = 0. This states there is no difference between the two population means (μ1=μ2\mu_1 = μ_2).

    • Alternative Hypothesis (HaH_a): μ1μ20\mu_1 - μ_2 \neq 0. This states that a difference exists (two-sided test).

  • Step 2: Collect Data and Compute Test Statistic:

    • The test statistic (t0t_0) follows the structure: observedhypothesized/standard error\text{observed} - \text{hypothesized} / \text{standard error}.

    • The formula is: t0=(xˉ1xˉ2)0s12n1+s22n2t_0 = \frac{(\bar{x}_1 - \bar{x}_2) - 0}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}.

    • Note: The "- 0" represents the hypothesized difference from H0H_0.

  • Step 3: Degrees of Freedom (dfdf):

    • Simplified estimation: df=min(n11,n21)df = \min(n_1 - 1, n_2 - 1).

    • Advanced computation: Welch’s Theorem/Approximation is used by computers (like Excel) for a more precise degree of freedom calculation.

  • Step 4: Find the p-value:

    • Calculated using Excel or t-distribution tables.

    • For a two-sided test, the p-value represents the probability of observing a difference as large as the one found (in either direction) if the null hypothesis is true.

  • Step 5: Make a Decision:

    • If p-value < α\alpha (level of significance, usually 0.050.05), reject H0H_0.

    • If p-value > α\alpha, fail to reject H0H_0.

  • Step 6: Contextualize: Interpret the results in terms of the specific study (e.g., "There is a significant difference in wages between countries").

Case Study: Diet Weight Loss Analysis

  • Scenario: A dietitian compares a "New Diet" (low fat/carb) against a "Current Diet."

  • Setup: Randomized experiment with n1=100n_1 = 100 (New) and n2=100n_2 = 100 (Current). Weight loss recorded over three weeks.

  • Data Analysis:

    • xˉ1=9.31kg\bar{x}_1 = 9.31\,kg (New Diet)

    • xˉ2=7.40kg\bar{x}_2 = 7.40\,kg (Current Diet)

    • H0:μnewμcurrent=0H_0: μ_{\text{new}} - μ_{\text{current}} = 0

    • Ha:μnewμcurrent0H_a: μ_{\text{new}} - μ_{\text{current}} \neq 0

  • Calculations:

    • Test Statistic (t0t_0): 3.093.09

    • Interpretation: The observed difference is 3.093.09 standard errors away from the hypothesized difference of zero.

    • Degrees of Freedom: min(99,99)=99\min(99, 99) = 99.

    • p-value: Determined to be between 0.010.01 and 0.0020.002 via tables; Excel calculation gives precise p-value of 0.00230.0023.

  • Result: Since 0.0023<0.050.0023 < 0.05, we reject the null hypothesis. There is statistically significant evidence of a difference in weight loss between the two diets in the population.

Excel Implementation: Data Analysis Toolpack

  • Path: Data > Data Analysis > t-Test: Two-Sample Assuming Unequal Variances.

  • Inputs:

    • Variable 1 Range: Column for Diet 1 (e.g., A1:A101A1:A101).

    • Variable 2 Range: Column for Diet 2 (e.g., B1:B101B1:B101).

    • Hypothesized Mean Difference: 00.

    • Labels: Check if row 1 contains headers.

    • Alpha: 0.050.05.

  • Output Terms:

    • Variance: Square of the standard deviation (s2s^2).

    • t Stat: The calculated test statistic (t0t_0).

    • P(T <= t) one-tail: p-value for a one-sided test.

    • P(T <= t) two-tail: p-value for a two-sided test.

Confidence Intervals for the Difference Between Two Means

  • Purpose: To determine the magnitude and range of plausible values for the difference μ1μ2\mu_1 - μ_2, rather than just testing for zero.

  • Formula: (xˉ1xˉ2)±t×s12n1+s22n2(\bar{x}_1 - \bar{x}_2) \pm t \times \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}.

  • Components:

    • Sample Estimate: xˉ1xˉ2\bar{x}_1 - \bar{x}_2.

    • Multiplier (tt): Found using t-tables at the intersection of confidence level and degrees of freedom.

    • Margin of Error (MEME): Multiplier ×\times Standard Error.

  • Diet Example Interval Results:

    • Lower Limit: 0.68470.6847

    • Upper Limit: 3.13533.1353

    • Interpretation: We are 95% confident that the difference in average weight loss between Diet 1 and Diet 2 in the population is between 0.6847kg0.6847\,kg and 3.1353kg3.1353\,kg.

Comparison of Sampling Designs

  • Independent Samples: Two distinct populations (e.g., Group A vs. Group B).

  • Dependent (Paired) Samples: Two observations from the same population units (e.g., weight measured "Before" and "After" for the same group of people). This requires a different statistical procedure.

  • Multiple Populations: When comparing more than two groups (e.g., 3, 10, or 100 different feed types), ANOVA is used.