Title: | Statistical Analysis of Contingency Tables |
---|---|
Description: | Provides functions to perform statistical inference of data organized in contingency tables. This package is a companion to the "Statistical Analysis of Contingency Tables" book by Fagerland et al. <ISBN 9781466588172>. |
Authors: | Morten Wang Fagerland [aut], Stian Lydersen [ctb], Petter Laake [ctb], Waldir Leoncio [cre], Ole Christian Lingjærde [trl], Brad J. Biggerstaff [ctb] |
Maintainer: | Waldir Leoncio <[email protected]> |
License: | GPL-3 |
Version: | 3.0.1 |
Built: | 2024-10-28 05:21:02 UTC |
Source: | https://github.com/ocbe-uio/contingencytables |
Prints package version number and welcome message on package load
.onAttach(libname, pkgname)
.onAttach(libname, pkgname)
libname |
library location. See |
pkgname |
package name. See |
The adjusted inverse hyperbolic sine confidence interval for the odds ratio.
Described in Chapter 4 "The 2x2 Table"
Adjusted_inv_sinh_CI_OR_2x2(n, psi1 = 0.45, psi2 = 0.25, alpha = 0.05)
Adjusted_inv_sinh_CI_OR_2x2(n, psi1 = 0.45, psi2 = 0.25, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
psi1 |
pseudo-frequency (should be > 0) |
psi2 |
pseudo-frequency (should be > 0) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Adjusted_inv_sinh_CI_OR_2x2(lampasona_2013) Adjusted_inv_sinh_CI_OR_2x2(ritland_2007)
Adjusted_inv_sinh_CI_OR_2x2(lampasona_2013) Adjusted_inv_sinh_CI_OR_2x2(ritland_2007)
The adjusted inverse hyperbolic sine confidence interval for the ratio of probabilities
Described in Chapter 4 "The 2x2 Table"
Adjusted_inv_sinh_CI_ratio_2x2( n, psi1 = 0, psi2 = 0, psi3 = 0, psi4 = 1, alpha = 0.05 )
Adjusted_inv_sinh_CI_ratio_2x2( n, psi1 = 0, psi2 = 0, psi3 = 0, psi4 = 1, alpha = 0.05 )
n |
the observed counts (a 2x2 matrix) |
psi1 |
pseudo-frequency |
psi2 |
pseudo-frequency |
psi3 |
pseudo-frequency |
psi4 |
pseudo-frequency |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Adjusted_inv_sinh_CI_ratio_2x2(perondi_2004) Adjusted_inv_sinh_CI_ratio_2x2(ritland_2007)
Adjusted_inv_sinh_CI_ratio_2x2(perondi_2004) Adjusted_inv_sinh_CI_ratio_2x2(ritland_2007)
The adjusted log confidence interval for the ratio of probabilities
Described in Chapter 4 "The 2x2 Table"
Adjusted_log_CI_2x2(n, alpha = 0.05)
Adjusted_log_CI_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Adjusted_log_CI_2x2(perondi_2004) Adjusted_log_CI_2x2(ritland_2007)
Adjusted_log_CI_2x2(perondi_2004) Adjusted_log_CI_2x2(ritland_2007)
The Agresti-Caffo confidence interval for the difference between probabilities
Described in Chapter 4 "The 2x2 Table"
AgrestiCaffo_CI_2x2(n, alpha = 0.05)
AgrestiCaffo_CI_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
AgrestiCaffo_CI_2x2(perondi_2004) AgrestiCaffo_CI_2x2(ritland_2007)
AgrestiCaffo_CI_2x2(perondi_2004) AgrestiCaffo_CI_2x2(ritland_2007)
Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
AgrestiCoull_CI_1x2(X, n, alpha = 0.05)
AgrestiCoull_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Agresti A, Coull BA (1998) Approximate is better than "exact" for interval estimation of binomial proportions. The American Statistician; 52:119-126
Wald_CI_1x2
AgrestiCoull_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) AgrestiCoull_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) AgrestiCoull_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], AgrestiCoull_CI_1x2(X, n)) # alternative syntax AgrestiCoull_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
AgrestiCoull_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) AgrestiCoull_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) AgrestiCoull_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], AgrestiCoull_CI_1x2(X, n)) # alternative syntax AgrestiCoull_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
The Arcsine confidence interval for the binomial probability (with Anscombe variance stabilizing transformation) Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Arcsine_CI_1x2(X, n, alpha = 0.05)
Arcsine_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Anscombe FJ (1948) The transformation of Poisson, binomial and negative binomial data. Biometrika; 35:246-254
Arcsine_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Arcsine_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Arcsine_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Arcsine_CI_1x2(X, n)) # alternative syntax Arcsine_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
Arcsine_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Arcsine_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Arcsine_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Arcsine_CI_1x2(X, n)) # alternative syntax Arcsine_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
The Baptista-Pike exact conditional confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
BaptistaPike_exact_conditional_CI_2x2(n, alpha = 0.05)
BaptistaPike_exact_conditional_CI_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
BaptistaPike_exact_conditional_CI_2x2(tea) BaptistaPike_exact_conditional_CI_2x2(perondi_2004) BaptistaPike_exact_conditional_CI_2x2(lampasona_2013) BaptistaPike_exact_conditional_CI_2x2(ritland_2007)
BaptistaPike_exact_conditional_CI_2x2(tea) BaptistaPike_exact_conditional_CI_2x2(perondi_2004) BaptistaPike_exact_conditional_CI_2x2(lampasona_2013) BaptistaPike_exact_conditional_CI_2x2(ritland_2007)
The Baptista-Pike mid-P confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
BaptistaPike_midP_CI_2x2(n, alpha = 0.05)
BaptistaPike_midP_CI_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
BaptistaPike_midP_CI_2x2(tea) BaptistaPike_midP_CI_2x2(perondi_2004) BaptistaPike_midP_CI_2x2(lampasona_2013) BaptistaPike_midP_CI_2x2(ritland_2007)
BaptistaPike_midP_CI_2x2(tea) BaptistaPike_midP_CI_2x2(perondi_2004) BaptistaPike_midP_CI_2x2(lampasona_2013) BaptistaPike_midP_CI_2x2(ritland_2007)
Airway hyper-responsiveness before and after stem cell transplantation
bentur_2009
bentur_2009
An object of class matrix
(inherits from array
) with 2 rows and 2 columns.
Bentur et al. (2009)
The Bhapkar test for marginal homogeneity
Described in Chapter 9 "The Paired cxc Table"
Bhapkar_test_paired_cxc(n)
Bhapkar_test_paired_cxc(n)
n |
the observed table (a cxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Bhapkar_test_paired_cxc(peterson_2007)
Bhapkar_test_paired_cxc(peterson_2007)
The Blaker exact confidence interval for the binomial probability Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Blaker_exact_CI_1x2(X, n, alpha = 0.05)
Blaker_exact_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Blaker H (2000) Confidence curves and improved exact confidence intervals for discrete distributions. The Canadian Journal of Statistics; 28:783-798
Blaker_exact_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Blaker_exact_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Blaker_exact_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Blaker_exact_CI_1x2(X, n)) # alternative syntax Blaker_exact_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
Blaker_exact_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Blaker_exact_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Blaker_exact_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Blaker_exact_CI_1x2(X, n)) # alternative syntax Blaker_exact_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
The Blaker exact test for the binomial probability (pi) H_0: pi = pi0 vs H_A: pi ~= pi0 (two-sided) Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Blaker_exact_test_1x2(X, n, pi0)
Blaker_exact_test_1x2(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Blaker H (2000) Confidence curves and improved exact confidence intervals for discrete distributions. The Canadian Journal of Statistics; 28:783-798
Blaker_exact_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.513) Blaker_exact_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.513) Blaker_exact_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.513) Blaker_exact_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.513) Blaker_exact_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.5)
Blaker_exact_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.513) Blaker_exact_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.513) Blaker_exact_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.513) Blaker_exact_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.513) Blaker_exact_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.5)
The Blaker mid-P confidence interval for the binomial probability Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Blaker_midP_CI_1x2(X, n, alpha = 0.05)
Blaker_midP_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Blaker H (2000) Confidence curves and improved exact confidence intervals for discrete distributions. The Canadian Journal of Statistics; 28:783-798
Blaker_midP_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Blaker_midP_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Blaker_midP_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Blaker_midP_CI_1x2(X, n)) # alternative syntax Blaker_midP_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
Blaker_midP_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Blaker_midP_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Blaker_midP_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Blaker_midP_CI_1x2(X, n)) # alternative syntax Blaker_midP_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
The Blaker mid-P test for the binomial probability (pi) H_0: pi = pi0 vs H_A: pi ~= pi0 (two-sided) Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Blaker_midP_test_1x2(X, n, pi0)
Blaker_midP_test_1x2(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Blaker H (2000) Confidence curves and improved exact confidence intervals for discrete distributions. The Canadian Journal of Statistics; 28:783-798
Blaker_midP_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.513) Blaker_midP_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.513) Blaker_midP_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.513) Blaker_midP_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.513) Blaker_midP_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.5)
Blaker_midP_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.513) Blaker_midP_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.513) Blaker_midP_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.513) Blaker_midP_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.513) Blaker_midP_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.5)
The Bonett-Price hybrid Wilson score confidence interval for the ratio of paired probabilities
with continuity correction
Described in Chapter 8 "The Paired 2x2 Table"
BonettPrice_hybrid_Wilson_score_CI_CC_paired_2x2(n, alpha = 0.05)
BonettPrice_hybrid_Wilson_score_CI_CC_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
BonettPrice_hybrid_Wilson_score_CI_CC_paired_2x2(bentur_2009) BonettPrice_hybrid_Wilson_score_CI_CC_paired_2x2(cavo_2012)
BonettPrice_hybrid_Wilson_score_CI_CC_paired_2x2(bentur_2009) BonettPrice_hybrid_Wilson_score_CI_CC_paired_2x2(cavo_2012)
The Bonett-Price hybrid Wilson score confidence interval for the ratio of paired probabilities
Described in Chapter 8 "The Paired 2x2 Table"
BonettPrice_hybrid_Wilson_score_CI_paired_2x2(n, alpha = 0.05)
BonettPrice_hybrid_Wilson_score_CI_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
BonettPrice_hybrid_Wilson_score_CI_paired_2x2(bentur_2009) BonettPrice_hybrid_Wilson_score_CI_paired_2x2(cavo_2012)
BonettPrice_hybrid_Wilson_score_CI_paired_2x2(bentur_2009) BonettPrice_hybrid_Wilson_score_CI_paired_2x2(cavo_2012)
Bonferroni-type confidence intervals for differences of marginal probabilities
Described in Chapter 9 "The Paired kxk Table"
Bonferroni_type_CIs_paired_cxc(n, alpha = 0.05)
Bonferroni_type_CIs_paired_cxc(n, alpha = 0.05)
n |
the observed table (a cxc matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Bonferroni_type_CIs_paired_cxc(peterson_2007)
Bonferroni_type_CIs_paired_cxc(peterson_2007)
The Bonferroni-type simultaneous confidence intervals for the differences pi_1|i - pi_1|j
Described in Chapter 7 "The rxc Table"
Bonferroni_type_CIs_rxc(n, alpha = 0.05)
Bonferroni_type_CIs_rxc(n, alpha = 0.05)
n |
the observed counts (an rx2 vector) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Bonferroni_type_CIs_rxc(table_7.3)
Bonferroni_type_CIs_rxc(table_7.3)
The Brant test for the proportional odds assumption
Described in Chapter 6 "The Ordered 2xc Table"
Brant_test_2xc(n)
Brant_test_2xc(n)
n |
the observed table (a 2xc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Brant_test_2xc(fontanella_2008) Brant_test_2xc(lydersen_2012a)
Brant_test_2xc(fontanella_2008) Brant_test_2xc(lydersen_2012a)
The Breslow-Day test of homogeneity of odds ratios over strata with
Tarone correction
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
BreslowDay_homogeneity_test_stratified_2x2(n)
BreslowDay_homogeneity_test_stratified_2x2(n)
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
BreslowDay_homogeneity_test_stratified_2x2(doll_hill_1950) BreslowDay_homogeneity_test_stratified_2x2(hine_1989)
BreslowDay_homogeneity_test_stratified_2x2(doll_hill_1950) BreslowDay_homogeneity_test_stratified_2x2(hine_1989)
Calculate probability
calc_prob(...)
calc_prob(...)
... |
arguments passed to methods |
This function has little use to the user, it is exported for confirmity to R package standards.
Calculate probability
calc_Pvalue_4x2(...)
calc_Pvalue_4x2(...)
... |
arguments passed to methods |
This function has little use to the user, it is exported for confirmity to R package standards.
Calculate probability
calc_Pvalue_5x2(...)
calc_Pvalue_5x2(...)
... |
arguments passed to methods |
This function has little use to the user, it is exported for confirmity to R package standards.
Calculate the lower limit of a confidence interval
calculate_limit_lower(...)
calculate_limit_lower(...)
... |
arguments passed to methods |
This function has little use to the user, it is exported so that
it can be used by stats::uniroot()
.
Calculate the upper limit of a confidence interval
calculate_limit_upper(...)
calculate_limit_upper(...)
... |
arguments passed to methods |
This function has little use to the user, it is exported so that
it can be used by stats::uniroot()
.
Complete response before and after consolidation therapy
cavo_2012
cavo_2012
An object of class matrix
(inherits from array
) with 2 rows and 2 columns.
Cavo et al. (2012)
Described in Chapter 3, "The 1xc Table and the Multinomial
Distribution", Chacko (1966) derived a test based on the Pearson chi-square
statistic to test the hypothesis that the categories of a multinomial
variable with c
possible outcomes have a natural ordering. The test
statistic is asymptotically chi-squared distributed.
Chacko_test_1xc(n)
Chacko_test_1xc(n)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Chacko, V. J. (1966). Modified chi-square test for ordered alternatives. Sankhyā: The Indian Journal of Statistics, Series B, 185-190.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL.
Chacko_test_1xc(hypothetical)
Chacko_test_1xc(hypothetical)
There are no functions for Chapter 1 (Introduction), only from Chapters 2 to 10.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
These are the functions related to chapter 10:
BreslowDay_homogeneity_test_stratified_2x2
CochranMantelHaenszel_test_stratified_2x2
Cochran_Q_test_stratified_2x2
InverseVariance_estimate_stratified_2x2
ML_estimates_and_CIs_stratified_2x2
MantelHaenszel_estimate_stratified_2x2
Pearson_LR_homogeneity_test_stratified_2x2
Pearson_LR_test_common_effect_stratified_2x2
Peto_homogeneity_test_stratified_2x2
Peto_OR_estimate_stratified_2x2
RBG_test_and_CI_stratified_2x2
Wald_test_and_CI_common_diff_stratified_2x2
Wald_test_and_CI_common_ratio_stratified_2x2
Woolf_test_and_CI_stratified_2x2
stratified_2x2_tables
You can also print the list above with list_functions(10)
.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
These are the functions related to chapter 2:
AgrestiCoull_CI_1x2
Arcsine_CI_1x2
Wald_CI_1x2
Blaker_exact_CI_1x2
Blaker_exact_test_1x2
Blaker_midP_CI_1x2
Blaker_midP_test_1x2
ClopperPearson_exact_CI_1x2
ClopperPearson_midP_CI_1x2
Exact_binomial_test_1x2
Jeffreys_CI_1x2
LR_CI_1x2
LR_test_1x2
MidP_binomial_test_1x2
Score_test_1x2
Score_test_CC_1x2
Wald_CI_CC_1x2
Wilson_score_CI_1x2
Wilson_score_CI_CC_1x2
the_1x2_table_CIs
Wald_test_1x2
Wald_test_CC_1x2
the_1x2_table_tests
You can also print the list above with list_functions(2)
.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
These are the functions related to chapter 3:
Chacko_test_1xc
Exact_multinomial_test_1xc
Gold_Wald_CIs_1xc
Goodman_Wald_CIs_1xc
Goodman_Wald_CIs_for_diffs_1xc
Goodman_Wilson_score_CIs_1xc
LR_test_1xc
MidP_multinomial_test_1xc
Pearson_chi_squared_test_1xc
QuesenberryHurst_Wilson_score_CIs_1xc
the_1xc_table_CIs
the_1xc_table_tests
You can also print the list above with list_functions(3)
.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
These are the functions related to chapter 4:
Adjusted_inv_sinh_CI_OR_2x2
Adjusted_inv_sinh_CI_ratio_2x2
Adjusted_log_CI_2x2
AgrestiCaffo_CI_2x2
Wald_CI_2x2
BaptistaPike_exact_conditional_CI_2x2
BaptistaPike_midP_CI_2x2
Cornfield_exact_conditional_CI_2x2
Cornfield_midP_CI_2x2
Fisher_exact_test_2x2
Exact_unconditional_test_2x2
Fisher_midP_test_2x2
Gart_adjusted_logit_CI_2x2
Independence_smoothed_logit_CI_2x2
Inv_sinh_CI_OR_2x2
Inv_sinh_CI_ratio_2x2
Katz_log_CI_2x2
Koopman_asymptotic_score_CI_2x2
LR_test_2x2
Mee_asymptotic_score_CI_2x2
MiettinenNurminen_asymptotic_score_CI_difference_2x2
MiettinenNurminen_asymptotic_score_CI_OR_2x2
MiettinenNurminen_asymptotic_score_CI_ratio_2x2
MOVER_R_Wilson_CI_OR_2x2
MOVER_R_Wilson_CI_ratio_2x2
Newcombe_hybrid_score_CI_2x2
Pearson_chi_squared_test_2x2
Pearson_chi_squared_test_CC_2x2
PriceBonett_approximate_Bayes_CI_2x2
Wald_CI_CC_2x2
Woolf_logit_CI_2x2
Uncorrected_asymptotic_score_CI_2x2
Z_unpooled_test_2x2
the_2x2_table_CIs_difference
the_2x2_table_CIs_OR
the_2x2_table_CIs_ratio
the_2x2_table_tests
You can also print the list above with list_functions(4)
.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
These are the functions related to chapter 5:
CochranArmitage_CI_rx2
CochranArmitage_exact_cond_midP_tests_rx2
CochranArmitage_MH_tests_rx2
Exact_cond_midP_unspecific_ordering_rx2
Pearson_LR_tests_unspecific_ordering_rx2
the_rx2_table
Trend_estimate_CI_tests_rx2
You can also print the list above with list_functions(5)
.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
These are the functions related to chapter 6:
Brant_test_2xc
Cumulative_models_for_2xc
Exact_cond_midP_linear_rank_tests_2xc
ClopperPearson_exact_CI_1x2_beta_version
Exact_cond_midP_unspecific_ordering_rx2
MantelHaenszel_test_2xc
Pearson_LR_tests_cum_OR_2xc
Score_test_for_effect_in_the_probit_model_2xc
the_2xc_table
You can also print the list above with list_functions(6)
.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
These are the functions related to chapter 7:
Bonferroni_type_CIs_rxc
Cumulative_models_for_rxc
Exact_cond_midP_tests_rxc
FisherFreemanHalton_asymptotic_test_rxc
gamma_coefficient_rxc_bca
gamma_coefficient_rxc
JonckheereTerpstra_test_rxc
Kendalls_tau_b_rxc
Kendalls_tau_b_rxc_bca
KruskalWallis_asymptotic_test_rxc
linear_by_linear_test_rxc
Pearson_correlation_coefficient_rxc
Pearson_correlation_coefficient_rxc_bca
Pearson_LR_tests_rxc
Pearson_residuals_rxc
Scheffe_type_CIs_rxc
Spearman_correlation_coefficient_rxc
Spearman_correlation_coefficient_rxc_bca
the_rxc_table
You can also print the list above with list_functions(7)
.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
These are the functions related to chapter 8:
BonettPrice_hybrid_Wilson_score_CI_CC_paired_2x2
BonettPrice_hybrid_Wilson_score_CI_paired_2x2
ClopperPearson_exact_CI_1x2_beta_version
McNemar_asymptotic_test_CC_paired_2x2
McNemar_asymptotic_test_paired_2x2
McNemar_exact_cond_test_paired_2x2
McNemar_exact_unconditional_test_paired_2x2
McNemar_midP_test_paired_2x2
Tang_asymptotic_score_CI_paired_2x2
Tango_asymptotic_score_CI_paired_2x2
MOVER_Wilson_score_CI_paired_2x2
Newcombe_square_and_add_CI_paired_2x2
Transformed_Blaker_exact_CI_paired_2x2
Transformed_Clopper_Pearson_exact_CI_paired_2x2
Transformed_Clopper_Pearson_midP_CI_paired_2x2
Transformed_Wilson_score_CI_paired_2x2
Wald_CI_diff_paired_2x2
Wald_CI_diff_CC_paired_2x2
Wald_CI_AgrestiMin_paired_2x2
Wald_CI_BonettPrice_paired_2x2
Wald_CI_OR_Laplace_paired_2x2
Wald_CI_OR_paired_2x2
Wald_CI_ratio_paired_2x2
the_paired_2x2_table_CIs_difference
the_paired_2x2_table_CIs_OR
the_paired_2x2_table_CIs_ratio
the_paired_2x2_table_tests
You can also print the list above with list_functions(8)
.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
These are the functions related to chapter 9:
Bhapkar_test_paired_cxc
Bonferroni_type_CIs_paired_cxc
FleissEveritt_test_paired_cxc
FleissLevinPaik_test_paired_cxc
McNemarBowker_test_paired_cxc
Scheffe_type_CIs_paired_cxc
Score_test_and_CI_marginal_mean_scores_paired_cxc
Stuart_test_paired_cxc
Wald_test_and_CI_marginal_mean_ranks_paired_cxc
Wald_test_and_CI_marginal_mean_scores_paired_cxc
the_paired_cxc_table_nominal
the_paired_cxc_table_ordinal
You can also print the list above with list_functions(9)
.
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
The Clopper-Pearson exact confidence interval for the binomial probability Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
ClopperPearson_exact_CI_1x2(X, n, alpha = 0.05)
ClopperPearson_exact_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95#' CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
ClopperPearson_exact_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) ClopperPearson_exact_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) ClopperPearson_exact_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], ClopperPearson_exact_CI_1x2(X, n)) # alternative syntax ClopperPearson_exact_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
ClopperPearson_exact_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) ClopperPearson_exact_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) ClopperPearson_exact_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], ClopperPearson_exact_CI_1x2(X, n)) # alternative syntax ClopperPearson_exact_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
The Clopper-Pearson exact confidence interval for the binomial probability
(defined via the beta distribution)
Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
ClopperPearson_exact_CI_1x2_beta_version(X, n, alpha = 0.05)
ClopperPearson_exact_CI_1x2_beta_version(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Brown LD, Cai T, DasGupta A (2001) Interval estimation for a binomial proportion. Statistical Science; 16:101-133
ClopperPearson_exact_CI_1x2
ClopperPearson_exact_CI_1x2_beta_version(singh_2010["1st", "X"], singh_2010["1st", "n"]) ClopperPearson_exact_CI_1x2_beta_version(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) ClopperPearson_exact_CI_1x2_beta_version(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], ClopperPearson_exact_CI_1x2_beta_version(X, n)) # alternative syntax ClopperPearson_exact_CI_1x2_beta_version(ligarden_2010["X"], ligarden_2010["n"])
ClopperPearson_exact_CI_1x2_beta_version(singh_2010["1st", "X"], singh_2010["1st", "n"]) ClopperPearson_exact_CI_1x2_beta_version(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) ClopperPearson_exact_CI_1x2_beta_version(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], ClopperPearson_exact_CI_1x2_beta_version(X, n)) # alternative syntax ClopperPearson_exact_CI_1x2_beta_version(ligarden_2010["X"], ligarden_2010["n"])
The Clopper-Pearson mid-P confidence interval for the binomial probability Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
ClopperPearson_midP_CI_1x2(X, n, alpha = 0.05)
ClopperPearson_midP_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
ClopperPearson_midP_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) ClopperPearson_midP_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) ClopperPearson_midP_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], ClopperPearson_midP_CI_1x2(X, n)) # alternative syntax ClopperPearson_midP_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
ClopperPearson_midP_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) ClopperPearson_midP_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) ClopperPearson_midP_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], ClopperPearson_midP_CI_1x2(X, n)) # alternative syntax ClopperPearson_midP_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
The Cochran Q test of homogeneity of effects over strata
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
Cochran_Q_test_stratified_2x2(n, link = "linear", estimatetype = "MH")
Cochran_Q_test_stratified_2x2(n, link = "linear", estimatetype = "MH")
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
link |
the link function ('linear', 'log', or 'logit') |
estimatetype |
Mantel-Haenszel or inverse variance estimate ('MH' or 'IV') |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Cochran_Q_test_stratified_2x2(doll_hill_1950) Cochran_Q_test_stratified_2x2(hine_1989)
Cochran_Q_test_stratified_2x2(doll_hill_1950) Cochran_Q_test_stratified_2x2(hine_1989)
The Cochran-Armitage confidence interval for trend in the linear model
Described in Chapter 5 "The Ordered rx2 Table"
CochranArmitage_CI_rx2(n, a = seq_len(nrow(n)), alpha = 0.05)
CochranArmitage_CI_rx2(n, a = seq_len(nrow(n)), alpha = 0.05)
n |
the observed counts (an rx2 matrix) |
a |
scores assigned to the rows |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
CochranArmitage_CI_rx2(mills_graubard_1987, c(1, 2, 3, 4, 5)) CochranArmitage_CI_rx2(indredavik_2008, c(1, 2, 3, 4, 5))
CochranArmitage_CI_rx2(mills_graubard_1987, c(1, 2, 3, 4, 5)) CochranArmitage_CI_rx2(indredavik_2008, c(1, 2, 3, 4, 5))
The Cochran-Armitage exact conditional and mid-P tests
Described in Chapter 5 "The Ordered rx2 Table"
CochranArmitage_exact_cond_midP_tests_rx2(n, a)
CochranArmitage_exact_cond_midP_tests_rx2(n, a)
n |
the observed counts (an rx2 matrix) |
a |
scores assigned to the rows |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
## Not run: CochranArmitage_exact_cond_midP_tests_rx2(mills_graubard_1987, c(1, 2, 3, 4, 5)) ## End(Not run) CochranArmitage_exact_cond_midP_tests_rx2(indredavik_2008, c(1, 2, 3, 4, 5))
## Not run: CochranArmitage_exact_cond_midP_tests_rx2(mills_graubard_1987, c(1, 2, 3, 4, 5)) ## End(Not run) CochranArmitage_exact_cond_midP_tests_rx2(indredavik_2008, c(1, 2, 3, 4, 5))
Described in Chapter 5 "The Ordered rx2 Table"
CochranArmitage_MH_tests_rx2(n, a)
CochranArmitage_MH_tests_rx2(n, a)
n |
the observed counts (an rx2 matrix) |
a |
scores assigned to the rows |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
CochranArmitage_MH_tests_rx2(mills_graubard_1987, c(1, 2, 3, 4, 5)) CochranArmitage_MH_tests_rx2(indredavik_2008, c(1, 2, 3, 4, 5))
CochranArmitage_MH_tests_rx2(mills_graubard_1987, c(1, 2, 3, 4, 5)) CochranArmitage_MH_tests_rx2(indredavik_2008, c(1, 2, 3, 4, 5))
The Cochran-Mantel-Haenszel test of a common odds ratio
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
CochranMantelHaenszel_test_stratified_2x2(n)
CochranMantelHaenszel_test_stratified_2x2(n)
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
CochranMantelHaenszel_test_stratified_2x2(doll_hill_1950) CochranMantelHaenszel_test_stratified_2x2(hine_1989)
CochranMantelHaenszel_test_stratified_2x2(doll_hill_1950) CochranMantelHaenszel_test_stratified_2x2(hine_1989)
Statistical Analysis of Contingency Tables is an invaluable tool for statistical inference in contingency tables. It covers effect size estimation, confidence intervals, and hypothesis tests for the binomial and the multinomial distributions, unpaired and paired 2x2 tables, rxc tables, ordered rx2 and 2xc tables, paired cxc tables, and stratified tables. This package provides functions that accompany the "Statistical Analysis of Contingency Tables" book by Fagerland et. al. <ISBN 9781466588172>.
Maintainer: Waldir Leoncio [email protected]
Authors:
Morten Wang Fagerland [email protected]
Other contributors:
Stian Lydersen [contributor]
Petter Laake [contributor]
Ole Christian Lingjærde [translator]
Brad J. Biggerstaff [contributor]
Fagerland MW, Lydersen S, Laake P (2017) Statistical Analysis of Contingency Tables. Chapman & Hall/CRC, Boca Raton, FL
https://contingencytables.com/
https://www.routledge.com/Statistical-Analysis-of-Contingency-Tables/Fagerland-Lydersen-Laake/p/book/9781466588172
https://ocbe-uio.github.io/contingencytables/
print.contingencytables_result to read about printing alternatives.
A class for output of the main functions on this package
contingencytables_result(statistics, print_structure)
contingencytables_result(statistics, print_structure)
statistics |
Either a value or a list of values to be filled by print_format |
print_structure |
Either a string of a function instructing how to print
the values from |
an object of class contingencytables_result
Waldir Leoncio
print.contingencytables_result
The Cornfield exact conditional confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
Cornfield_exact_conditional_CI_2x2(n, alpha = 0.05)
Cornfield_exact_conditional_CI_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Cornfield_exact_conditional_CI_2x2(tea) Cornfield_exact_conditional_CI_2x2(perondi_2004) Cornfield_exact_conditional_CI_2x2(lampasona_2013) Cornfield_exact_conditional_CI_2x2(ritland_2007)
Cornfield_exact_conditional_CI_2x2(tea) Cornfield_exact_conditional_CI_2x2(perondi_2004) Cornfield_exact_conditional_CI_2x2(lampasona_2013) Cornfield_exact_conditional_CI_2x2(ritland_2007)
The Cornfield mid-P confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
Cornfield_midP_CI_2x2(n, alpha = 0.05)
Cornfield_midP_CI_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Cornfield_midP_CI_2x2(tea) Cornfield_midP_CI_2x2(perondi_2004) Cornfield_midP_CI_2x2(lampasona_2013) Cornfield_midP_CI_2x2(ritland_2007)
Cornfield_midP_CI_2x2(tea) Cornfield_midP_CI_2x2(perondi_2004) Cornfield_midP_CI_2x2(lampasona_2013) Cornfield_midP_CI_2x2(ritland_2007)
Cumulative logit and probit models
Described in Chapter 6 "The Ordered 2xc Table"
Cumulative_models_for_2xc(n, linkfunction = "logit", alpha = 0.05)
Cumulative_models_for_2xc(n, linkfunction = "logit", alpha = 0.05)
n |
the observed table (a 2xc matrix) with at least 3 columns |
linkfunction |
either "logit" or "probit" |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Cumulative_models_for_2xc(fontanella_2008) Cumulative_models_for_2xc(lydersen_2012a)
Cumulative_models_for_2xc(fontanella_2008) Cumulative_models_for_2xc(lydersen_2012a)
Cumulative logit and probit models
Described in Chapter 7 "The rxc Table"
Cumulative_models_for_rxc(n, linkfunction = "logit", alpha = 0.05)
Cumulative_models_for_rxc(n, linkfunction = "logit", alpha = 0.05)
n |
the observed table (an rxc matrix) with at least 3 columns |
linkfunction |
either "logit" or "probit" |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Cumulative_models_for_rxc(table_7.5) Cumulative_models_for_rxc(table_7.6)
Cumulative_models_for_rxc(table_7.5) Cumulative_models_for_rxc(table_7.6)
Smoking and lung cancer
doll_hill_1950
doll_hill_1950
An object of class array
of dimension 2 x 2 x 2.
Doll and Hill (1950)
H_0 pi = pi0 vs H_A: pi ~= pi0 (two-sided)
Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Exact_binomial_test_1x2(X, n, pi0)
Exact_binomial_test_1x2(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Exact_binomial_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.513) Exact_binomial_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.513) Exact_binomial_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.513) Exact_binomial_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.513) Exact_binomial_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.5)
Exact_binomial_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.513) Exact_binomial_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.513) Exact_binomial_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.513) Exact_binomial_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.513) Exact_binomial_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.5)
Exact conditional and mid-P linear rank tests
Described in Chapter 6 "The Ordered 2xc Table"
Exact_cond_midP_linear_rank_tests_2xc(n, b = 0)
Exact_cond_midP_linear_rank_tests_2xc(n, b = 0)
n |
the observed table (a 2xc matrix) |
b |
scores assigned to the columns (if b=0, midranks will be used as scores) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Exact_cond_midP_linear_rank_tests_2xc(lydersen_2012a) ## Not run: Exact_cond_midP_linear_rank_tests_2xc(fontanella_2008)
Exact_cond_midP_linear_rank_tests_2xc(lydersen_2012a) ## Not run: Exact_cond_midP_linear_rank_tests_2xc(fontanella_2008)
Exact conditional and mid-P tests for the rxc table: the Fisher-Freeman-Halton, Pearson, likelihood ratio, Kruskal-Wallis, linear-by-linear, and Jonckheere-Terpstra tests.
Described in Chapter 7 "The rxc Table"
Exact_cond_midP_tests_rxc(n)
Exact_cond_midP_tests_rxc(n)
n |
the observed counts (an rxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Works only for 3x2 and 3x3 tables
Exact_cond_midP_tests_rxc(table_7.3) # a 3x2 table ## Not run: Exact_cond_midP_tests_rxc(table_7.6) # a 3x3 table ## End(Not run)
Exact_cond_midP_tests_rxc(table_7.3) # a 3x2 table ## Not run: Exact_cond_midP_tests_rxc(table_7.6) # a 3x3 table ## End(Not run)
The exact conditional and mid-P tests for unspecific ordering. May also be used for 2xc tables, after flipping rows and columns (i.e. if n is a 2xc table, call this function with n' (the transpose of n) as the first argument).
Described in Chapter 5 "The Ordered rx2 Table"
Exact_cond_midP_unspecific_ordering_rx2(n, direction, statistic = "Pearson")
Exact_cond_midP_unspecific_ordering_rx2(n, direction, statistic = "Pearson")
n |
the observed counts (an rx2 matrix) |
direction |
the direction of the success probabilities ("increasing" or "decreasing") |
statistic |
the Pearson test statistic ("Pearson") or the likelihood ratio test statistic ("LR"). Can also be used for cumulative ORs in 2xc tables with "PearsonCumOR" or "LRCumOR". |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Chapter 6: Postoperative nausea (Lydersen et al., 2012a) n <- t(lydersen_2012a) Exact_cond_midP_unspecific_ordering_rx2(n, "decreasing") Exact_cond_midP_unspecific_ordering_rx2(n, "decreasing", "PearsonCumOR")
# Chapter 6: Postoperative nausea (Lydersen et al., 2012a) n <- t(lydersen_2012a) Exact_cond_midP_unspecific_ordering_rx2(n, "decreasing") Exact_cond_midP_unspecific_ordering_rx2(n, "decreasing", "PearsonCumOR")
The exact multinomial test for multinomial probabilities
Described in Chapter 3 "The 1xc Table and the Multinomial Distribution"
Exact_multinomial_test_1xc(n, pi0)
Exact_multinomial_test_1xc(n, pi0)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
pi0 |
given probabilities (a 1xc vector) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Genotype counts for SNP rs 6498169 in RA patients Exact_multinomial_test_1xc(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients Exact_multinomial_test_1xc(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0)
# Genotype counts for SNP rs 6498169 in RA patients Exact_multinomial_test_1xc(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients Exact_multinomial_test_1xc(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0)
Exact unconditional test for association in 2x2 tables
Described in Chapter 4 "The 2x2 Table"
Exact_unconditional_test_2x2(n, statistic = "Pearson", gamma = 1e-04)
Exact_unconditional_test_2x2(n, statistic = "Pearson", gamma = 1e-04)
n |
the observed counts (a 2x2 matrix) |
statistic |
'Pearson' (Suissa-Shuster test default), 'LR' (likelihood ratio), ' unpooled' (unpooled Z), or 'Fisher' (Fisher-Boschloo test) |
gamma |
parameter for the Berger and Boos procedure (default=0.0001 gamma=0: no adj) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Somewhat crude code with maximization over a simple partition of the
nuisance parameter space into 'num_pi_values' equally spaced values
(1000, hardcoded).
This method could be improved with a better algorithm for the
maximization however, it works well for most purposes. plot()
the results
to get an indication of the precision. A refinement of the maximization
can be done with a manual restriction of the parameter space.
Exact_unconditional_test_2x2(tea) Exact_unconditional_test_2x2(perondi_2004) Exact_unconditional_test_2x2(lampasona_2013) Exact_unconditional_test_2x2(ritland_2007)
Exact_unconditional_test_2x2(tea) Exact_unconditional_test_2x2(perondi_2004) Exact_unconditional_test_2x2(lampasona_2013) Exact_unconditional_test_2x2(ritland_2007)
Floppy eyelid syndrome vs obstructive sleep apnea
ezra_2010
ezra_2010
An object of class matrix
(inherits from array
) with 2 rows and 2 columns.
Ezra et al. (2010)
A comparison between serial and retrospective measurements
fischer_1999
fischer_1999
An object of class matrix
(inherits from array
) with 5 rows and 5 columns.
Fischer et al. (1999)
The Fisher exact test for association in 2x2 tables
Described in Chapter 4 "The 2x2 Table"
Fisher_exact_test_2x2(n, statistic = "Pearson")
Fisher_exact_test_2x2(n, statistic = "Pearson")
n |
the observed counts (a 2x2 matrix) |
statistic |
'hypergeometric' (i.e. Fisher-Irwin; default), 'Pearson', or 'LR' (likelihood ratio) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Fisher_exact_test_2x2(tea) Fisher_exact_test_2x2(perondi_2004) Fisher_exact_test_2x2(lampasona_2013) Fisher_exact_test_2x2(ritland_2007)
Fisher_exact_test_2x2(tea) Fisher_exact_test_2x2(perondi_2004) Fisher_exact_test_2x2(lampasona_2013) Fisher_exact_test_2x2(ritland_2007)
The Fisher mid-P test for association in 2x2 tables
Described in Chapter 4 "The 2x2 Table"
Fisher_midP_test_2x2(n, statistic = "hypergeometric")
Fisher_midP_test_2x2(n, statistic = "hypergeometric")
n |
the observed counts (a 2x2 matrix) |
statistic |
'hypergeometric' (i.e. Fisher-Irwin default), 'Pearson', or 'LR' (likelihood ratio) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Fisher_midP_test_2x2(tea) Fisher_midP_test_2x2(perondi_2004) Fisher_midP_test_2x2(lampasona_2013) Fisher_midP_test_2x2(ritland_2007)
Fisher_midP_test_2x2(tea) Fisher_midP_test_2x2(perondi_2004) Fisher_midP_test_2x2(lampasona_2013) Fisher_midP_test_2x2(ritland_2007)
The Fisher-Freeman-Halton asymptotic test for unordered rxc tables
Described in Chapter 7 "The rxc Table"
FisherFreemanHalton_asymptotic_test_rxc(n)
FisherFreemanHalton_asymptotic_test_rxc(n)
n |
the observed counts (an rxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
May not give results for all tables, due to overflow
FisherFreemanHalton_asymptotic_test_rxc(table_7.3)
FisherFreemanHalton_asymptotic_test_rxc(table_7.3)
Table 13.6, page 382, of Fleiss et al. (2003)
fleiss_2003
fleiss_2003
An object of class matrix
(inherits from array
) with 3 rows and 3 columns.
Fleiss et al. (2003)
The Fleiss-Everitt version of the Stuart test for marginal homogeneity
Described in Chapter 9 "The Paired cxc Table"
FleissEveritt_test_paired_cxc(n)
FleissEveritt_test_paired_cxc(n)
n |
the observed table (a cxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
FleissEveritt_test_paired_cxc(fleiss_2003)
FleissEveritt_test_paired_cxc(fleiss_2003)
The Fleiss-Levin-Paik test for three-level ordinal outcomes
Described in Chapter 9 "The Paired cxc Table"
FleissLevinPaik_test_paired_cxc(n)
FleissLevinPaik_test_paired_cxc(n)
n |
the observed table (a cxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Pretherapy susceptability of pathogens *without the N / A category* FleissLevinPaik_test_paired_cxc(peterson_2007[-4, -4])
# Pretherapy susceptability of pathogens *without the N / A category* FleissLevinPaik_test_paired_cxc(peterson_2007[-4, -4])
The Adolescent Placement Study
fontanella_2008
fontanella_2008
An object of class matrix
(inherits from array
) with 2 rows and 4 columns.
Fontanella et al. (2008)
The gamma coefficient
Described in Chapter 7 "The rxc Table"
gamma_coefficient_rxc(n)
gamma_coefficient_rxc(n)
n |
the observed table (an rxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
gamma_coefficient_rxc(table_7.7) gamma_coefficient_rxc(table_7.8) gamma_coefficient_rxc(table_7.9)
gamma_coefficient_rxc(table_7.7) gamma_coefficient_rxc(table_7.8) gamma_coefficient_rxc(table_7.9)
The gamma coefficient with the bias-corrected and accelerated boostrap confidence interval
Described in Chapter 7 "The rxc Table"
gamma_coefficient_rxc_bca(n, nboot = 10000, alpha = 0.05)
gamma_coefficient_rxc_bca(n, nboot = 10000, alpha = 0.05)
n |
the observed table (an rxc matrix) |
nboot |
number of bootstrap samples |
alpha |
the nominal significance level, used to compute a 100(1-alpha) confidence interval |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
set.seed(9623) gamma_coefficient_rxc_bca(table_7.7, nboot = 800) gamma_coefficient_rxc_bca(table_7.8, nboot = 200) ## Not run: gamma_coefficient_rxc_bca(table_7.9, nboot = 3000, alpha = 0.2) ## End(Not run)
set.seed(9623) gamma_coefficient_rxc_bca(table_7.7, nboot = 800) gamma_coefficient_rxc_bca(table_7.8, nboot = 200) ## Not run: gamma_coefficient_rxc_bca(table_7.9, nboot = 3000, alpha = 0.2) ## End(Not run)
The Gart adjusted logit confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
Gart_adjusted_logit_CI_2x2(n, alpha = 0.05)
Gart_adjusted_logit_CI_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Gart_adjusted_logit_CI_2x2(lampasona_2013) Gart_adjusted_logit_CI_2x2(ritland_2007)
Gart_adjusted_logit_CI_2x2(lampasona_2013) Gart_adjusted_logit_CI_2x2(ritland_2007)
The Gold Wald simultaneous intervals for the multinomial probabilities (with Scheffe adjustment)
Described in Chapter 3 "The 1xc Table and the Multinomial Distribution"
Gold_Wald_CIs_1xc(n, alpha = 0.05)
Gold_Wald_CIs_1xc(n, alpha = 0.05)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Gold_Wald_CIs_1xc(n = snp6498169$complete$n)
Gold_Wald_CIs_1xc(n = snp6498169$complete$n)
The Goodman Wald simultaneous intervals for the multinomial probabilities
(with Bonferroni adjustment)
Described in Chapter 3 "The 1xc Table and the Multinomial Distribution"
Goodman_Wald_CIs_1xc(n, alpha = 0.05)
Goodman_Wald_CIs_1xc(n, alpha = 0.05)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Goodman_Wald_CIs_1xc(n = snp6498169$complete$n)
Goodman_Wald_CIs_1xc(n = snp6498169$complete$n)
The Goodman Wald simultaneous intervals for the differences between the
multinomial probabilities (with Scheffe or Bonferroni adjustment)
Described in Chapter 3 "The 1xc Table and the Multinomial Distribution"
Goodman_Wald_CIs_for_diffs_1xc(n, alpha = 0.05, adjustment = "Bonferroni")
Goodman_Wald_CIs_for_diffs_1xc(n, alpha = 0.05, adjustment = "Bonferroni")
n |
the observed counts (a 1xc vector, where c is the number of categories) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
adjustment |
Scheffe or Bonferroni adjustment ("Scheffe" or "Bonferroni") |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Goodman_Wald_CIs_for_diffs_1xc(n = snp6498169$complete$n)
Goodman_Wald_CIs_for_diffs_1xc(n = snp6498169$complete$n)
The Goodman Wilson score simultaneous intervals for the multinomial probabilities
(with Bonferroni adjustment)
Described in Chapter 3 "The 1xc Table and the Multinomial Distribution"
Goodman_Wilson_score_CIs_1xc(n, alpha = 0.05)
Goodman_Wilson_score_CIs_1xc(n, alpha = 0.05)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Goodman_Wilson_score_CIs_1xc(n = snp6498169$complete$n)
Goodman_Wilson_score_CIs_1xc(n = snp6498169$complete$n)
Prophylactice use of Lidocaine in myocardial infarction
hine_1989
hine_1989
An object of class array
of dimension 2 x 2 x 6.
Hine et al. (1989)
Hypothetical experiment
hypothetical
hypothetical
An object of class numeric
of length 5.
The Independence-smoothed logit confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
Independence_smoothed_logit_CI_2x2(n, alpha = 0.05)
Independence_smoothed_logit_CI_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Independence_smoothed_logit_CI_2x2(lampasona_2013) Independence_smoothed_logit_CI_2x2(ritland_2007)
Independence_smoothed_logit_CI_2x2(lampasona_2013) Independence_smoothed_logit_CI_2x2(ritland_2007)
Elevated troponin T levels in stroke patients
indredavik_2008
indredavik_2008
An object of class matrix
(inherits from array
) with 5 rows and 2 columns.
Indredavik et al. (2008)
The inverse hyperbolic sine confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
Inv_sinh_CI_OR_2x2(n, alpha = 0.05)
Inv_sinh_CI_OR_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Inv_sinh_CI_OR_2x2(lampasona_2013) Inv_sinh_CI_OR_2x2(ritland_2007)
Inv_sinh_CI_OR_2x2(lampasona_2013) Inv_sinh_CI_OR_2x2(ritland_2007)
The inverse hyperbolic sine confidence interval for the ratio of probabilities
Described in Chapter 4 "The 2x2 Table"
Inv_sinh_CI_ratio_2x2(n, alpha = 0.05)
Inv_sinh_CI_ratio_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Inv_sinh_CI_ratio_2x2(perondi_2004) Inv_sinh_CI_ratio_2x2(ritland_2007)
Inv_sinh_CI_ratio_2x2(perondi_2004) Inv_sinh_CI_ratio_2x2(ritland_2007)
The inverse variance estimate of the overall effect across strata
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
InverseVariance_estimate_stratified_2x2(n, link = "logit")
InverseVariance_estimate_stratified_2x2(n, link = "logit")
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
link |
the link function ('linear', 'log', or 'logit') |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
InverseVariance_estimate_stratified_2x2(doll_hill_1950) InverseVariance_estimate_stratified_2x2(hine_1989)
InverseVariance_estimate_stratified_2x2(doll_hill_1950) InverseVariance_estimate_stratified_2x2(hine_1989)
Jeffreys confidence interval for the binomial probability
Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Jeffreys_CI_1x2(X, n, alpha = 0.05)
Jeffreys_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Jeffreys_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Jeffreys_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Jeffreys_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Jeffreys_CI_1x2(X, n)) # alternative syntax Jeffreys_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
Jeffreys_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Jeffreys_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Jeffreys_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Jeffreys_CI_1x2(X, n)) # alternative syntax Jeffreys_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
The Jonckheere-Terpstra test for association
Described in Chapter 7 "The rxc Table"
JonckheereTerpstra_test_rxc(n)
JonckheereTerpstra_test_rxc(n)
n |
the observed table (an rxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
JonckheereTerpstra_test_rxc(table_7.7) JonckheereTerpstra_test_rxc(table_7.8) JonckheereTerpstra_test_rxc(table_7.9)
JonckheereTerpstra_test_rxc(table_7.7) JonckheereTerpstra_test_rxc(table_7.8) JonckheereTerpstra_test_rxc(table_7.9)
The Katz log confidence interval for the ratio of probabilities
Described in Chapter 4 "The 2x2 Table"
Katz_log_CI_2x2(n, alpha = 0.05)
Katz_log_CI_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Katz_log_CI_2x2(perondi_2004) Katz_log_CI_2x2(ritland_2007)
Katz_log_CI_2x2(perondi_2004) Katz_log_CI_2x2(ritland_2007)
Kendall's tau-b with confidence interval based on the Fieller standard deviation
Described in Chapter 7 "The rxc Table"
Kendalls_tau_b_rxc(n, alpha = 0.05)
Kendalls_tau_b_rxc(n, alpha = 0.05)
n |
the observed table (an rxc matrix) |
alpha |
the nominal significance level, used to compute a 100(1-alpha)% confidence interval |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Kendalls_tau_b_rxc(table_7.7) Kendalls_tau_b_rxc(table_7.8) Kendalls_tau_b_rxc(table_7.9)
Kendalls_tau_b_rxc(table_7.7) Kendalls_tau_b_rxc(table_7.8) Kendalls_tau_b_rxc(table_7.9)
Kendall's tau-b with the bias-corrected and accelerated boostrap confidence interval
Described in Chapter 7 "The rxc Table"
Kendalls_tau_b_rxc_bca(n, nboot = 10000, alpha = 0.05)
Kendalls_tau_b_rxc_bca(n, nboot = 10000, alpha = 0.05)
n |
the observed table (an rxc matrix) |
nboot |
number of bootstrap samples |
alpha |
the nominal significance level, used to compute a 100(1-alpha) confidence interval |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
set.seed(9974) Kendalls_tau_b_rxc_bca(table_7.7, nboot = 800) Kendalls_tau_b_rxc_bca(table_7.8, nboot = 200) ## Not run: Kendalls_tau_b_rxc_bca(table_7.9) ## End(Not run)
set.seed(9974) Kendalls_tau_b_rxc_bca(table_7.7, nboot = 800) Kendalls_tau_b_rxc_bca(table_7.8, nboot = 200) ## Not run: Kendalls_tau_b_rxc_bca(table_7.9) ## End(Not run)
The Koopman asymptotic score confidence interval for the ratio of probabilities
Described in Chapter 4 "The 2x2 Table"
Koopman_asymptotic_score_CI_2x2(n, alpha = 0.05)
Koopman_asymptotic_score_CI_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
This versions uses the score test statistic of the Miettinen-Nurminen interval without the variance correction term.
Koopman_asymptotic_score_CI_2x2(perondi_2004) Koopman_asymptotic_score_CI_2x2(ritland_2007)
Koopman_asymptotic_score_CI_2x2(perondi_2004) Koopman_asymptotic_score_CI_2x2(ritland_2007)
The Kruskal-Wallis asymptotic test for singly ordered rxc tables
Described in Chapter 7 "The rxc Table"
KruskalWallis_asymptotic_test_rxc(n)
KruskalWallis_asymptotic_test_rxc(n)
n |
the observed counts (an rxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
KruskalWallis_asymptotic_test_rxc(table_7.5) KruskalWallis_asymptotic_test_rxc(table_7.6)
KruskalWallis_asymptotic_test_rxc(table_7.5) KruskalWallis_asymptotic_test_rxc(table_7.6)
A case-control study of GADA exposure on IPEX syndrome
lampasona_2013
lampasona_2013
An object of class matrix
(inherits from array
) with 2 rows and 2 columns.
Lampasona et al. (2013)
Ligarden et al., 2010
ligarden_2010
ligarden_2010
An object of class numeric
of length 2.
ligarden_2010
The linear-by-linear test for association
Described in Chapter 7 "The rxc Table"
linear_by_linear_test_rxc(n, a = seq_len(ncol(n)), b = seq_len(nrow(n)))
linear_by_linear_test_rxc(n, a = seq_len(ncol(n)), b = seq_len(nrow(n)))
n |
the observed table (an rxc matrix) |
a |
scores assigned to the rows |
b |
scores assigned to the columns |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
linear_by_linear_test_rxc(table_7.7) linear_by_linear_test_rxc(table_7.8) linear_by_linear_test_rxc(table_7.9)
linear_by_linear_test_rxc(table_7.7) linear_by_linear_test_rxc(table_7.8) linear_by_linear_test_rxc(table_7.9)
Complements the ?chapX
command by printing a list of
functions related to a particular chapter X
on the R console.
list_functions(chap_num)
list_functions(chap_num)
chap_num |
Number of book chapter (from 2 to 10) |
List of functions from that chapter
Waldir Leoncio
The likelihood ratio confidence interval for the binomial probability. Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
LR_CI_1x2(X, n, alpha = 0.05)
LR_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
LR_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) LR_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) LR_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], LR_CI_1x2(X, n)) # alternative syntax LR_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
LR_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) LR_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) LR_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], LR_CI_1x2(X, n)) # alternative syntax LR_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
The likelihood ratio test for the binomial probability (pi) H_0: pi = pi0 vs H_A: pi ~= pi0 (two-sided). Described in Chapter 2 "The 1x2 Table and the Binomial Distribution".
LR_test_1x2(X, n, pi0)
LR_test_1x2(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
LR_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = .5) LR_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = .5) LR_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = .5) LR_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = .5) LR_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = .5)
LR_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = .5) LR_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = .5) LR_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = .5) LR_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = .5) LR_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = .5)
The likelihood ratio test for multinomial probabilities
Described in Chapter 3 "The 1xc Table and the Multinomial Distribution"
LR_test_1xc(n, pi0)
LR_test_1xc(n, pi0)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
pi0 |
given probabilities (a 1xc vector) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Genotype counts for SNP rs 6498169 in RA patients LR_test_1xc(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients LR_test_1xc(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0)
# Genotype counts for SNP rs 6498169 in RA patients LR_test_1xc(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients LR_test_1xc(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0)
The likelihood ratio test for association in 2x2 tables
Described in Chapter 4 "The 2x2 Table"
LR_test_2x2(n)
LR_test_2x2(n)
n |
the observed counts (a 2x2 matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
LR_test_2x2(tea) LR_test_2x2(perondi_2004) LR_test_2x2(lampasona_2013) LR_test_2x2(ritland_2007)
LR_test_2x2(tea) LR_test_2x2(perondi_2004) LR_test_2x2(lampasona_2013) LR_test_2x2(ritland_2007)
Postoperative nausea
lydersen_2012a
lydersen_2012a
An object of class matrix
(inherits from array
) with 2 rows and 4 columns.
Lydersen et al. (2012a)
The Mantel-Haenszel estimate of the overall effect across strata
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
MantelHaenszel_estimate_stratified_2x2(n, link = "logit")
MantelHaenszel_estimate_stratified_2x2(n, link = "logit")
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
link |
the link function ('linear', 'log', or 'logit') |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
MantelHaenszel_estimate_stratified_2x2(doll_hill_1950) MantelHaenszel_estimate_stratified_2x2(hine_1989)
MantelHaenszel_estimate_stratified_2x2(doll_hill_1950) MantelHaenszel_estimate_stratified_2x2(hine_1989)
The Mantel-Haenszel test of association with column scores
Described in Chapter 6 "The Ordered 2xc Table"
MantelHaenszel_test_2xc(n, b = 0)
MantelHaenszel_test_2xc(n, b = 0)
n |
the observed counts (a 2xc matrix) |
b |
scores assigned to the columns (if b=0, midranks will be used as scores) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
MantelHaenszel_test_2xc(lydersen_2012a)
MantelHaenszel_test_2xc(lydersen_2012a)
The McNemar asymptotic test with continuity correction
Described in Chapter 8 "The Paired 2x2 Table"
McNemar_asymptotic_test_CC_paired_2x2(n)
McNemar_asymptotic_test_CC_paired_2x2(n)
n |
the observed table (a 2x2 matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
McNemar_asymptotic_test_CC_paired_2x2(bentur_2009) McNemar_asymptotic_test_CC_paired_2x2(cavo_2012) McNemar_asymptotic_test_CC_paired_2x2(ezra_2010)
McNemar_asymptotic_test_CC_paired_2x2(bentur_2009) McNemar_asymptotic_test_CC_paired_2x2(cavo_2012) McNemar_asymptotic_test_CC_paired_2x2(ezra_2010)
The McNemar asymptotic test
Described in Chapter 8 "The Paired 2x2 Table"
McNemar_asymptotic_test_paired_2x2(n)
McNemar_asymptotic_test_paired_2x2(n)
n |
the observed table (a 2x2 matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
McNemar_asymptotic_test_paired_2x2(bentur_2009) McNemar_asymptotic_test_paired_2x2(cavo_2012) McNemar_asymptotic_test_paired_2x2(ezra_2010)
McNemar_asymptotic_test_paired_2x2(bentur_2009) McNemar_asymptotic_test_paired_2x2(cavo_2012) McNemar_asymptotic_test_paired_2x2(ezra_2010)
The McNemar exact conditional test
Described in Chapter 8 "The Paired 2x2 Table"
McNemar_exact_cond_test_paired_2x2(n)
McNemar_exact_cond_test_paired_2x2(n)
n |
the observed table (a 2x2 matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
McNemar_exact_cond_test_paired_2x2(bentur_2009) McNemar_exact_cond_test_paired_2x2(cavo_2012) McNemar_exact_cond_test_paired_2x2(ezra_2010)
McNemar_exact_cond_test_paired_2x2(bentur_2009) McNemar_exact_cond_test_paired_2x2(cavo_2012) McNemar_exact_cond_test_paired_2x2(ezra_2010)
The McNemar exact unconditional test
Described in Chapter 8 "The Paired 2x2 Table"
McNemar_exact_unconditional_test_paired_2x2( n, gamma = 1e-04, num_pi_values = 1000L )
McNemar_exact_unconditional_test_paired_2x2( n, gamma = 1e-04, num_pi_values = 1000L )
n |
the observed table (a 2x2 matrix) |
gamma |
parameter for the Berger and Boos procedure (default=0.0001; gamma=0: no adj) |
num_pi_values |
number of values to use in the partition of the nuisance parameter space (default=1000) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Somewhat crude code with maximization over a simple partition of the
nuisance parameter space into 'num_pi_values' equally spaced values
The number may be changed. This method could be
improved with a better algorithm for the maximization; however, it works
well for most purposes. Try showplot=1
to get an indication of
the precision. A refinement of the maximization can be done with a manual
restriction of the parameter space.
McNemar_exact_unconditional_test_paired_2x2(bentur_2009) ## Not run: McNemar_exact_unconditional_test_paired_2x2(cavo_2012, gamma = 0) McNemar_exact_unconditional_test_paired_2x2(ezra_2010) ## End(Not run)
McNemar_exact_unconditional_test_paired_2x2(bentur_2009) ## Not run: McNemar_exact_unconditional_test_paired_2x2(cavo_2012, gamma = 0) McNemar_exact_unconditional_test_paired_2x2(ezra_2010) ## End(Not run)
The McNemar mid-P test
Described in Chapter 8 "The Paired 2x2 Table"
McNemar_midP_test_paired_2x2(n)
McNemar_midP_test_paired_2x2(n)
n |
the observed table (a 2x2 matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
McNemar_midP_test_paired_2x2(bentur_2009) McNemar_midP_test_paired_2x2(cavo_2012) McNemar_midP_test_paired_2x2(ezra_2010)
McNemar_midP_test_paired_2x2(bentur_2009) McNemar_midP_test_paired_2x2(cavo_2012) McNemar_midP_test_paired_2x2(ezra_2010)
The McNemar-Bowker test for marginal symmetry
Described in Chapter 9 "The Paired cxc Table"
McNemarBowker_test_paired_cxc(n)
McNemarBowker_test_paired_cxc(n)
n |
the observed table (a cxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Pretherapy susceptability of pathogens (Peterson et al., 2007) McNemarBowker_test_paired_cxc(peterson_2007)
# Pretherapy susceptability of pathogens (Peterson et al., 2007) McNemarBowker_test_paired_cxc(peterson_2007)
The Mee asymptotic score confidence interval for the difference between probabilities
Described in Chapter 4 "The 2x2 Table"
Mee_asymptotic_score_CI_2x2(n, alpha = 0.05)
Mee_asymptotic_score_CI_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004): Mee_asymptotic_score_CI_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): Mee_asymptotic_score_CI_2x2(ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004): Mee_asymptotic_score_CI_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): Mee_asymptotic_score_CI_2x2(ritland_2007)
The mid-P binomial test for the binomial probability (pi) H_0: pi = pi0 vs H_A: pi ~= pi0 (two-sided) Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
MidP_binomial_test_1x2(X, n, pi0)
MidP_binomial_test_1x2(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# The number of 1st order male births (Singh et al. 2010, adapted) MidP_binomial_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = .5) # The number of 2nd order male births (Singh et al. 2010, adapted) MidP_binomial_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = .5) # The number of 3rd order male births (Singh et al. 2010, adapted) MidP_binomial_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = .5) # The number of 4th order male births (Singh et al. 2010, adapted) MidP_binomial_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = .5) # Ligarden et al. (2010, adapted) MidP_binomial_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = .5)
# The number of 1st order male births (Singh et al. 2010, adapted) MidP_binomial_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = .5) # The number of 2nd order male births (Singh et al. 2010, adapted) MidP_binomial_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = .5) # The number of 3rd order male births (Singh et al. 2010, adapted) MidP_binomial_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = .5) # The number of 4th order male births (Singh et al. 2010, adapted) MidP_binomial_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = .5) # Ligarden et al. (2010, adapted) MidP_binomial_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = .5)
The mid-P multinomial test for multinomial probabilities
Described in Chapter 3 "The 1xc Table and the Multinomial Distribution"
MidP_multinomial_test_1xc(n, pi0)
MidP_multinomial_test_1xc(n, pi0)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
pi0 |
given probabilities (a 1xc vector) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Genotype counts for SNP rs 6498169 in RA patients MidP_multinomial_test_1xc(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients MidP_multinomial_test_1xc(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0)
# Genotype counts for SNP rs 6498169 in RA patients MidP_multinomial_test_1xc(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients MidP_multinomial_test_1xc(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0)
The Miettinen-Nurminen asymptotic score confidence interval for the
difference between probabilities
Described in Chapter 4 "The 2x2 Table"
MiettinenNurminen_asymptotic_score_CI_difference_2x2(n, alpha = 0.05)
MiettinenNurminen_asymptotic_score_CI_difference_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004): MiettinenNurminen_asymptotic_score_CI_difference_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): MiettinenNurminen_asymptotic_score_CI_difference_2x2(ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004): MiettinenNurminen_asymptotic_score_CI_difference_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): MiettinenNurminen_asymptotic_score_CI_difference_2x2(ritland_2007)
The Miettinen-Nurminen asymptotic score confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
MiettinenNurminen_asymptotic_score_CI_OR_2x2(n, alpha = 0.05)
MiettinenNurminen_asymptotic_score_CI_OR_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# A case-control study of GADA exposure on IPEX syndrome (Lampasona et al., 2013) MiettinenNurminen_asymptotic_score_CI_OR_2x2(lampasona_2013) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) MiettinenNurminen_asymptotic_score_CI_OR_2x2(ritland_2007)
# A case-control study of GADA exposure on IPEX syndrome (Lampasona et al., 2013) MiettinenNurminen_asymptotic_score_CI_OR_2x2(lampasona_2013) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) MiettinenNurminen_asymptotic_score_CI_OR_2x2(ritland_2007)
The Miettinen-Nurminen asymptotic score confidence interval for the ratio of probabilities
Described in Chapter 4 "The 2x2 Table"
MiettinenNurminen_asymptotic_score_CI_ratio_2x2(n, alpha = 0.05)
MiettinenNurminen_asymptotic_score_CI_ratio_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) MiettinenNurminen_asymptotic_score_CI_ratio_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) MiettinenNurminen_asymptotic_score_CI_ratio_2x2(ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) MiettinenNurminen_asymptotic_score_CI_ratio_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) MiettinenNurminen_asymptotic_score_CI_ratio_2x2(ritland_2007)
Alcohol consumption and malformations
mills_graubard_1987
mills_graubard_1987
An object of class matrix
(inherits from array
) with 5 rows and 2 columns.
Mills and Graubard (1987)
Calculate ML estimates
ML_estimates(...)
ML_estimates(...)
... |
arguments passed to methods |
This function has little use to the user, it is exported for confirmity to R package standards.
Maximum likelihood estimates with CIs of the grouping and strata effects
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
ML_estimates_and_CIs_stratified_2x2(n, link = "log", alpha = 0.05)
ML_estimates_and_CIs_stratified_2x2(n, link = "log", alpha = 0.05)
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
link |
the link function ('linear', 'log', or 'logit') |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Smoking and lung cancer (Doll and Hill, 1950) ML_estimates_and_CIs_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) ML_estimates_and_CIs_stratified_2x2(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) ML_estimates_and_CIs_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) ML_estimates_and_CIs_stratified_2x2(hine_1989)
The MOVER-R Wilson confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
MOVER_R_Wilson_CI_OR_2x2(n, alpha = 0.05)
MOVER_R_Wilson_CI_OR_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# A case-control study of GADA exposure on IPEX syndrome (Lampasona et al., 2013): MOVER_R_Wilson_CI_OR_2x2(lampasona_2013) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): MOVER_R_Wilson_CI_OR_2x2(ritland_2007)
# A case-control study of GADA exposure on IPEX syndrome (Lampasona et al., 2013): MOVER_R_Wilson_CI_OR_2x2(lampasona_2013) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): MOVER_R_Wilson_CI_OR_2x2(ritland_2007)
The MOVER-R Wilson confidence interval for the ratio of probabilities
Described in Chapter 4 "The 2x2 Table"
MOVER_R_Wilson_CI_ratio_2x2(n, alpha = 0.05)
MOVER_R_Wilson_CI_ratio_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) MOVER_R_Wilson_CI_ratio_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) MOVER_R_Wilson_CI_ratio_2x2(ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) MOVER_R_Wilson_CI_ratio_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) MOVER_R_Wilson_CI_ratio_2x2(ritland_2007)
The MOVER Wilson score confidence interval for the ratio of paired probabilities
Described in Chapter 8 "The Paired 2x2 Table"
MOVER_Wilson_score_CI_paired_2x2(n, alpha = 0.05)
MOVER_Wilson_score_CI_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
MOVER_Wilson_score_CI_paired_2x2(bentur_2009) MOVER_Wilson_score_CI_paired_2x2(cavo_2012)
MOVER_Wilson_score_CI_paired_2x2(bentur_2009) MOVER_Wilson_score_CI_paired_2x2(cavo_2012)
The Newcombe hybrid score confidence interval for the difference between probabilities
Described in Chapter 4 "The 2x2 Table"
Newcombe_hybrid_score_CI_2x2(n, alpha = 0.05)
Newcombe_hybrid_score_CI_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) Newcombe_hybrid_score_CI_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) Newcombe_hybrid_score_CI_2x2(ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) Newcombe_hybrid_score_CI_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) Newcombe_hybrid_score_CI_2x2(ritland_2007)
The Newcombe square-and-add confidence interval for the difference between paired probabilities.
Described in Chapter 8 "The Paired 2x2 Table"
Newcombe_square_and_add_CI_paired_2x2(n, alpha = 0.05)
Newcombe_square_and_add_CI_paired_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Newcombe_square_and_add_CI_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Newcombe_square_and_add_CI_paired_2x2(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Newcombe_square_and_add_CI_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Newcombe_square_and_add_CI_paired_2x2(cavo_2012)
The Pearson chi-squared test for multinomial probabilities
Described in Chapter 3 "The 1xc Table and the Multinomial Distribution"
Pearson_chi_squared_test_1xc(n, pi0)
Pearson_chi_squared_test_1xc(n, pi0)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
pi0 |
given probabilities (a 1xc vector) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Genotype counts for SNP rs 6498169 in RA patients Pearson_chi_squared_test_1xc(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients Pearson_chi_squared_test_1xc(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0)
# Genotype counts for SNP rs 6498169 in RA patients Pearson_chi_squared_test_1xc(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients Pearson_chi_squared_test_1xc(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0)
The Pearson chi-squared test for association in 2x2 tables
Described in Chapter 4 "The 2x2 Table"
Pearson_chi_squared_test_2x2(n)
Pearson_chi_squared_test_2x2(n)
n |
the observed counts (a 2x2 matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Example: A lady tasting a cup of tea Pearson_chi_squared_test_2x2(tea) # Example: Perondi et al. (2004) Pearson_chi_squared_test_2x2(perondi_2004) # Example: Lampasona et al. (2013) Pearson_chi_squared_test_2x2(lampasona_2013) # Example: Ritland et al. (2007) Pearson_chi_squared_test_2x2(ritland_2007)
# Example: A lady tasting a cup of tea Pearson_chi_squared_test_2x2(tea) # Example: Perondi et al. (2004) Pearson_chi_squared_test_2x2(perondi_2004) # Example: Lampasona et al. (2013) Pearson_chi_squared_test_2x2(lampasona_2013) # Example: Ritland et al. (2007) Pearson_chi_squared_test_2x2(ritland_2007)
The Pearson chi-squared test for association in 2x2 tables
with continuity correction
Described in Chapter 4 "The 2x2 Table"
Pearson_chi_squared_test_CC_2x2(n)
Pearson_chi_squared_test_CC_2x2(n)
n |
the observed counts (a 2x2 matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Example: A lady tasting a cup of tea Pearson_chi_squared_test_CC_2x2(tea) # Example: Perondi et al. (2004) Pearson_chi_squared_test_CC_2x2(perondi_2004) # Example: Lampasona et al. (2013) Pearson_chi_squared_test_CC_2x2(lampasona_2013) # Example: Ritland et al. (2007) Pearson_chi_squared_test_CC_2x2(ritland_2007)
# Example: A lady tasting a cup of tea Pearson_chi_squared_test_CC_2x2(tea) # Example: Perondi et al. (2004) Pearson_chi_squared_test_CC_2x2(perondi_2004) # Example: Lampasona et al. (2013) Pearson_chi_squared_test_CC_2x2(lampasona_2013) # Example: Ritland et al. (2007) Pearson_chi_squared_test_CC_2x2(ritland_2007)
The Pearson correlation coefficient
Described in Chapter 7 "The rxc Table"
Pearson_correlation_coefficient_rxc( n, a = seq_len(nrow(n)), b = seq_len(ncol(n)), alpha = 0.05 )
Pearson_correlation_coefficient_rxc( n, a = seq_len(nrow(n)), b = seq_len(ncol(n)), alpha = 0.05 )
n |
the observed table (an rxc matrix) |
a |
scores assigned to the rows |
b |
scores assigned to the columns |
alpha |
the nominal significance level, used to compute a 100(1-alpha) confidence interval |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Pearson_correlation_coefficient_rxc(table_7.7) Pearson_correlation_coefficient_rxc(table_7.8) Pearson_correlation_coefficient_rxc(table_7.9)
Pearson_correlation_coefficient_rxc(table_7.7) Pearson_correlation_coefficient_rxc(table_7.8) Pearson_correlation_coefficient_rxc(table_7.9)
The Pearson correlation coefficient with the bias-corrected and accelerated
boostrap confidence interval
Described in Chapter 7 "The rxc Table"
Pearson_correlation_coefficient_rxc_bca( n, nboot = 10000, a = seq_len(nrow(n)), b = seq_len(ncol(n)), alpha = 0.05 )
Pearson_correlation_coefficient_rxc_bca( n, nboot = 10000, a = seq_len(nrow(n)), b = seq_len(ncol(n)), alpha = 0.05 )
n |
the observed table (an rxc matrix) |
nboot |
number of bootstrap samples |
a |
scores assigned to the rows |
b |
scores assigned to the columns |
alpha |
the nominal significance level, used to compute a 100(1-alpha) confidence interval |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
set.seed(3509) Pearson_correlation_coefficient_rxc_bca(table_7.7, nboot = 800) Pearson_correlation_coefficient_rxc_bca(table_7.8, nboot = 200) ## Not run: Pearson_correlation_coefficient_rxc_bca(table_7.9) ## End(Not run)
set.seed(3509) Pearson_correlation_coefficient_rxc_bca(table_7.7, nboot = 800) Pearson_correlation_coefficient_rxc_bca(table_7.8, nboot = 200) ## Not run: Pearson_correlation_coefficient_rxc_bca(table_7.9) ## End(Not run)
The Pearson chi-squared and likelihood ratio tests for homogeneity over strata
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
Pearson_LR_homogeneity_test_stratified_2x2(n, link = "logit")
Pearson_LR_homogeneity_test_stratified_2x2(n, link = "logit")
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
link |
the link function ('linear', 'log', or 'logit') |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Smoking and lung cancer (Doll and Hill, 1950) Pearson_LR_homogeneity_test_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Pearson_LR_homogeneity_test_stratified_2x2(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) Pearson_LR_homogeneity_test_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Pearson_LR_homogeneity_test_stratified_2x2(hine_1989)
The Pearson chi-squared and likelihood ratio tests of a common difference
between probabilities (link = 'linear'), ratio of probabilities (link =
'log'), or odds ratio (link = 'logit')
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
Pearson_LR_test_common_effect_stratified_2x2(n, link = "logit")
Pearson_LR_test_common_effect_stratified_2x2(n, link = "logit")
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
link |
the link function ('linear', 'log', or 'logit') |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Smoking and lung cancer (Doll and Hill, 1950) Pearson_LR_test_common_effect_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Pearson_LR_test_common_effect_stratified_2x2(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) Pearson_LR_test_common_effect_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Pearson_LR_test_common_effect_stratified_2x2(hine_1989)
The Pearson chi-squared and likelihood ratio tests for cumulative ORs in 2xc tables
Described in Chapter 6 "The Ordered 2xc Table"
Pearson_LR_tests_cum_OR_2xc(n, direction = "decreasing")
Pearson_LR_tests_cum_OR_2xc(n, direction = "decreasing")
n |
the observed counts (a 2xc matrix) |
direction |
the direction of column probabilities ("increasing" or "decreasing") |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Postoperative nausea (Lydersen et al., 2012a) Pearson_LR_tests_cum_OR_2xc(lydersen_2012a)
# Postoperative nausea (Lydersen et al., 2012a) Pearson_LR_tests_cum_OR_2xc(lydersen_2012a)
The Pearson chi-squared and likelihood ratio tests for association in rxc tables
Described in Chapter 7 "The rxc Table"
Pearson_LR_tests_rxc(n)
Pearson_LR_tests_rxc(n)
n |
the observed counts (an rxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Examples from Chapter 5 (ordered rx2 tables) ## Alcohol consumption and malformations (Mills and Graubard, 1987): Pearson_LR_tests_rxc(mills_graubard_1987) ## Elevated troponin T levels in stroke patients (Indredavik et al., 2008): Pearson_LR_tests_rxc(indredavik_2008) # Examples from Chapter 6 (ordered 2xc tables) ## The Adolescent Placement Study (Fontanella et al., 2008): Pearson_LR_tests_rxc(fontanella_2008) ## Postoperative nausea (Lydersen et al., 2012a): Pearson_LR_tests_rxc(lydersen_2012a) # Examples from Chapter 7 (unordered rxc tables) ## Treatment for ear infection (van Balen et al., 2003): Pearson_LR_tests_rxc(table_7.3) ## Psychiatric diagnoses vs PA (Mangerud et al., 2004): Pearson_LR_tests_rxc(table_7.4) ## Psychiatric diag. vs BMI (Mangerud et al., 2004): Pearson_LR_tests_rxc(table_7.5)
# Examples from Chapter 5 (ordered rx2 tables) ## Alcohol consumption and malformations (Mills and Graubard, 1987): Pearson_LR_tests_rxc(mills_graubard_1987) ## Elevated troponin T levels in stroke patients (Indredavik et al., 2008): Pearson_LR_tests_rxc(indredavik_2008) # Examples from Chapter 6 (ordered 2xc tables) ## The Adolescent Placement Study (Fontanella et al., 2008): Pearson_LR_tests_rxc(fontanella_2008) ## Postoperative nausea (Lydersen et al., 2012a): Pearson_LR_tests_rxc(lydersen_2012a) # Examples from Chapter 7 (unordered rxc tables) ## Treatment for ear infection (van Balen et al., 2003): Pearson_LR_tests_rxc(table_7.3) ## Psychiatric diagnoses vs PA (Mangerud et al., 2004): Pearson_LR_tests_rxc(table_7.4) ## Psychiatric diag. vs BMI (Mangerud et al., 2004): Pearson_LR_tests_rxc(table_7.5)
The Pearson chi-squared and likelihood ratio tests for unspecific ordering in rx2 tables. Described in Chapter 5 "The Ordered rx2 Table". May also be used for 2xc tables, after flipping rows and columns (i.e. if n is a 2xc table, call this function with n' (the transpose of n) as the first argument).
Pearson_LR_tests_unspecific_ordering_rx2(n, direction)
Pearson_LR_tests_unspecific_ordering_rx2(n, direction)
n |
the observed counts (an rx2 matrix) |
direction |
the direction of the success probabilities ("increasing" or "decreasing") |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Chapter 5: Alcohol consumption and malformations (Mills and Graubard, 1987) Pearson_LR_tests_unspecific_ordering_rx2(mills_graubard_1987, "increasing") # Chapter 5: Elevated troponin T levels in stroke patients (Indredavik et al., 2008) Pearson_LR_tests_unspecific_ordering_rx2(indredavik_2008, "decreasing") # Chapter 6: Postoperative nausea (Lydersen et al., 2012a) Pearson_LR_tests_unspecific_ordering_rx2(t(lydersen_2012a), "decreasing")
# Chapter 5: Alcohol consumption and malformations (Mills and Graubard, 1987) Pearson_LR_tests_unspecific_ordering_rx2(mills_graubard_1987, "increasing") # Chapter 5: Elevated troponin T levels in stroke patients (Indredavik et al., 2008) Pearson_LR_tests_unspecific_ordering_rx2(indredavik_2008, "decreasing") # Chapter 6: Postoperative nausea (Lydersen et al., 2012a) Pearson_LR_tests_unspecific_ordering_rx2(t(lydersen_2012a), "decreasing")
The Pearson residuals and the standardized Pearson residuals
Described in Chapter 7 "The rxc Table"
Pearson_residuals_rxc(n)
Pearson_residuals_rxc(n)
n |
the observed counts (an rxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
## Treatment for ear infection (van Balen et al., 2003): Pearson_residuals_rxc(table_7.3) ## Psychiatric diagnoses vs PA (Mangerud et al., 2004): Pearson_residuals_rxc(table_7.4) ## Psychiatric diag. vs BMI (Mangerud et al., 2004): Pearson_residuals_rxc(table_7.5)
## Treatment for ear infection (van Balen et al., 2003): Pearson_residuals_rxc(table_7.3) ## Psychiatric diagnoses vs PA (Mangerud et al., 2004): Pearson_residuals_rxc(table_7.4) ## Psychiatric diag. vs BMI (Mangerud et al., 2004): Pearson_residuals_rxc(table_7.5)
An RCT of high vs standard dose of epinephrine
perondi_2004
perondi_2004
An object of class matrix
(inherits from array
) with 2 rows and 2 columns.
Perondi et al. (2004)
Pretherapy susceptability of pathogens
peterson_2007
peterson_2007
An object of class matrix
(inherits from array
) with 4 rows and 4 columns.
Peterson et al. (2007)
The Peto test for homogeneity of odds ratios over strata
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
Peto_homogeneity_test_stratified_2x2(n)
Peto_homogeneity_test_stratified_2x2(n)
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
# Smoking and lung cancer (Doll and Hill, 1950) Peto_homogeneity_test_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Peto_homogeneity_test_stratified_2x2(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) Peto_homogeneity_test_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Peto_homogeneity_test_stratified_2x2(hine_1989)
The Peto estimate of the common odds ratio across strata
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
Peto_OR_estimate_stratified_2x2(n)
Peto_OR_estimate_stratified_2x2(n)
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Smoking and lung cancer (Doll and Hill, 1950) Peto_OR_estimate_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Peto_OR_estimate_stratified_2x2(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) Peto_OR_estimate_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Peto_OR_estimate_stratified_2x2(hine_1989)
The Price-Bonett approximate Bayes confidence interval for the ratio of probabilities
Described in Chapter 4 "The 2x2 Table"
PriceBonett_approximate_Bayes_CI_2x2(n, a = 1.25, b = 2.5, alpha = 0.05)
PriceBonett_approximate_Bayes_CI_2x2(n, a = 1.25, b = 2.5, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
a , b
|
parameters of the beta distribution |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) PriceBonett_approximate_Bayes_CI_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) PriceBonett_approximate_Bayes_CI_2x2(ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) PriceBonett_approximate_Bayes_CI_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) PriceBonett_approximate_Bayes_CI_2x2(ritland_2007)
Output from a contingency tables method
## S3 method for class 'contingencytables_result' print(x, as_list = FALSE, ...)
## S3 method for class 'contingencytables_result' print(x, as_list = FALSE, ...)
x |
The output from a function from the contingencytables package |
as_list |
Print the elements of |
... |
unused (kept for consistency with the generic |
The Quesenberry-Hurst Wilson score simultaneous intervals for the multinomial probabilities
(with Scheffe adjustment)
Described in Chapter 3 "The 1xc Table and the Multinomial Distribution"
QuesenberryHurst_Wilson_score_CIs_1xc(n, alpha = 0.05)
QuesenberryHurst_Wilson_score_CIs_1xc(n, alpha = 0.05)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Genotype counts for SNP rs 6498169 in RA patients QuesenberryHurst_Wilson_score_CIs_1xc(n = snp6498169$complete$n)
# Genotype counts for SNP rs 6498169 in RA patients QuesenberryHurst_Wilson_score_CIs_1xc(n = snp6498169$complete$n)
The RBG test and CI for a common odds ratio
(A Wald-type test and CI based on the Mantel-Haenszel estimate)
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
RBG_test_and_CI_stratified_2x2(n, alpha = 0.05)
RBG_test_and_CI_stratified_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Smoking and lung cancer (Doll and Hill, 1950) RBG_test_and_CI_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) RBG_test_and_CI_stratified_2x2(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) RBG_test_and_CI_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) RBG_test_and_CI_stratified_2x2(hine_1989)
The association between CHRNA4 genotype and XFS
ritland_2007
ritland_2007
An object of class matrix
(inherits from array
) with 2 rows and 2 columns.
Ritland et al. (2007)
Scheffe-type confidence intervals for differences of marginal probabilities
Described in Chapter 9 "The Paired kxk Table"
Scheffe_type_CIs_paired_cxc(n, alpha = 0.05)
Scheffe_type_CIs_paired_cxc(n, alpha = 0.05)
n |
the observed table (a cxc matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Pretherapy susceptability of pathogens (Peterson et al., 2007) Scheffe_type_CIs_paired_cxc(peterson_2007)
# Pretherapy susceptability of pathogens (Peterson et al., 2007) Scheffe_type_CIs_paired_cxc(peterson_2007)
The Scheffe-type simultaneous confidence intervals for the differences pi_1|i - pi_1|j
Described in Chapter 7 "The rxc Table"
Scheffe_type_CIs_rxc(n, alpha = 0.05)
Scheffe_type_CIs_rxc(n, alpha = 0.05)
n |
the observed counts (an rx2 vector) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Example: Treatment for ear infection Scheffe_type_CIs_rxc(table_7.3)
# Example: Treatment for ear infection Scheffe_type_CIs_rxc(table_7.3)
The score test for the binomial probability (pi) H_0: pi = pi0 vs H_A: pi ~= pi0 (two-sided) Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Score_test_1x2(X, n, pi0)
Score_test_1x2(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# The number of 1st order male births (Singh et al. 2010, adapted) Score_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = .5) # The number of 2nd order male births (Singh et al. 2010, adapted) Score_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = .5) # The number of 3rd order male births (Singh et al. 2010, adapted) Score_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = .5) # The number of 4th order male births (Singh et al. 2010, adapted) Score_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = .5) # Ligarden et al. (2010, adapted) Score_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = .5)
# The number of 1st order male births (Singh et al. 2010, adapted) Score_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = .5) # The number of 2nd order male births (Singh et al. 2010, adapted) Score_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = .5) # The number of 3rd order male births (Singh et al. 2010, adapted) Score_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = .5) # The number of 4th order male births (Singh et al. 2010, adapted) Score_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = .5) # Ligarden et al. (2010, adapted) Score_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = .5)
The score test and confidence interval for the difference between marginal mean scores Described in Chapter 9 "The Paired cxc Table"
Score_test_and_CI_marginal_mean_scores_paired_cxc( n, a = seq_len(nrow(n)), alpha = 0.05 )
Score_test_and_CI_marginal_mean_scores_paired_cxc( n, a = seq_len(nrow(n)), alpha = 0.05 )
n |
the observed table (a cxc matrix) |
a |
scores assigned to the outcome categories |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# A comparison between serial and retrospective measurements # (Fischer et al., 1999) a <- c(8, 3.5, 0, -3.5, -8) Score_test_and_CI_marginal_mean_scores_paired_cxc(fischer_1999, a)
# A comparison between serial and retrospective measurements # (Fischer et al., 1999) a <- c(8, 3.5, 0, -3.5, -8) Score_test_and_CI_marginal_mean_scores_paired_cxc(fischer_1999, a)
The score test with continuity correction for the binomial probability (pi). H_0: pi = pi0 vs H_A: pi ~= pi0 (two-sided). Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Score_test_CC_1x2(X, n, pi0)
Score_test_CC_1x2(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# The number of 1st order male births (Singh et al. 2010, adapted) Score_test_CC_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = .5) # The number of 2nd order male births (Singh et al. 2010, adapted) Score_test_CC_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = .5) # The number of 3rd order male births (Singh et al. 2010, adapted) Score_test_CC_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = .5) # The number of 4th order male births (Singh et al. 2010, adapted) Score_test_CC_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = .5) # Ligarden et al. (2010, adapted) Score_test_CC_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = .5)
# The number of 1st order male births (Singh et al. 2010, adapted) Score_test_CC_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = .5) # The number of 2nd order male births (Singh et al. 2010, adapted) Score_test_CC_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = .5) # The number of 3rd order male births (Singh et al. 2010, adapted) Score_test_CC_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = .5) # The number of 4th order male births (Singh et al. 2010, adapted) Score_test_CC_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = .5) # Ligarden et al. (2010, adapted) Score_test_CC_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = .5)
The score test for effect in the cumulative probit model described in Chapter 6 "The Ordered 2xc Table"
Score_test_for_effect_in_the_probit_model_2xc(n, alphahat0)
Score_test_for_effect_in_the_probit_model_2xc(n, alphahat0)
n |
the observed counts (a 2xc matrix) |
alphahat0 |
a column vector with c-1 estimated coefficients
( |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Must give the alphahats under the null hypothesis as input, because Matlab does not calculate an intercept-only probit model (and this may apply to R code as well). alphahat0 can be calculated in, for instance, Stata.
# The Adolescent Placement Study (Fontanella et al., 2008) alphahat0 <- c(-1.246452, -0.5097363, 0.2087471) Score_test_for_effect_in_the_probit_model_2xc(fontanella_2008, alphahat0) # Postoperative nausea (Lydersen et al., 2012a) alphahat0 <- c(-0.1923633, 0.5588396, 1.271953) Score_test_for_effect_in_the_probit_model_2xc(lydersen_2012a, alphahat0)
# The Adolescent Placement Study (Fontanella et al., 2008) alphahat0 <- c(-1.246452, -0.5097363, 0.2087471) Score_test_for_effect_in_the_probit_model_2xc(fontanella_2008, alphahat0) # Postoperative nausea (Lydersen et al., 2012a) alphahat0 <- c(-0.1923633, 0.5588396, 1.271953) Score_test_for_effect_in_the_probit_model_2xc(lydersen_2012a, alphahat0)
Calculate ML estimates
score_test_statistic(...)
score_test_statistic(...)
... |
arguments passed to methods |
This function has little use to the user, it is exported for confirmity to R package standards.
The number of n-th order male births
singh_2010
singh_2010
An object of class data.frame
with 4 rows and 2 columns.
Singh et al. (2010)
Genotype counts for SNP rs 6498169 in RA patients
snp6498169
snp6498169
An object of class list
of length 2.
The Spearman correlation coefficient
Described in Chapter 7 "The rxc Table"
Spearman_correlation_coefficient_rxc(n, alpha = 0.05)
Spearman_correlation_coefficient_rxc(n, alpha = 0.05)
n |
the observed table (an rxc matrix) |
alpha |
the nominal significance level, used to compute a 100(1-alpha)# confidence interval |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Spearman_correlation_coefficient_rxc(table_7.7) Spearman_correlation_coefficient_rxc(table_7.8) Spearman_correlation_coefficient_rxc(table_7.9)
Spearman_correlation_coefficient_rxc(table_7.7) Spearman_correlation_coefficient_rxc(table_7.8) Spearman_correlation_coefficient_rxc(table_7.9)
The Spearman correlation coefficient with the bias-corrected and accelerated
boostrap confidence interval
Described in Chapter 7 "The rxc Table"
Spearman_correlation_coefficient_rxc_bca(n, nboot = 10000, alpha = 0.05)
Spearman_correlation_coefficient_rxc_bca(n, nboot = 10000, alpha = 0.05)
n |
the observed table (an rxc matrix) |
nboot |
number of bootstrap samples |
alpha |
the nominal significance level, used to compute a 100(1-alpha) confidence interval |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
set.seed(2921) Spearman_correlation_coefficient_rxc_bca(table_7.7, nboot = 800) Spearman_correlation_coefficient_rxc_bca(table_7.8, nboot = 200) ## Not run: Spearman_correlation_coefficient_rxc_bca(table_7.9) ## End(Not run)
set.seed(2921) Spearman_correlation_coefficient_rxc_bca(table_7.7, nboot = 800) Spearman_correlation_coefficient_rxc_bca(table_7.8, nboot = 200) ## Not run: Spearman_correlation_coefficient_rxc_bca(table_7.9) ## End(Not run)
Stratified 2x2 tables
stratified_2x2_tables(n, alpha = 0.05)
stratified_2x2_tables(n, alpha = 0.05)
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
NULL. This function should be called for its printed output
# Smoking and lung cancer (Doll and Hill, 1950) stratified_2x2_tables(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) stratified_2x2_tables(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) stratified_2x2_tables(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) stratified_2x2_tables(hine_1989)
The Stuart test for marginal homogeneity
Described in Chapter 9 "The Paired cxc Table"
Stuart_test_paired_cxc(n)
Stuart_test_paired_cxc(n)
n |
the observed table (a cxc matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Pretherapy susceptability of pathogens (Peterson et al., 2007) Stuart_test_paired_cxc(peterson_2007)
# Pretherapy susceptability of pathogens (Peterson et al., 2007) Stuart_test_paired_cxc(peterson_2007)
Status after 21 days treatment of the ear infection acute otitis externa (Van Balen et al., 2003).
Van Balen et al. (2003) report a randomized, double-blind, controlled trial comparing three treatments for an ear infection. The numbers and proportions of patients reported cured and not cured after 21 days of treatment are summarized in Table 7.3. Because there is no ordering between the treatments, we regard Table 7.3 as an unordered 3 × 2 table.
table_7.3 vanbalen_2003
table_7.3 vanbalen_2003
An object of class matrix
(inherits from array
) with 3 rows and 2 columns.
Fagerland MW, Lydersen S, Laake P (2017)
Van Balen et al. (2003)
Psychiatric diagnoses and participation in team sports (Mangerud et al., 2014)
Table 7.4 shows the number of subjects participating in team sports within each of six psychiatric diagnoses, based on data from a study of physical activity in adolescents aged 13 to 18 years who were referred to a child and adolescent psychiatric clinic from 2009 to 2001 (Mangerud et al., 2014). The psychiatric diagnoses are unordered, and we shall treat this as an unordered 6 x 2 table
table_7.4 mangerud_2014_PA
table_7.4 mangerud_2014_PA
An object of class matrix
(inherits from array
) with 6 rows and 2 columns.
Fagerland MW, Lydersen S, Laake P (2017)
Psychiatric diagnoses and weight categories based on age- and sex-adjusted BMI (Mangerud et al., 2014).
Table 7.5 shows the number of thin, normal weight, and overweight subjects within each of six psychiatric diagnoses, based on the same study as in Section 7.2.2 (Mangerud et al., 2014). Body mass index (BMI) is calculated as the weight in kg divided by the squared height in meters. In subjects aged 18 years or older, the cut-off points for being categorized as thin, normal weight, and overweight are BMI less than 18.5, BMI between 18.5 and 25, and BMI above 25, respectively. For younger subjects (below 18 years of age), the categorization was done following internationally adopted cut-off points for age and sex (Cole et al., 2000, 2007). For example, the cut-off point for being overweight at age 13 is 21.91 for males and 22.58 for females.
table_7.5 mangerud_2014_BMI
table_7.5 mangerud_2014_BMI
An object of class matrix
(inherits from array
) with 6 rows and 3 columns.
Fagerland MW, Lydersen S, Laake P (2017)
Mangerud et al. (2014)
Categories of birth weight and psychiatric problems at age 20 years (Lund et al., 2012).
Lund et al. (2012) report psychiatric morbidity in young adulthood in two low birth weight groups and a control group. The subjects were born between 1986 and 1988. The very low birth weight (VLBW) group consisted of babies born preterm with birth weight up to 1500 grams. The small for gestational age at term (SGA) group was born at term with birth weight below the 10th percentile adjusted for gestational age, sex, and parity. The control group was born at term, and was not small for gestational age. Table 7.6 shows the severity level of psychiatric problems at age 20 years. We shall regard the birth groups as unordered; however, the diagnostic groups are naturally ordered. Hence, Table 7.6 is a singly ordered 3 × 3 table with unordered rows and ordered columns.
table_7.6 lund_2012
table_7.6 lund_2012
An object of class matrix
(inherits from array
) with 3 rows and 3 columns.
Fagerland MW, Lydersen S, Laake P (2017)
Lund et al. (2012)
Duration of symptoms and tumor stage for patients treated for colorectal cancer (Jullumstroe et al., 2009).
Early detection and treatment of colorectal cancer is beneficial, because advanced stages of colorectal cancer have poorer prognosis. Table 7.7 displays duration of symptoms (rows) versus tumor stage (columns) in a study of 784 patients treated for colorectal cancer at a regional hospital in Norway from 1980 to 2004 (Jullumstroe et al., 2009). The rows as well as the columns are ordered, and Table 7.7 can be regarded as a doubly ordered 4 × 4 table.
table_7.7 jullumstroe_2009
table_7.7 jullumstroe_2009
An object of class matrix
(inherits from array
) with 4 rows and 4 columns.
Fagerland MW, Lydersen S, Laake P (2017)
Jullumstroe et al. (2009)
Nuclear pleomorphism from fine needle aspiration smears and breast tumor type (Bofin et al., 2004).
Bofin et al. (2004) studied associations between different findings in fine needle aspiration (FNA) smears from breast tumors and the final histological diagnosis of tumor type in 133 patients. The aim of the study was to identify variables developed from FNA smears that could differentiate between the different tumor diagnoses. Table 7.8 presents the cross-classification of the FNA variable nuclear pleomorphism with tumor types. Both variables can be considered as ordered, with tumor type ordered from benign (as in NPBD) to most malign (as in IDC).
table_7.8 bofin_2004
table_7.8 bofin_2004
An object of class matrix
(inherits from array
) with 3 rows and 5 columns.
Fagerland MW, Lydersen S, Laake P (2017)
Bofin et al. (2004)
Self-rated health for 12 to 17 years old adolescents in Young-HUNT 1 and four years later in Young-HUNT 2 (Breidablik et al., 2008).
In the HUNT study (Nord-Trøndelag county health survey), one of the questions is: “How is your overall health at the moment?” The outcome categories are “Very good”, “Good”, “Not very good”, and “Poor”. Table 7.9 shows the counts for the adolescents aged 12 to 17 years in 1995 to 1997 (Young-HUNT 1), and for the same individuals four years later (Young-HUNT 2; Breidablik et al. (2008)). Both the rows and the columns are ordered. In this example, it may be appropriate to regard self-rated health as an unobserved (latent) continuous variable, where only a categorized version has been observed. Table 7.9 is actually an example of a paired c × c table with ordinal data.
table_7.9 breidablik_2008
table_7.9 breidablik_2008
An object of class matrix
(inherits from array
) with 4 rows and 4 columns.
Fagerland MW, Lydersen S, Laake P (2017)
Breidablik et al. (2008)
The Tang asymptotic score confidence interval for the ratio of paired probabilities
Described in Chapter 8 "The Paired 2x2 Table"
Tang_asymptotic_score_CI_paired_2x2(n, alpha = 0.05)
Tang_asymptotic_score_CI_paired_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Tang_asymptotic_score_CI_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Tang_asymptotic_score_CI_paired_2x2(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Tang_asymptotic_score_CI_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Tang_asymptotic_score_CI_paired_2x2(cavo_2012)
The Tango asymptotic score confidence interval for the difference between paired probabilities
Described in Chapter 8 "The Paired 2x2 Table"
Tango_asymptotic_score_CI_paired_2x2(n, alpha = 0.05)
Tango_asymptotic_score_CI_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Tango_asymptotic_score_CI_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Tango_asymptotic_score_CI_paired_2x2(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Tango_asymptotic_score_CI_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Tango_asymptotic_score_CI_paired_2x2(cavo_2012)
A lady tasting a cup of tea
tea
tea
An object of class matrix
(inherits from array
) with 2 rows and 2 columns.
The 1x2 Table CIs
the_1x2_table_CIs(X, n, alpha = 0.05)
the_1x2_table_CIs(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
NULL. This function should be called for its printed output
# The number of 1st order male births (Singh et al. 2010) the_1x2_table_CIs(singh_2010["1st", "X"], singh_2010["1st", "n"]) # The number of 2nd order male births (Singh et al. 2010) the_1x2_table_CIs(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) # The number of 3rd order male births (Singh et al. 2010) the_1x2_table_CIs(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) # The number of 4th order male births (Singh et al. 2010) with(singh_2010["4th", ], the_1x2_table_CIs(X, n)) # alternative syntax # Ligarden et al. (2010) the_1x2_table_CIs(ligarden_2010["X"], ligarden_2010["n"])
# The number of 1st order male births (Singh et al. 2010) the_1x2_table_CIs(singh_2010["1st", "X"], singh_2010["1st", "n"]) # The number of 2nd order male births (Singh et al. 2010) the_1x2_table_CIs(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) # The number of 3rd order male births (Singh et al. 2010) the_1x2_table_CIs(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) # The number of 4th order male births (Singh et al. 2010) with(singh_2010["4th", ], the_1x2_table_CIs(X, n)) # alternative syntax # Ligarden et al. (2010) the_1x2_table_CIs(ligarden_2010["X"], ligarden_2010["n"])
The 1x2 Table tests
the_1x2_table_tests(X, n, pi0)
the_1x2_table_tests(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
NULL. This function should be called for its printed output
# Example: The number of 1st order male births (Singh et al. 2010) the_1x2_table_tests(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.513) # Example: The number of 2nd order male births (Singh et al. 2010) the_1x2_table_tests(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.513) # Example: The number of 3rd order male births (Singh et al. 2010) the_1x2_table_tests(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.513) # Example: The number of 4th order male births (Singh et al. 2010) the_1x2_table_tests(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.513) # Example: Ligarden et al. (2010) the_1x2_table_tests(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.5)
# Example: The number of 1st order male births (Singh et al. 2010) the_1x2_table_tests(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.513) # Example: The number of 2nd order male births (Singh et al. 2010) the_1x2_table_tests(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.513) # Example: The number of 3rd order male births (Singh et al. 2010) the_1x2_table_tests(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.513) # Example: The number of 4th order male births (Singh et al. 2010) the_1x2_table_tests(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.513) # Example: Ligarden et al. (2010) the_1x2_table_tests(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.5)
The 1xc table CIs
the_1xc_table_CIs(n, alpha = 0.05)
the_1xc_table_CIs(n, alpha = 0.05)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
NULL. This function should be called for its printed output
# Genotype counts for SNP rs 6498169 in RA patients the_1xc_table_CIs(n = snp6498169$complete$n)
# Genotype counts for SNP rs 6498169 in RA patients the_1xc_table_CIs(n = snp6498169$complete$n)
The 1xc table tests
the_1xc_table_tests(n, pi0, chacko.test = FALSE)
the_1xc_table_tests(n, pi0, chacko.test = FALSE)
n |
the observed counts (a 1xc vector, where c is the number of categories) |
pi0 |
given probabilities (a 1xc vector) |
chacko.test |
if TRUE, only performs the Chacko test |
NULL. This function should be called for its printed output
# Genotype counts for SNP rs 6498169 in RA patients the_1xc_table_tests(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients the_1xc_table_tests(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0) # Example for the Chacko test: Hypothetical experiment the_1xc_table_tests(n = hypothetical, pi0 = c(0.402, 0.479, 0.119), TRUE)
# Genotype counts for SNP rs 6498169 in RA patients the_1xc_table_tests(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0) # subset of 10 patients the_1xc_table_tests(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0) # Example for the Chacko test: Hypothetical experiment the_1xc_table_tests(n = hypothetical, pi0 = c(0.402, 0.479, 0.119), TRUE)
Wrapper for _CI_2x2
functions on Chapter 4.
the_2x2_table_CIs_difference(n, alpha = 0.05)
the_2x2_table_CIs_difference(n, alpha = 0.05)
n |
frequency matrix |
alpha |
type I error |
NULL. This function should be called for its printed output
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) the_2x2_table_CIs_difference(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) the_2x2_table_CIs_difference(ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) the_2x2_table_CIs_difference(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) the_2x2_table_CIs_difference(ritland_2007)
Wrapper for _CI_OR_2x2
functions on Chapter 4.
the_2x2_table_CIs_OR(n, alpha = 0.05)
the_2x2_table_CIs_OR(n, alpha = 0.05)
n |
frequency matrix |
alpha |
type I error |
NULL. This function should be called for its printed output
# Example: A lady tasting a cup of tea the_2x2_table_CIs_OR(tea) # Example: Perondi et al. (2004) the_2x2_table_CIs_OR(perondi_2004) # Example: Lampasona et al. (2013) the_2x2_table_CIs_OR(lampasona_2013) # Example: Ritland et al. (2007) the_2x2_table_CIs_OR(ritland_2007)
# Example: A lady tasting a cup of tea the_2x2_table_CIs_OR(tea) # Example: Perondi et al. (2004) the_2x2_table_CIs_OR(perondi_2004) # Example: Lampasona et al. (2013) the_2x2_table_CIs_OR(lampasona_2013) # Example: Ritland et al. (2007) the_2x2_table_CIs_OR(ritland_2007)
Wrapper for _CI_2x2
functions on Chapter 4.
the_2x2_table_CIs_ratio(n, alpha = 0.05)
the_2x2_table_CIs_ratio(n, alpha = 0.05)
n |
frequency matrix |
alpha |
type I error |
NULL. This function should be called for its printed output
the_2x2_table_CIs_difference the_2x2_table_CIs_OR the_2x2_table_tests
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) the_2x2_table_CIs_ratio(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) the_2x2_table_CIs_ratio(ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) the_2x2_table_CIs_ratio(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) the_2x2_table_CIs_ratio(ritland_2007)
Wrapper for _test_2x2
functions on Chapter 4.
the_2x2_table_tests(n, gamma = 1e-04)
the_2x2_table_tests(n, gamma = 1e-04)
n |
frequency matrix |
gamma |
parameter for the Berger and Boos procedure |
NULL. This function should be called for its printed output
# Example: A lady tasting a cup of tea the_2x2_table_tests(tea) # Example: Lampasona et al. (2013) the_2x2_table_tests(lampasona_2013) ## Not run: the_2x2_table_tests(perondi_2004) # Example: Perondi et al. (2004) the_2x2_table_tests(ritland_2007) # Example: Ritland et al. (2007) ## End(Not run)
# Example: A lady tasting a cup of tea the_2x2_table_tests(tea) # Example: Lampasona et al. (2013) the_2x2_table_tests(lampasona_2013) ## Not run: the_2x2_table_tests(perondi_2004) # Example: Perondi et al. (2004) the_2x2_table_tests(ritland_2007) # Example: Ritland et al. (2007) ## End(Not run)
The 2xc table
the_2xc_table(n, alpha = 0.05, direction = "increasing")
the_2xc_table(n, alpha = 0.05, direction = "increasing")
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
direction |
the direction of the success probabilities |
NULL. This function should be called for its printed output.
## Not run: # The Adolescent Placement Study (Fontanella et al., 2008) the_2xc_table(fontanella_2008) # Postoperative nausea (Lydersen et al., 2012a) the_2xc_table(lydersen_2012a, direction = "decreasing") ## End(Not run)
## Not run: # The Adolescent Placement Study (Fontanella et al., 2008) the_2xc_table(fontanella_2008) # Postoperative nausea (Lydersen et al., 2012a) the_2xc_table(lydersen_2012a, direction = "decreasing") ## End(Not run)
The Paired 2x2 table CIs difference
the_paired_2x2_table_CIs_difference(n, alpha = 0.05)
the_paired_2x2_table_CIs_difference(n, alpha = 0.05)
n |
frequency matrix |
alpha |
type I error |
NULL. This function should be called for its printed output.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) the_paired_2x2_table_CIs_difference(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) the_paired_2x2_table_CIs_difference(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) the_paired_2x2_table_CIs_difference(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) the_paired_2x2_table_CIs_difference(cavo_2012)
The Paired 2x2 table CIs OR
the_paired_2x2_table_CIs_OR(n, alpha = 0.05)
the_paired_2x2_table_CIs_OR(n, alpha = 0.05)
n |
frequency matrix |
alpha |
type I error |
NULL. This function should be called for its printed output.
the_paired_2x2_table_CIs_OR(ezra_2010)
the_paired_2x2_table_CIs_OR(ezra_2010)
The Paired 2x2 table CIs ratio
the_paired_2x2_table_CIs_ratio(n, alpha = 0.05)
the_paired_2x2_table_CIs_ratio(n, alpha = 0.05)
n |
frequency matrix |
alpha |
type I error |
NULL. This function should be called for its printed output.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) the_paired_2x2_table_CIs_ratio(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) the_paired_2x2_table_CIs_ratio(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) the_paired_2x2_table_CIs_ratio(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) the_paired_2x2_table_CIs_ratio(cavo_2012)
The Paired 2x2 table tests
the_paired_2x2_table_tests(n, gamma = 1e-04, num_pi_values = 1000L)
the_paired_2x2_table_tests(n, gamma = 1e-04, num_pi_values = 1000L)
n |
frequency matrix |
gamma |
parameter for the Berger and Boos procedure |
num_pi_values |
number of values to use in the partition of the nuisance parameter space (default=1000) |
NULL. This function should be called for its printed output.
the_paired_2x2_table_tests(bentur_2009) the_paired_2x2_table_tests(cavo_2012, gamma = 0, num_pi_values = 10) the_paired_2x2_table_tests(ezra_2010, gamma = 0, num_pi_values = 20)
the_paired_2x2_table_tests(bentur_2009) the_paired_2x2_table_tests(cavo_2012, gamma = 0, num_pi_values = 10) the_paired_2x2_table_tests(ezra_2010, gamma = 0, num_pi_values = 20)
The Paired CxC table - nominal
the_paired_cxc_table_nominal(n, alpha = 0.05)
the_paired_cxc_table_nominal(n, alpha = 0.05)
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
NULL. This function should be called for its printed output.
# Pretherapy susceptability of pathogens (Peterson et al., 2007) the_paired_cxc_table_nominal(peterson_2007)
# Pretherapy susceptability of pathogens (Peterson et al., 2007) the_paired_cxc_table_nominal(peterson_2007)
The Paired CxC table - ordinal
the_paired_cxc_table_ordinal(n, a = seq_len(nrow(n)), alpha = 0.05)
the_paired_cxc_table_ordinal(n, a = seq_len(nrow(n)), alpha = 0.05)
n |
the total number of observations |
a |
scores assigned to the outcome categories |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
NULL. This function should be called for its printed output.
the_paired_cxc_table_ordinal(fischer_1999, c(8, 3.5, 0, -3.5, -8))
the_paired_cxc_table_ordinal(fischer_1999, c(8, 3.5, 0, -3.5, -8))
The rx2 table
the_rx2_table(n, alpha = 0.05, direction = "increasing", skip_exact = FALSE)
the_rx2_table(n, alpha = 0.05, direction = "increasing", skip_exact = FALSE)
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
direction |
the direction of the success probabilities |
skip_exact |
If |
NULL. This function should be called for its printed output.
the_rx2_table(mills_graubard_1987, skip_exact = TRUE) the_rx2_table(indredavik_2008, direction = "decreasing", skip_exact = TRUE)
the_rx2_table(mills_graubard_1987, skip_exact = TRUE) the_rx2_table(indredavik_2008, direction = "decreasing", skip_exact = TRUE)
The rxc table
the_rxc_table(n, alpha = 0.05, nboot = 10000)
the_rxc_table(n, alpha = 0.05, nboot = 10000)
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
nboot |
number of boostrap samples. If 0, skips tests that use bootstrapping |
NULL. This function should be called for its printed output.
set.seed(8047) # Unordered tables ## Treatment for ear infection (van Balen et al., 2003) the_rxc_table(table_7.3, nboot = 200) ## Psychiatric diagnoses vs PA (Mangerud et al., 2004) the_rxc_table(table_7.4, nboot = 0) # Singly ordered tables ## Psychiatric diag. vs BMI (Mangerud et al., 2004) the_rxc_table(table_7.5, nboot = 0) ## Low birth weight vs psychiatric morbitidy (Lund et al., 2012) the_rxc_table(table_7.6, nboot = 150) # Doubly ordered tables ## Colorectal cancer (Jullumstroe et al., 2009) the_rxc_table(table_7.7, nboot = 0) ## Breast Tumor (Bofin et al., 2004) the_rxc_table(table_7.8, nboot = 200) ## Self-rated health (Breidablik et al., 2008) the_rxc_table(table_7.9, nboot = 0)
set.seed(8047) # Unordered tables ## Treatment for ear infection (van Balen et al., 2003) the_rxc_table(table_7.3, nboot = 200) ## Psychiatric diagnoses vs PA (Mangerud et al., 2004) the_rxc_table(table_7.4, nboot = 0) # Singly ordered tables ## Psychiatric diag. vs BMI (Mangerud et al., 2004) the_rxc_table(table_7.5, nboot = 0) ## Low birth weight vs psychiatric morbitidy (Lund et al., 2012) the_rxc_table(table_7.6, nboot = 150) # Doubly ordered tables ## Colorectal cancer (Jullumstroe et al., 2009) the_rxc_table(table_7.7, nboot = 0) ## Breast Tumor (Bofin et al., 2004) the_rxc_table(table_7.8, nboot = 200) ## Self-rated health (Breidablik et al., 2008) the_rxc_table(table_7.9, nboot = 0)
The Transformed Blaker exact confidence interval for the conditional odds ratio
Described in Chapter 8 "The Paired 2x2 Table"
Transformed_Blaker_exact_CI_paired_2x2(n, alpha = 0.05)
Transformed_Blaker_exact_CI_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Transformed_Blaker_exact_CI_paired_2x2(ezra_2010)
Transformed_Blaker_exact_CI_paired_2x2(ezra_2010)
The Transformed Clopper-Pearson exact confidence interval for the conditional odds ratio
Described in Chapter 8 "The Paired 2x2 Table"
Transformed_Clopper_Pearson_exact_CI_paired_2x2(n, alpha = 0.05)
Transformed_Clopper_Pearson_exact_CI_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Transformed_Clopper_Pearson_exact_CI_paired_2x2(ezra_2010)
Transformed_Clopper_Pearson_exact_CI_paired_2x2(ezra_2010)
The Transformed Clopper-Pearson mid-P confidence interval for the conditional odds ratio
Described in Chapter 8 "The Paired 2x2 Table"
Transformed_Clopper_Pearson_midP_CI_paired_2x2(n, alpha = 0.05)
Transformed_Clopper_Pearson_midP_CI_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Transformed_Clopper_Pearson_midP_CI_paired_2x2(ezra_2010)
Transformed_Clopper_Pearson_midP_CI_paired_2x2(ezra_2010)
The Transformed Wilson score confidence interval for the conditional odds ratio
Described in Chapter 8 "The Paired 2x2 Table"
Transformed_Wilson_score_CI_paired_2x2(n, alpha = 0.05)
Transformed_Wilson_score_CI_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Transformed_Wilson_score_CI_paired_2x2(ezra_2010)
Transformed_Wilson_score_CI_paired_2x2(ezra_2010)
Trend estimate for linear and logit models
The Wald test and CI
Likelihood ratio test
The Pearson goodness-of-fit test
Likelihood ratio (deviance) goodness-of-fit test
Described in Chapter 5 "The Ordered rx2 Table"
Trend_estimate_CI_tests_rx2( n, a = seq_len(nrow(n)), linkfunction = "logit", alpha = 0.05 )
Trend_estimate_CI_tests_rx2( n, a = seq_len(nrow(n)), linkfunction = "logit", alpha = 0.05 )
n |
the observed counts (an rx2 matrix) |
a |
scores assigned to the rows |
linkfunction |
Link function for the binomial distribution see
|
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Alcohol consumption and malformations (Mills and Graubard, 1987) Trend_estimate_CI_tests_rx2(mills_graubard_1987, 1:5) # levated troponin T levels in stroke patients (Indredavik et al., 2008) Trend_estimate_CI_tests_rx2(indredavik_2008, 1:5)
# Alcohol consumption and malformations (Mills and Graubard, 1987) Trend_estimate_CI_tests_rx2(mills_graubard_1987, 1:5) # levated troponin T levels in stroke patients (Indredavik et al., 2008) Trend_estimate_CI_tests_rx2(indredavik_2008, 1:5)
The uncorrected asymptotic score confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
Uncorrected_asymptotic_score_CI_2x2(n, alpha = 0.05)
Uncorrected_asymptotic_score_CI_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# A case-control study of GADA exposure on IPEX syndrome # (Lampasona et al., 2013): Uncorrected_asymptotic_score_CI_2x2(lampasona_2013) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): Uncorrected_asymptotic_score_CI_2x2(ritland_2007)
# A case-control study of GADA exposure on IPEX syndrome # (Lampasona et al., 2013): Uncorrected_asymptotic_score_CI_2x2(lampasona_2013) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): Uncorrected_asymptotic_score_CI_2x2(ritland_2007)
This is an internal function used by user-level functions to validate their arguments.
validateArguments(x, types = "default")
validateArguments(x, types = "default")
x |
named list containing function arguments and their values |
types |
named vector of types for |
Accepted validation types are:
"counts"
"positive"
"probability"
"linear, log or logit"
"MH or IV"
"logit or probit"
"increasing or decreasing"
A vector of possible values
Nothing if all arguments fit their type. An error message otherwise.
Types are evaluated alphabetically, and errors accuse no more than one invalid argument at a time.
Waldir Leoncio
Adjusted_inv_sinh_CI_OR_2x2(ritland_2007) ## Not run: Adjusted_inv_sinh_CI_OR_2x2(-ritland_2007)
Adjusted_inv_sinh_CI_OR_2x2(ritland_2007) ## Not run: Adjusted_inv_sinh_CI_OR_2x2(-ritland_2007)
Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Wald_CI_1x2(X, n, alpha = 0.05)
Wald_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Wald_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Wald_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Wald_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Wald_CI_1x2(X, n)) # alternative syntax Wald_CI_1x2(ligarden_2010["X"], ligarden_2010["n"]) # Ligarden et al. (2010)
Wald_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) Wald_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) Wald_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) with(singh_2010["4th", ], Wald_CI_1x2(X, n)) # alternative syntax Wald_CI_1x2(ligarden_2010["X"], ligarden_2010["n"]) # Ligarden et al. (2010)
The Wald confidence interval for the difference between probabilities
Described in Chapter 4 "The 2x2 Table"
Wald_CI_2x2(n, alpha = 0.05)
Wald_CI_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004): Wald_CI_2x2(n = perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): Wald_CI_2x2(n = ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004): Wald_CI_2x2(n = perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): Wald_CI_2x2(n = ritland_2007)
The Wald confidence interval for the difference between paired probabilities
with the pseudo-frequency adjustment suggested by Agresti and Min (2005)
Described in Chapter 8 "The Paired 2x2 Table"
Wald_CI_AgrestiMin_paired_2x2(n, alpha = 0.05)
Wald_CI_AgrestiMin_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_AgrestiMin_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_AgrestiMin_paired_2x2(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_AgrestiMin_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_AgrestiMin_paired_2x2(cavo_2012)
The Wald confidence interval for the difference between paired probabilities
with the pseudo-frequency adjustment suggested by Bonett and Price(2012)
Described in Chapter 8 "The Paired 2x2 Table"
Wald_CI_BonettPrice_paired_2x2(n, alpha = 0.05)
Wald_CI_BonettPrice_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_BonettPrice_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_BonettPrice_paired_2x2(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_BonettPrice_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_BonettPrice_paired_2x2(cavo_2012)
The Wald confidence interval with continuity correction for the binomial probability. Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Wald_CI_CC_1x2(X, n, alpha = 0.05)
Wald_CI_CC_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95# CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# The number of 1st order male births (Singh et al. 2010) Wald_CI_CC_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) # The number of 2nd order male births (Singh et al. 2010) Wald_CI_CC_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) # The number of 3rd order male births (Singh et al. 2010) Wald_CI_CC_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) # The number of 4th order male births (Singh et al. 2010) with(singh_2010["4th", ], Wald_CI_CC_1x2(X, n)) # alternative syntax # Ligarden et al. (2010) Wald_CI_CC_1x2(ligarden_2010["X"], ligarden_2010["n"])
# The number of 1st order male births (Singh et al. 2010) Wald_CI_CC_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) # The number of 2nd order male births (Singh et al. 2010) Wald_CI_CC_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) # The number of 3rd order male births (Singh et al. 2010) Wald_CI_CC_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) # The number of 4th order male births (Singh et al. 2010) with(singh_2010["4th", ], Wald_CI_CC_1x2(X, n)) # alternative syntax # Ligarden et al. (2010) Wald_CI_CC_1x2(ligarden_2010["X"], ligarden_2010["n"])
The Wald confidence interval for the difference between probabilities with Yates's continuity correction. Described in Chapter 4 "The 2x2 Table"
Wald_CI_CC_2x2(n, alpha = 0.05)
Wald_CI_CC_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) Wald_CI_CC_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) Wald_CI_CC_2x2(ritland_2007)
# An RCT of high vs standard dose of epinephrine (Perondi et al., 2004) Wald_CI_CC_2x2(perondi_2004) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007) Wald_CI_CC_2x2(ritland_2007)
The Wald confidence interval for the difference between paired probabilities
with continuity correction
Described in Chapter 8 "The Paired 2x2 Table"
Wald_CI_diff_CC_paired_2x2(n, alpha = 0.05)
Wald_CI_diff_CC_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_diff_CC_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_diff_CC_paired_2x2(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_diff_CC_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_diff_CC_paired_2x2(cavo_2012)
The Wald confidence interval for the difference between paired probabilities
Described in Chapter 8 "The Paired 2x2 Table"
Wald_CI_diff_paired_2x2(n, alpha = 0.05)
Wald_CI_diff_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_diff_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_diff_paired_2x2(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_diff_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_diff_paired_2x2(cavo_2012)
The Wald confidence interval for the conditional odds ratio with Laplace adjustment
Described in Chapter 8 "The Paired 2x2 Table"
Wald_CI_OR_Laplace_paired_2x2(n, alpha = 0.05)
Wald_CI_OR_Laplace_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Wald_CI_OR_Laplace_paired_2x2(ezra_2010)
Wald_CI_OR_Laplace_paired_2x2(ezra_2010)
The Wald confidence interval for the conditional odds ratio
Described in Chapter 8 "The Paired 2x2 Table"
Wald_CI_OR_paired_2x2(n, alpha = 0.05)
Wald_CI_OR_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Wald_CI_OR_paired_2x2(ezra_2010)
Wald_CI_OR_paired_2x2(ezra_2010)
The Wald confidence interval for the ratio of paired probabilities
Described in Chapter 8 "The Paired 2x2 Table"
Wald_CI_ratio_paired_2x2(n, alpha = 0.05)
Wald_CI_ratio_paired_2x2(n, alpha = 0.05)
n |
the observed counts (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_ratio_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_ratio_paired_2x2(cavo_2012)
# Airway hyper-responsiveness before and after stem cell transplantation # (Bentur et al., 2009) Wald_CI_ratio_paired_2x2(bentur_2009) # Complete response before and after consolidation therapy # (Cavo et al., 2012) Wald_CI_ratio_paired_2x2(cavo_2012)
The Wald test for the binomial probability (pi)
H_0: pi = pi0 vs H_A: pi ~= pi0 (two-sided)
Wald_test_1x2(X, n, pi0)
Wald_test_1x2(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# The number of 1st order male births (adapted from Singh et al. 2010) Wald_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.1) # The number of 2nd order male births (adapted from Singh et al. 2010) Wald_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.1) # The number of 3rd order male births (adapted from Singh et al. 2010) Wald_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.1) # The number of 4th order male births (adapted from Singh et al. 2010) Wald_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.1) # Ligarden et al. (2010) Wald_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.1)
# The number of 1st order male births (adapted from Singh et al. 2010) Wald_test_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.1) # The number of 2nd order male births (adapted from Singh et al. 2010) Wald_test_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.1) # The number of 3rd order male births (adapted from Singh et al. 2010) Wald_test_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.1) # The number of 4th order male births (adapted from Singh et al. 2010) Wald_test_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.1) # Ligarden et al. (2010) Wald_test_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.1)
The Wald test and CI for a common difference between probabilities based on either the Mantel-Haenszel or inverse variance estimate
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
Wald_test_and_CI_common_diff_stratified_2x2( n, estimatetype = "MH", alpha = 0.05 )
Wald_test_and_CI_common_diff_stratified_2x2( n, estimatetype = "MH", alpha = 0.05 )
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
estimatetype |
Mantel-Haenszel or inverse variance estimate ('MH' or 'IV') |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Smoking and lung cancer (Doll and Hill, 1950) Wald_test_and_CI_common_diff_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Wald_test_and_CI_common_diff_stratified_2x2(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) Wald_test_and_CI_common_diff_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Wald_test_and_CI_common_diff_stratified_2x2(hine_1989)
The Wald test and CI for a common ratio of probabilities
based on either the Mantel-Haenszel or inverse variance estimate
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
Wald_test_and_CI_common_ratio_stratified_2x2( n, estimatetype = "MH", alpha = 0.05 )
Wald_test_and_CI_common_ratio_stratified_2x2( n, estimatetype = "MH", alpha = 0.05 )
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
estimatetype |
Mantel-Haenszel or inverse variance estimate ('MH' or 'IV') |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Smoking and lung cancer (Doll and Hill, 1950) Wald_test_and_CI_common_ratio_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Wald_test_and_CI_common_ratio_stratified_2x2(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) Wald_test_and_CI_common_ratio_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Wald_test_and_CI_common_ratio_stratified_2x2(hine_1989)
The Wald test and confidence interval for the difference between marginal mean ranks / ridits
Described in Chapter 9 "The Paired cxc Table"
Wald_test_and_CI_marginal_mean_ranks_paired_cxc(n, alpha = 0.05)
Wald_test_and_CI_marginal_mean_ranks_paired_cxc(n, alpha = 0.05)
n |
the observed table (a cxc matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# A comparison between serial and retrospective measurements # (Fischer et al., 1999) Wald_test_and_CI_marginal_mean_ranks_paired_cxc(fischer_1999)
# A comparison between serial and retrospective measurements # (Fischer et al., 1999) Wald_test_and_CI_marginal_mean_ranks_paired_cxc(fischer_1999)
The Wald test and confidence interval for the difference between marginal mean scores
Described in Chapter 9 "The Paired cxc Table"
Wald_test_and_CI_marginal_mean_scores_paired_cxc( n, a = seq_len(nrow(n)), alpha = 0.05 )
Wald_test_and_CI_marginal_mean_scores_paired_cxc( n, a = seq_len(nrow(n)), alpha = 0.05 )
n |
the observed table (a cxc matrix) |
a |
scores assigned to the outcome categories |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# A comparison between serial and retrospective measurements # (Fischer et al., 1999) a <- c(8, 3.5, 0, -3.5, -8) Wald_test_and_CI_marginal_mean_scores_paired_cxc(fischer_1999, a)
# A comparison between serial and retrospective measurements # (Fischer et al., 1999) a <- c(8, 3.5, 0, -3.5, -8) Wald_test_and_CI_marginal_mean_scores_paired_cxc(fischer_1999, a)
The Wald test with continuity correction for the binomial probability (pi)
H_0: pi = pi0 vs H_A: pi ~= pi0 (two-sided)
Wald_test_CC_1x2(X, n, pi0)
Wald_test_CC_1x2(X, n, pi0)
X |
the number of successes |
n |
the total number of observations |
pi0 |
a given probability |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# The number of 1st order male births (adapted from Singh et al. 2010) Wald_test_CC_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.1) # The number of 2nd order male births (adapted from Singh et al. 2010) Wald_test_CC_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.1) # The number of 3rd order male births (adapted from Singh et al. 2010) Wald_test_CC_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.1) # The number of 4th order male births (adapted from Singh et al. 2010) Wald_test_CC_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.1) # Ligarden et al. (2010) Wald_test_CC_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.1)
# The number of 1st order male births (adapted from Singh et al. 2010) Wald_test_CC_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"], pi0 = 0.1) # The number of 2nd order male births (adapted from Singh et al. 2010) Wald_test_CC_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"], pi0 = 0.1) # The number of 3rd order male births (adapted from Singh et al. 2010) Wald_test_CC_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"], pi0 = 0.1) # The number of 4th order male births (adapted from Singh et al. 2010) Wald_test_CC_1x2(singh_2010["4th", "X"], singh_2010["4th", "n"], pi0 = 0.1) # Ligarden et al. (2010) Wald_test_CC_1x2(ligarden_2010["X"], ligarden_2010["n"], pi0 = 0.1)
The Wilson score confidence interval
Wilson_score_CI_1x2(X, n, alpha = 0.05)
Wilson_score_CI_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Reference Wilson EB (1927) Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association 22209-212
# birth order 1, Singh et al. (2010) Wilson_score_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) # birth order 2, Singh et al. (2010) Wilson_score_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) # birth order 3, Singh et al. (2010) Wilson_score_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) # birth order 4, Singh et al. (2010) with(singh_2010["4th", ], Wilson_score_CI_1x2(X, n)) # alternative syntax # Ligarden (2010) Wilson_score_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
# birth order 1, Singh et al. (2010) Wilson_score_CI_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) # birth order 2, Singh et al. (2010) Wilson_score_CI_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) # birth order 3, Singh et al. (2010) Wilson_score_CI_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) # birth order 4, Singh et al. (2010) with(singh_2010["4th", ], Wilson_score_CI_1x2(X, n)) # alternative syntax # Ligarden (2010) Wilson_score_CI_1x2(ligarden_2010["X"], ligarden_2010["n"])
Described in Chapter 2 "The 1x2 Table and the Binomial Distribution"
Wilson_score_CI_CC_1x2(X, n, alpha = 0.05)
Wilson_score_CI_CC_1x2(X, n, alpha = 0.05)
X |
the number of successes |
n |
the total number of observations |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
Reference Wilson EB (1927) Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association; 22209-212
# The number of 1st order male births (Singh et al. 2010) Wilson_score_CI_CC_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) # The number of 2nd order male births (Singh et al. 2010) Wilson_score_CI_CC_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) # The number of 3rd order male births (Singh et al. 2010) Wilson_score_CI_CC_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) # The number of 4th order male births (Singh et al. 2010) with(singh_2010["4th", ], Wilson_score_CI_CC_1x2(X, n)) # alternative syntax # Ligarden et al. (2010) Wilson_score_CI_CC_1x2(ligarden_2010["X"], ligarden_2010["n"])
# The number of 1st order male births (Singh et al. 2010) Wilson_score_CI_CC_1x2(singh_2010["1st", "X"], singh_2010["1st", "n"]) # The number of 2nd order male births (Singh et al. 2010) Wilson_score_CI_CC_1x2(singh_2010["2nd", "X"], singh_2010["2nd", "n"]) # The number of 3rd order male births (Singh et al. 2010) Wilson_score_CI_CC_1x2(singh_2010["3rd", "X"], singh_2010["3rd", "n"]) # The number of 4th order male births (Singh et al. 2010) with(singh_2010["4th", ], Wilson_score_CI_CC_1x2(X, n)) # alternative syntax # Ligarden et al. (2010) Wilson_score_CI_CC_1x2(ligarden_2010["X"], ligarden_2010["n"])
The Woolf logit confidence interval for the odds ratio
Described in Chapter 4 "The 2x2 Table"
Woolf_logit_CI_2x2(n, alpha = 0.05)
Woolf_logit_CI_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2 matrix) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# A case-control study of GADA exposure on IPEX syndrome # (Lampasona et al., 2013): Woolf_logit_CI_2x2(lampasona_2013) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): Woolf_logit_CI_2x2(ritland_2007)
# A case-control study of GADA exposure on IPEX syndrome # (Lampasona et al., 2013): Woolf_logit_CI_2x2(lampasona_2013) # The association between CHRNA4 genotype and XFS (Ritland et al., 2007): Woolf_logit_CI_2x2(ritland_2007)
The Woolf test and CI for a common odds ratio
(A Wald-type test and CI based on the inverse variance estimate)
Described in Chapter 10 "Stratified 2x2 Tables and Meta-Analysis"
Woolf_test_and_CI_stratified_2x2(n, alpha = 0.05)
Woolf_test_and_CI_stratified_2x2(n, alpha = 0.05)
n |
the observed table (a 2x2xk matrix, where k is the number of strata) |
alpha |
the nominal level, e.g. 0.05 for 95% CIs |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Smoking and lung cancer (Doll and Hill, 1950) Woolf_test_and_CI_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Woolf_test_and_CI_stratified_2x2(hine_1989)
# Smoking and lung cancer (Doll and Hill, 1950) Woolf_test_and_CI_stratified_2x2(doll_hill_1950) # Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989) Woolf_test_and_CI_stratified_2x2(hine_1989)
The Z-unpooled test for association in 2x2 tables
Described in Chapter 4 "The 2x2 Table"
Z_unpooled_test_2x2(n)
Z_unpooled_test_2x2(n)
n |
the observed counts (a 2x2 matrix) |
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Example: A lady tasting a cup of tea Z_unpooled_test_2x2(tea) # Example: Perondi et al. (2004) Z_unpooled_test_2x2(perondi_2004) # Example: Lampasona et al. (2013) Z_unpooled_test_2x2(lampasona_2013) # Example: Ritland et al. (2007) Z_unpooled_test_2x2(ritland_2007)
# Example: A lady tasting a cup of tea Z_unpooled_test_2x2(tea) # Example: Perondi et al. (2004) Z_unpooled_test_2x2(perondi_2004) # Example: Lampasona et al. (2013) Z_unpooled_test_2x2(lampasona_2013) # Example: Ritland et al. (2007) Z_unpooled_test_2x2(ritland_2007)