Biostatistics Study NotesFrom concepts and derivations to interpretation

CHAPTER 05 · TOPIC 01

Binomial Tests

Test one population proportion or compare two independent proportions using normal approximations, confidence intervals, and exact methods.

On this page
  1. From number of successes to sample proportion
  2. Hypotheses for One Population Proportion
  3. Confidence interval for one proportion
  4. Connection to a Test for a Mean
  5. Two Independent Proportions
  6. Estimate standard error from sample
  7. Test that two proportions are equal
  8. Confidence interval for the difference between two proportions
  9. Normal approximation and exact method
  10. Testing Procedure

A binomial test estimates the population proportion of a binary outcome. For one sample, the sample proportion p̂ is compared to the specified value π₀, and for two independent samples, p̂₁−p̂₂ is compared. We use the normal approximation Z test for large samples and the exact binomial method for small samples or rare events.

From number of successes to sample proportion#

If X~Binomial(n,π), then the sample proportion p̂=X/n. The mean and variance can be found using the law of linear transformation.

sample proportionp^=Xn\hat p=\frac{X}{n}
Expected valueE(p^)=πE(\hat p)=\pi
varianceVar(p^)=π(1π)n\operatorname{Var}(\hat p)=\frac{\pi(1-\pi)}{n}
standard errorSE(p^)=π(1π)n\operatorname{SE}(\hat p)=\sqrt{\frac{\pi(1-\pi)}{n}}

Hypotheses for One Population Proportion#

both sidesH0:π=π0,H1:ππ0H_0:\pi=\pi_0,\qquad H_1:\pi\ne\pi_0
right sideH0:ππ0,H1:π>π0H_0:\pi\leq\pi_0,\qquad H_1:\pi>\pi_0
leftH0:ππ0,H1:π<π0H_0:\pi\geq\pi_0,\qquad H_1:\pi<\pi_0
1 ratio Z statisticZ=p^π0π0(1π0)/nZ=\frac{\hat p-\pi_0}{\sqrt{\pi_0(1-\pi_0)/n}}

The denominator of the test is π₀ specified by H₀. This is to measure how much it fluctuates under H₀.

Confidence interval for one proportion#

p^±z1α/2p^(1p^)n\hat p\pm z_{1-\alpha/2}\sqrt{\frac{\hat p(1-\hat p)}{n}}

Connection to a Test for a Mean#

subjectestimatorStandard error under H₀Z
population mean μσ/√n(X̄−μ₀)/(σ/√n)
population ratio π√[π₀(1−π₀)/n](p̂−π₀)/SE₀

Two Independent Proportions#

ratio differenceD=p^1p^2D=\hat p_1-\hat p_2
varianceVar(D)=π1(1π1)n1+π2(1π2)n2\operatorname{Var}(D)=\frac{\pi_1(1-\pi_1)}{n_1}+\frac{\pi_2(1-\pi_2)}{n_2}

Estimate standard error from sample#

SE^(p^1p^2)=p^1(1p^1)n1+p^2(1p^2)n2\widehat{\operatorname{SE}}(\hat p_1-\hat p_2)=\sqrt{\frac{\hat p_1(1-\hat p_1)}{n_1}+\frac{\hat p_2(1-\hat p_2)}{n_2}}

Test that two proportions are equal#

For H₀:π₁=π₂, we assume a common proportion, and calculate the standard error under H₀ using the pooled proportion that combines the number of successes in the two groups.

Merger ratiop^=x1+x2n1+n2\hat p=\frac{x_1+x_2}{n_1+n_2}
Standard error under H₀SE0=p^(1p^)(1n1+1n2)\operatorname{SE}_0=\sqrt{\hat p(1-\hat p)\left(\frac1{n_1}+\frac1{n_2}\right)}
two-proportion Z statisticZ=p^1p^2SE0Z=\frac{\hat p_1-\hat p_2}{\operatorname{SE}_0}

Confidence interval for the difference between two proportions#

(p^1p^2)±z1α/2p^1(1p^1)n1+p^2(1p^2)n2(\hat p_1-\hat p_2)\pm z_{1-\alpha/2}\sqrt{\frac{\hat p_1(1-\hat p_1)}{n_1}+\frac{\hat p_2(1-\hat p_2)}{n_2}}

The confidence interval does not force a common proportion of H₀, but instead estimates the standard error on the proportions of each group.

Normal approximation and exact method#

In normal approximation, check whether the expected number of successes and expected number of failures are sufficiently large. For small samples, extreme proportions, or rare events, consider the exact binomial test or the Fisher exact test for 2x2 tables.

Testing Procedure#

  1. Confirm independence, binary outcomes, and study design
  2. Preset H₀, H₁, direction, and α
  3. Calculate the number of successes, sample size, and proportion for each group
  4. Check the approximation conditions and select Z or exact method
  5. Report p-values ​​and confidence intervals along with effect sizes