A 2 x 2 table of counts as an array of rows.
See OddsRatioOptions.
See OddsRatioResult.
Limits: the exact methods ("midp", "fisher") need the support of x11 given the margins (min(x11, x22) +
min(x12, x21) + 1 values) to be at most 2^23 (about 6 s), and "fisher" counts of at most 2^31 - 1 (as
fisherTest); the p-values of every method need phyper within its 2^26 terms (counts up to about 1e12).
Odds ratio of a 2 x 2 table with its confidence interval and three p-values of independence. Equivalent to
epitools::oddsratio()in R.The table is in epitools' orientation: rows are the exposure (row 1 the reference level) and columns the outcome (column 1 without the disease); the odds ratio x11 x22 / (x12 x21) is the same for the transposed table.
Methods (
method):"midp"(the default, as epitools: the median-unbiased estimate and the mid-p exact interval from Fisher's noncentral hypergeometric distribution of x11 given the margins),"fisher"(the conditional MLE and the exact interval of fisherTest),"wald"(the sample odds ratio and Woolf's interval on the log scale; as epitools, no zero-cell correction: a zero cell gives an estimate of 0 or Infinity and NaN for the limit that is not defined) and"score"(the sample odds ratio and the score interval of epiR'sepi.2by2, Miettinen-Nurminen without the factor N/(N - 1)). The mid-p and score limits are the roots of their equations to the precision of the doubles (epitools solves with uniroot's tolerance on [0, 1000] and fails beyond and for zero cells; epiR steps by 0.1%). With a zero cell the mid-p estimate and limits follow the conventions of exact2x2: 0 or Infinity at the end of the support.pValuehas epitools' three p-values: the two-sided mid-p (twice the smaller one-sided mid-p value), Fisher's exact test and Pearson's chi-squared without continuity correction (with R's warning "Chi-squared approximation may be incorrect" where an expected count is below 5).