Skip to contents

Odds ratio and confidence interval from a 2x2 contingency table

Usage

morie_odds_ratio_ci(table_2x2, alpha = 0.05, method = c("exact", "woolf"))

Arguments

table_2x2

A 2x2 matrix: rows are treatment, columns are outcome.

alpha

Significance level; sets the width of the interval,

method

"exact" (default): the exact conditional interval of fisher.test, solved to machine precision; "woolf": the log-scale Wald interval with a half added to every cell when one is empty. which is Woolf's on the log scale (Haldane-Anscombe corrected when a cell is empty).

Value

Named list: odds_ratio (the sample odds ratio), ci_lower, ci_upper at the requested level, and the exact p_value.

Examples

# See the package vignettes for usage examples:
#   vignette(package = "rmorie")