Inference for Two Proportions: Hypothesis Testing and Confidence Intervals

Cumulative Review and Overview of Two-Sample Inference

  • One-Sample Inference Review (Chapters 7 and 8):

    • Proportions:
    • Null hypothesis format: H0:p=p0H_0: p = p_0 (where p0p_0 is a specific hypothesized value, such as p=0.10p = 0.10).
    • Alternate hypothesis format: H1:p<p0H_1: p < p_0, H1:p>p0H_1: p > p_0, or H1:p≠p0H_1: p \neq p_0.
    • Hypothesis test calculator function: 1-PropZTest under the STAT TESTS menu.
    • Confidence interval calculator function: 1-PropZInt under STAT TESTS (or STAT INTRVL).
  • Means:

    • Null hypothesis format: H0:μ=μ0H_0: \mu = \mu_0.
    • Alternate hypothesis format: H1:μ<μ0H_1: \mu < \mu_0, H1:μ>μ0H_1: \mu > \mu_0, or H1:μ≠μ0H_1: \mu \neq \mu_0.
    • Hypothesis test calculator function: T-Test.
    • Confidence interval calculator function: TInterval.
  • Study Strategy for Statistical Calculator Functions:

    • Maintain an active reference table summarizing all functions found in STAT TESTS and STAT INTRVL, recording the name of each function and its specific statistical application.
    • Mastery of these distinctions is essential for Exam 4 (covering Chapters 8 and 9) and the cumulative Final Exam.
    • Guiding proverb: "When is the best time to plant a tree? Thirty years ago. When is the next best time to plant a tree? Today."
  • Transition to Two-Sample Inference (Chapter 9):

    • Two-sample inference involves evaluating two distinct populations by drawing two independent samples to compare parameters.
    • Chapter 9.1 focuses on comparing two population proportions (p1p_1 and p2p_2).
    • Chapter 9.2 focuses on comparing two population means (μ1\mu_1 and μ2\mu_2).
    • Foundational decision rules remain constant: setting up null and alternative hypotheses, calculating test statistics, comparing the p-valuep\text{-value} against the significance level (α\alpha), and deciding whether to reject or fail to reject the null hypothesis.

Foundations of Hypothesis Testing for Two Proportions

  • Notation for Two Proportions:

    • Population 1 (Group 1):
    • p1p_1: Population proportion of successes.
    • n1n_1: Sample size.
    • x1x_1: Number of successes observed in sample 1.
    • p^1\hat{p}_1: Sample proportion calculated as p^1=x1n1\hat{p}_1 = \frac{x_1}{n_1}.
    • q^1\hat{q}_1: Sample complement proportion calculated as q^1=1−p^1\hat{q}_1 = 1 - \hat{p}_1.
    • Population 2 (Group 2):
    • p2p_2: Population proportion of successes.
    • n2n_2: Sample size.
    • x2x_2: Number of successes observed in sample 2.
    • p^2\hat{p}_2: Sample proportion calculated as p^2=x2n2\hat{p}_2 = \frac{x_2}{n_2}.
    • q^2\hat{q}_2: Sample complement proportion calculated as q^2=1−p^2\hat{q}_2 = 1 - \hat{p}_2.
    • Pooled Sample Proportion (pˉ\bar{p}):
    • Combines successes and sample sizes across both groups into a single combined sample:       pˉ=x1+x2n1+n2\bar{p} = \frac{x_1 + x_2}{n_1 + n_2}
    • The pooled complement is qˉ=1−pˉ\bar{q} = 1 - \bar{p}.
    • Serves as the weighted estimate of the common proportion under the assumption that p1=p2p_1 = p_2.
    • Computed automatically by graphing calculators and statistical software; manual computation is not required.
  • Assumptions and Requirements:

    • The sample proportions must originate from two simple random samples.
    • The two samples must be completely independent of one another. The selection of subjects in the first sample must have no relationship or pairing with subjects in the second sample (e.g., individuals are not husbands and wives, siblings, or pre/post test pairings).
    • Normal approximation requirement: Each sample must contain at least 5 successes and at least 5 failures:     n1p^1≥5n_1\hat{p}_1 \ge 5n1q^1≥5n_1\hat{q}_1 \ge 5n2p^2≥5n_2\hat{p}_2 \ge 5n2q^2≥5n_2\hat{q}_2 \ge 5
    • Alternatively stated directly using counts: x1≥5x_1 \ge 5, n1−x1≥5n_1 - x_1 \ge 5, x2≥5x_2 \ge 5, and n2−x2≥5n_2 - x_2 \ge 5.
  • Structure of Hypotheses for Two Proportions:

    • Unlike single-proportion tests where the null hypothesis tests a specific numerical percentage, tests for two proportions always test for equality:     H0:p1=p2H_0: p_1 = p_2
    • The null hypothesis posits that there is no difference between the two population proportions (p1−p2=0p_1 - p_2 = 0).
    • The alternative hypothesis depends on the directional claim being evaluated:
    • Two-tailed test: H1:p1≠p2H_1: p_1 \neq p_2
  • Left-tailed test: H1:p1<p2H_1: p_1 < p_2

  • Right-tailed test: H1:p1>p2H_1: p_1 > p_2

Mathematical Formulation and Test Statistic

  • Parameter and Sampling Distribution:

    • Parameter being tested: The difference between two population proportions, expressed as p1−p2p_1 - p_2.
    • Sampling distribution: Standard normal distribution (zz distribution).
  • Test Statistic Formula:

    • Any standardized z-scorez\text{-score} represents:     z=Observed Sample Statistic−Hypothesized ParameterStandard Errorz = \frac{\text{Observed Sample Statistic} - \text{Hypothesized Parameter}}{\text{Standard Error}}
    • For two independent proportions, the formula is:     z=(p^1−p^2)−(p1−p2)pˉqˉ(1n1+1n2)z = \frac{(\hat{p}_1 - \hat{p}_2) - (p_1 - p_2)}{\sqrt{\bar{p}\bar{q}\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}
    • Because the null hypothesis assumes p1=p2p_1 = p_2, the hypothesized difference (p1−p2)(p_1 - p_2) is identically 00.
    • The test statistic measures how many standard deviations the observed sample difference (p^1−p^2)(\hat{p}_1 - \hat{p}_2) lies away from the expected difference of zero.
  • Calculator Implementation:

    • Calculator function: 2-PropZTest (typically option 6 in the STAT TESTS menu).
    • Calculates the test statistic (zz) and the p-valuep\text{-value} automatically using pooled proportions in the standard error calculation.

Case Study: Front and Rear License Plate Compliance

  • Context and Background:

    • States vary in vehicle registration display requirements. For example, Florida requires only a single rear license plate, whereas Connecticut and New York both mandate that drivers display both a front and a rear license plate.
    • In Connecticut and New York, operating a passenger motor vehicle with only a rear license plate is illegal and subject to traffic citations.
    • The study measures the rate of non-compliance (illegal driving with rear plates only) across both commuting states.
    • A "success" is statistically defined as an event meeting the condition under study—in this scenario, a vehicle displaying a rear plate only (operating illegally).
  • Sample Data Collection:

    • Group 1 (Connecticut):
    • Total sample size: n1=2049n_1 = 2049
    • Vehicles with rear plate only (successes): x1=239x_1 = 239
    • Vehicles with front and rear plates (failures): n1−x1=2049−239=1810n_1 - x_1 = 2049 - 239 = 1810
    • Sample proportion: p^1=2392049≈0.11664\hat{p}_1 = \frac{239}{2049} \approx 0.11664 (≈11.7%\approx 11.7\% or 0.1170.117)
    • Group 2 (New York):
    • Total sample size: n2=550n_2 = 550
    • Vehicles with rear plate only (successes): x2=9x_2 = 9
    • Vehicles with front and rear plates (failures): n2−x2=550−9=541n_2 - x_2 = 550 - 9 = 541
    • Sample proportion: p^2=9550≈0.01636\hat{p}_2 = \frac{9}{550} \approx 0.01636 (≈1.6%\approx 1.6\% or 0.0160.016)
  • Homework Assignment Warning Regarding Subscript Assignment:

    • Homework problems may intentionally designate the second listed group in a table as Sample 1 and the first as Sample 2.
    • Reversing the groups produces numerical values that have the opposite algebraic sign.
    • Default exam protocol: The first population mentioned represents Group 1; the second represents Group 2.
  • Verification of Requirements:

    • Simple random sampling: Confirmed.
    • Independent samples: Confirmed; individual cars observed across states are unrelated.
    • Large sample size check (at least 5 successes and 5 failures per group):
    • Connecticut successes: x1=239≥5x_1 = 239 \ge 5
    • Connecticut failures: 1810≥51810 \ge 5
    • New York successes: x2=9≥5x_2 = 9 \ge 5
    • New York failures: 541≥5541 \ge 5
    • All criteria are fully satisfied.

Hypothesis Testing via the P-Value Method

  • Claim and Hypotheses Formulation:

    • Claim: Connecticut and New York have the same proportion of cars with rear license plates only.
    • Significance level: α=0.05\alpha = 0.05.
    • Symbolic hypotheses:     H0:p1=p2(Claim)H_0: p_1 = p_2 \quad (\text{Claim})H1:p1≠p2H_1: p_1 \neq p_2
  • Because the claim asserts equality, it resides in the null hypothesis (H0H_0).

  • The alternative hypothesis contains ≠\neq, establishing a two-tailed hypothesis test.

  • Calculator Input (2-PropZTest):

    • Access STAT →\rightarrow TESTS →\rightarrow 6: 2-PropZTest.
    • Enter variables:
    • x1=239x_1 = 239
    • n1=2049n_1 = 2049
    • x2=9x_2 = 9
    • n2=550n_2 = 550
    • Alternative hypothesis: select ≠p2\neq p_2.
    • Highlight Calculate and press ENTER.
  • Calculator Output:

    • Test statistic: z=7.11z = 7.11 (Always explicitly specify the variable name: z=7.11z = 7.11).
    • p-valuep\text{-value} reading on screen: 1.190509E-12.
  • Interpretation of Scientific Notation in P-Values:

    • The pp in p-valuep\text{-value} denotes probability, which mathematically cannot exceed 11.
    • A value of 1.1905 is an impossible probability. The exponent E-12 denotes scientific notation (1.1905×10−121.1905 \times 10^{-12}), requiring the decimal point to be shifted 12 positions to the left:     p-value≈0.0000000000011905≈0p\text{-value} \approx 0.0000000000011905 \approx 0
  • Decision and Statistical Significance:

    • Decision rule comparison:     p-value≤αp\text{-value} \le \alpha0<0.050 < 0.05
    • Decision mnemonic: "If the pp is low, the null must go."
    • Statistical decision: Reject the null hypothesis (H0H_0).
    • A test statistic of z=7.11z = 7.11 indicates that the observed sample difference is over 7 standard deviations away from the hypothesized difference of zero, making the difference highly statistically significant.
  • Formal Conclusion:

    • Because the null hypothesis is rejected and the claim was in H0H_0, the conclusion must use the "warrant rejection" structure.
    • Conclusion statement: "There is sufficient evidence to warrant rejection of the claim that Connecticut and New York have the same proportion of cars with rear license plates only."

Hypothesis Testing via the Critical Value Method

  • Execution Protocol:

    • Required whenever an assessment specifies the critical value method and demands an accompanying sketch of the distribution.
  • Distribution Setup and Critical Values:

    • Distribution: Standard normal distribution (zz distribution) centered at 00.
    • Significance level: α=0.05\alpha = 0.05 for a two-tailed test.
    • The total critical area of 0.050.05 is split evenly between the two tails:
    • Left tail area: α2=0.025\frac{\alpha}{2} = 0.025
    • Right tail area: α2=0.025\frac{\alpha}{2} = 0.025
    • Critical values from standard normal tables:     z=±1.96z = \pm 1.96
    • Left critical value: z=−1.96z = -1.96
    • Right critical value: z=1.96z = 1.96
  • Graphing and Plotting the Test Statistic:

    • Sketch a standard bell curve centered at 00.
    • Mark and shade the critical regions beyond −1.96-1.96 on the left and +1.96+1.96 on the right.
    • Plot the calculated test statistic (z=7.11z = 7.11) on the horizontal axis.
    • The test statistic z=7.11z = 7.11 lies far inside the right-hand critical (rejection) region (7.11>1.967.11 > 1.96).
  • Decision:

    • Because the test statistic falls within the critical region, the statistical decision is to reject the null hypothesis (H0H_0).
    • The critical value method and the p-valuep\text{-value} method are mathematically equivalent and will always yield identical decisions.

Confidence Interval Method for Two Proportions

  • Parameter Estimated:

    • The confidence interval for two proportions estimates the true difference between the two population parameters: p1−p2p_1 - p_2.
    • Format of the interval:     Lower Limit<p1−p2<Upper Limit\text{Lower Limit} < p_1 - p_2 < \text{Upper Limit}
  • Relationship Between Alpha and Confidence Level:

    • For a two-tailed hypothesis test, the confidence level (C-LevelC\text{-Level}) is the complement of the significance level (α\alpha):     C-Level=1−αC\text{-Level} = 1 - \alpha
    • For α=0.05\alpha = 0.05, the corresponding confidence level is 1−0.05=0.951 - 0.05 = 0.95 (95%95\%).
  • Calculator Implementation (2-PropZInt):

    • Access STAT →\rightarrow TESTS →\rightarrow B: 2-PropZInt (or look under STAT INTRVL).
    • Variables carry over from the test run:
    • x1=239x_1 = 239
    • n1=2049n_1 = 2049
    • x2=9x_2 = 9
    • n2=550n_2 = 550
    • C-Level: manually set or verify 0.95.
    • Select Calculate.
  • Confidence Interval Output:

    • Limits rounded to three decimal places:     (0.08285,0.11772)→(0.083,0.118)(0.08285, 0.11772) \rightarrow (0.083, 0.118)
    • Formally written as:     0.083<p1−p2<0.1180.083 < p_1 - p_2 < 0.118
  • Interpretation Rules for Difference Intervals (p1−p2p_1 - p_2):

    • Interval does NOT contain zero (both limits positive or both limits negative):
    • Indicates that 00 is not a plausible value for the difference between the two proportions (p1−p2≠0p_1 - p_2 \neq 0).
    • Conclusion: There IS a statistically significant difference between the two population proportions.
    • Interval DOES contain zero (lower limit is negative, upper limit is positive):
    • Indicates that a difference of zero is plausible (p1−p2=0p_1 - p_2 = 0, meaning p1=p2p_1 = p_2).
    • Conclusion: There is NOT a statistically significant difference between the two population proportions.
  • Application to Case Study:

    • The interval (0.083,0.118)(0.083, 0.118) consists entirely of positive numbers and does not cross over zero.
    • Interpretation: There is a statistically significant difference between the proportion of cars with rear license plates only in Connecticut and the proportion in New York.
    • Consistency check: This conclusion matches the decision to reject the null hypothesis reached via the p-valuep\text{-value} and critical value methods.
    • Boundary caveat: Discrepancies between hypothesis testing and confidence intervals for proportions can rarely occur when the p-valuep\text{-value} is extremely close to the threshold α\alpha (e.g., 0.0490.049 or 0.0510.051).

Interpretation of Software Output (StatDisk)

  • Key Components from StatDisk Output:
    • Test Statistic: Clearly listed as Test Statistic, z = 7.11.
    • P-Value: Displayed as p-value = 0.0000 (or 0).
    • Confidence Interval: Displayed as 95% Confidence Interval: 0.083 < p1 - p2 < 0.118.
  • Regardless of software package or calculator platform, extracting the test statistic, p-valuep\text{-value}, and confidence interval limits follows the identical analytical process.

Questions & Discussion

  • Graphing Calculator Error During Test Execution (Draw vs. Calculate):
    • Audience Query: When selecting Draw instead of Calculate in the 2-PropZTest menu, an error message appears and the graph will not display. Is this caused by missing list data in the calculator?
    • Response: While certain test functions depend on lists, the primary culprit for a Draw failure in these distribution tests is competing equations stored in the function list. Navigating to the Y= screen often reveals residual, complex functions (e.g., trigonometric or logarithmic expressions) that the calculator attempts to graph simultaneously. Clearing all expressions in Y= typically resolves the error. However, the standard recommendation is to bypass Draw entirely and use Calculate, which reliably produces the numerical output without graphical conflicts.