Statistical Reasoning Lecture 10

Introduction to Hypothesis Testing

  • Overview: The lecture discusses hypothesis testing in the context of comparing proportions and incidence rates between two populations, focusing on methods such as the two-sample z-test, chi-square test, and Fisher's exact test.

Learning Objectives

  • Upon completion, students will be able to:

    • Estimate and interpret p-values when comparing proportions with the two-sample z-test.

    • Explain the relationship between risk difference (RD), relative risk (RR), and odds ratio (OR), emphasizing why only one p-value is necessary despite the multiple measures of association.

Two-Sample z-Test for Comparing Proportions

Concept

  • The two-sample z-test is similar to the t-test for comparing means but is specifically for proportions. Its methodology includes:

    • Setting up null () and alternative hypotheses.

    • Assuming the null hypothesis is true to compute how far the observed sample estimate diverges from expectations under the null hypothesis.

    • Translating this distance into a p-value for decision-making.

Example: Treatment Response to ART in HIV+ Individuals

Data Summary
  • A study conducted on 1,000 HIV-positive patients:

    • CD4 < 250: 127 out of 503 (25% response)

    • CD4 ≥ 250: 79 out of 497 (16% response)

    • Overall response: 206 out of 1,000.

Measures of Association
  • Risk difference (RD): 0.09 (95% CI: 0.04, 0.14)

  • Relative risk (RR): 1.56 (95% CI: 1.20, 2.01)

  • Odds ratio (OR): 1.75 (95% CI: 1.27, 2.41)

Hypothesis Setup
  • Competing hypotheses:

    • Null: H0: pC<250 = pC≥250

    • Alternative: HA: pC<250 ≠ p_C≥250

p-value Calculation
  1. Compute the standardized distance:

    • z = rac{(p̂C<250 - p̂C≥250) - 0}{SE(p̂C<250 - p̂_C≥250)}

    • Here, SE(p̂C<250 - p̂C≥250) = ext{sqrt}igg( rac{p̂C<250(1-p̂C<250)}{nC<250} + rac{p̂C≥250(1-p̂C≥250)}{n_C≥250}igg)

  2. The resulting z-value was approximately 3.6, suggesting a significant difference in response rates (above the null of 0).

  3. p-value results:

    • Calculate: p=2<em>(1pnorm(3.6))extor2</em>pnorm(3.6)p = 2<em>(1 - pnorm(3.6)) ext{ or } 2</em>pnorm(-3.6)

    • Result: p-value < 0.001, indicating strong evidence against the null hypothesis.

Chi-Square Test for Comparing Proportions

  • The chi-square test yields similar results to the two-sample z-test for comparing proportions.

  • General procedure:

    • Setup null and alternative hypotheses, assume null is true, calculate the distance from observed to expected frequencies, convert this distance into a p-value.

Example: Treatment Response in HIV+ Individuals

Competing Hypotheses (Chi-Square)
  • H0: pC<250 = pC≥250

  • HA: pC<250 ≠ p_C≥250

Expected Frequencies Calculation
  • Under the null hypothesis:

    • Calculate expected counts for each outcome based on observed proportions.

  • Apply the chi-square statistic formula:

    • χ2=rac(O<em>iE</em>i)2Eiχ^2 = rac{(O<em>i - E</em>i)^2}{E_i}

Results and Interpretation

  • Resulting p-value from the chi-square test was approximately identical to that from the z-test, underscoring the tests' equivalence.

Fisher’s Exact Test

  • Fisher's exact test is utilized for small sample sizes and provides an exact p-value when comparing two groups.

  • Comparisons suggest the test's application in scenarios where either group is less than 5 in frequency.

  • Illustrative example:

    • Using treatment response from the same HIV study:

    • p-values derived from Fisher’s Exact Test were consistent with results from z-test and chi-square approach, reaffirming the findings across methods.

Conclusion on p-values and Hypothesis Testing

  • Similar logic applies across various tests. The p-value signifies the probability of observing data as extreme as the sample under the null hypothesis.

  • In practice, researchers generally use rejection levels at 0.05 and test norms with 95% confidence intervals. Different tests may yield slightly divergent p-values, yet they interpret identically in the context of studies comparing binary outcomes.