Helper functions to implement various tests on the difference between two proportions.
prop_chisq(tbl, alternative = c("two.sided", "less", "greater"))prop_cmh(
ary,
alternative = c("two.sided", "less", "greater"),
transform = c("none", "wilson_hilferty")
)
prop_schouten(tbl, alternative = c("two.sided", "less", "greater"))
prop_fisher(tbl, alternative = c("two.sided", "less", "greater"))
A p-value.
(matrix)
matrix with two groups in rows and the binary response (TRUE/FALSE) in columns.
(string)
whether two.sided, or one-sided less or greater p-value
should be displayed.
(array, 3 dimensions)
array with two groups in rows, the binary response
(TRUE/FALSE) in columns, and the strata in the third dimension.
(string)
either none or wilson_hilferty; specifies whether to apply
the Wilson-Hilferty transformation of the chi-squared statistic.
prop_chisq(): Performs Chi-Squared test. Internally calls stats::prop.test().
prop_cmh(): Performs stratified Cochran-Mantel-Haenszel test,
using stats::mantelhaen.test() internally.
Note that strata with less than two observations are automatically discarded.
prop_schouten(): Performs the Chi-Squared test with Schouten correction.
prop_fisher(): Performs the Fisher's exact test. Internally calls stats::fisher.test().
prop_diff_test() for implementation of these helper functions.
Schouten correction is based upon Schouten1980-kd;textualtern.