Hypothesis Testing for Univariate Categorical Data

Statistical Inference for Univariate Categorical Data

  • A binary categorical variable is modeled using a Bernoulli distribution (Y∼Bern(π)Y \sim \text{Bern}(\pi)), where the parameter π\pi represents the true population proportion.
  • The sample proportion (p^\hat{p}) acts as the point estimate for the unknown population parameter π\pi.
  • Law of Large Numbers: As the sample size (nn) increases, the probability that p^\hat{p} converges closer to π\pi increases.

Law of Large Numbers demonstrating convergence of observed proportion of coin tosses to the expected proportion as the number of tosses increases

One-Sample Z-Test for Proportions

  • Step 1: Formulate Hypotheses
    • Null hypothesis: H0:π0=0.5H_0: \pi_0 = 0.5
    • Alternative hypothesis: Ha:π0≠0.5H_a: \pi_0 \neq 0.5
    • The subscript 00 denotes the specific hypothesized value under the null hypothesis.
  • Step 2: Calculate the Test Statistic
    • The standardized test statistic measures how many standard errors the sample proportion (p^\hat{p}) deviates from the hypothesized value (π0\pi_0):     z=p^−π0SE(p^)z = \frac{\hat{p} - \pi_0}{\text{SE}(\hat{p})}
    • Under the null hypothesis and large-sample conditions, zz follows a standard normal sampling distribution with a center of 00 and a standard deviation of 11.
  • Step 3: Determine the p-value
    • The two-sided p-value computes the probability of observing a result at least as extreme as the calculated statistic:     Prob(∣Z∣>∣z∣)=Prob(Z>∣p^−π0SE(p^)∣)+Prob(Z<−∣p^−π0SE(p^)∣)\text{Prob}(|Z| > |z|) = \text{Prob}\left(Z > \left|\frac{\hat{p} - \pi_0}{\text{SE}(\hat{p})}\right|\right) + \text{Prob}\left(Z < -\left|\frac{\hat{p} - \pi_0}{\text{SE}(\hat{p})}\right|\right)
  • Step 4: Draw Conclusions
    • Compare the p-value to the significance threshold (e.g., α=0.05\alpha = 0.05).
    • When the p-value is smaller than α\alpha, the sample data is inconsistent with the null hypothesis, leading to a rejection of H0H_0.

Technical Conditions and Considerations

  • Sample Size Rule of Thumb: The sampling distribution of zz is approximately normal only when the sample contains at least 10 "yes's" and at least 10 "no's".
  • When sample counts are too small, the sampling distribution becomes skewed, invalidating standard normal probability calculations.

Skewed sampling distributions resulting from an insufficient number of successes or failures

  • Violation of Assumptions: If the data cannot be modeled as Bernoulli trials or the minimum sample size criteria fail, standard normal critical values cannot be assumed; more data must be collected or an alternative statistical method used.
  • Statistical vs. Practical Significance: A statistically significant test result (e.g., rejecting H0H_0) demonstrates that an observed difference is unlikely due to random chance, but does not inherently guarantee that the magnitude of the difference (such as p^−π0=0.1415201\hat{p} - \pi_0 = 0.1415201) is practically significant.