Comprehensive two-proportion inference in R
PropTestR provides a single, standardized interface for comparing two independent or paired proportions, with emphasis on clinical trials, epidemiology, veterinary epidemiology, and biomedical research.
PropTestR 1.0.0 is currently a source package. Install its CRAN dependencies first:
install.packages(c("DescTools", "DescrTab2"))Then install the local source package:
install.packages("PropTestR_1.0.0.tar.gz", repos = NULL, type = "source")library(PropTestR)
result <- compare_2prop(
x1 = 82, n1 = 100,
x2 = 75, n2 = 100,
method = "all"
)
print(result)
tidy_prop_result(result)
plot_prop_result(result)farrington_manning(
x1 = 82, n1 = 100,
x2 = 85, n2 = 100,
margin = -0.10,
alternative = "greater"
)equivalence_2prop(
x1 = 80, n1 = 100,
x2 = 78, n2 = 100,
margin = 0.10,
conf.level = 0.90
)paired_2prop(b = 15, c = 5, n = 100)
paired_2prop(b = 15, c = 5, n = 100, method = "mcnemar_exact")stratified_2prop(
x1 = c(20, 15, 30), n1 = c(100, 80, 120),
x2 = c(25, 18, 35), n2 = c(100, 80, 120),
strata = c("A", "B", "C")
)Independent groups: Wald, score, Pearson chi-squared, Yates-corrected chi-squared, Fisher exact, Barnard exact, Boschloo exact, Agresti-Caffo, Newcombe/score, Miettinen-Nurminen, Mee, Brown-Li-Jeffreys, and Farrington-Manning.
Additional procedures: risk difference, risk ratio, odds ratio, equivalence, McNemar paired analysis, and stratified Cochran-Mantel-Haenszel analysis.
Version 1.0 should be validated against published reference examples and independent implementations before CRAN submission. The package deliberately uses established CRAN implementations for several computationally intensive procedures and standardizes their outputs rather than reimplementing copyrighted source code.