Have a personal or library account? Click to login
bayesint: A Python Package for Calculating Bayesian Credible Intervals of Ratios of Beta Distributions Cover

bayesint: A Python Package for Calculating Bayesian Credible Intervals of Ratios of Beta Distributions

Open Access
|Dec 2021

Figures & Tables

Table 1

Example of 2×2 contingency table.

INCIDENCE
CLASSIFICATION+TOTAL AT RISK
+PM – PM
CN – CN
TotalC + PN – C + M – PN + M
Table 2

Functions in bayesint.

FUNCTION GROUPINGFUNCTIONDESCRIPTION
table_measuresrel_riskRelative risk, a comparative measure for 2×2 contingency table
odds_ratOdds ratio, a comparative measure for 2×2 contingency table seen in Equation 1
ratiosA wrapper function returning both the relative risk and odds ratio
table_testschi_sq_statχ2 statistic for testing the hypothesis of no association between the two variables in a 2×2 contingency table
chi_sq_testχ2 test for the statistic
random_variablesdensi_fracPrior density of a ratio of two independent beta distributions
distri_fracPosterior distribution of a ratio of two independent beta distributions
intervalseqt_int_fracThe equal-tailed credible interval of a ratio of two independent beta distributions
hpd_int_fracThe highest posterior density credible interval of a ratio of two independent beta distributions
frac_intA wrapper function returning the equal-tailed credible interval and the highest posterior density credible interval or both (chosen by the user)
Table 3

Haffkine’s cholera data from Greenwood and Yule [4] with numbers denoting the original tables they are from.

3456
ANATANATANATANAT
I327627918115133075750193193
NI66473539120520640197787976723729
T69749818138635773198538726916922
78910
ANATANATANATANAT
I8200208510511041921962757515778
NI201822021188993411314719863516549
T2838241016193209383053432251210212327
Table 4

Relative risks and credible intervals for data from Table 3.

HAFFKINERRINTERVAL
EQUAL-TAILEDHIGHEST POSTERIOR DENSITY
30.0878[0.0513, 0.3352][0.0374, 0.3025](HPD starting values: [0.1, 0.4])
40.7218[0.5393, 1.0333][0.5218, 1.4436]
70.3885[0.2205, 0.7060][0.1881, 0.7753]
80.4091[0.2179, 0.7972][0.1476, 0.9875](HPD starting values: [0.2, 0.5])
90.0882[0.0353, 0.3319][0.0284, 0.3061]
100.1546[0.0180, 0.3946][0.0421, 0.4364]
Table 5

Available options for calculating uncertainty of ratios using credible intervals.

NAMELANGUAGEAUTHOR(S)
betarat version 1.0.0PythonMatsen IV et al. [13]
bayesian2betaRsupplement to Sverdlov et al. [19]
DOI: https://doi.org/10.5334/jors.283 | Journal eISSN: 2049-9647
Language: English
Submitted on: Jun 19, 2019
|
Accepted on: Nov 11, 2021
|
Published on: Dec 21, 2021
Published by: Ubiquity Press
In partnership with: Paradigm Publishing Services
Publication frequency: 1 issue per year

© 2021 M. Bekker-Nielsen Dunbar, Thomas J. R. Finnie, published by Ubiquity Press
This work is licensed under the Creative Commons Attribution 4.0 License.