Subsection 17.4 Choice of Procedures for Comparing Two Proportions
| Study design | Two binary variables, but not case-control study | Two binary variables, but not case-control study | Two binary variables |
|---|---|---|---|
| Parameter | Difference in population proportions (\(\pi_1 - \pi_2\)) | Relative Risk (\(\pi_1/\pi_2\)) | Odds Ratio (\(\tau\)) |
| Null Hypothesis | \(H_0\!:\) \(\pi_1 - \pi_2 = 0\) | \(H_0\!:\) \(\pi_1/\pi_2 = 1\) | \(H_0\!:\) \(\tau = 1\) |
| Simulation | Independent random sampling from binomial processes; Random assignment with hypergeometric distribution |
||
| Exact p-value | Fisher’s Exact Test | ||
| Can use \(z\) procedures if | At least 5 successes and 5 failures in each group | ||
| Confidence interval | \(\hat{p}_1 - \hat{p}_2 \pm z^*\sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}\) | exp of [ln(\(\hat{p}_1/\hat{p}_2\)) ± \(z^*\sqrt{\frac{1}{A}-\frac{1}{A+C}+\frac{1}{B}-\frac{1}{B+D}}\)] | exp of [ln(\(AD/BC\)) ± \(z^*\sqrt{\frac{1}{A}+\frac{1}{B}+\frac{1}{C}+\frac{1}{D}}\)] |
| R Commands |
iscamtwopropztest• observed1 (either the number of successes or sample proportion for first group), n1 (sample size for first group), observed2 (count or proportion), and n2 for the second group • Optional: hypothesized difference and alternative ("less", "greater", or "two.sided") • Optional: conf.level |
fmsb::riskratioriskratio(A, B, A+C, B+D, conf.level, p.calc.by.independence = TRUE) |
fisher.test• matrix(c(A, C, B, D), nrow=2) • alt= ("less", "greater", or "two.sided") • Optional: conf.int = TRUE, conf.level |
| JMP | Analysis > Fit Y by X or ISCAM Journal file | Select Relative Risk | Select Odds Ratio |
| Applets | Theory-based Inference > Two proportions or Analyzing Two-way Tables | Analyzing Two-way Tables applet > Relative Risk | Analyzing Two-way Tables applet > Odds ratio |
Note: Fisher’s Exact Test is usually considered a reasonable approximation to the p-value from independent random sampling.
You have attempted of activities on this page.
