ci_oddsratio: CI for the Odds Ratio

View source: R/ci_oddsratio.R

ci_oddsratioR Documentation

CI for the Odds Ratio

Description

This function calculates a CI for the odds ratio in a 2x2 table/matrix or a data frame with two columns. The CI is obtained through stats::fisher.test(). Bootstrap CIs are not available.

Usage

ci_oddsratio(x, probs = c(0.025, 0.975))

Arguments

x

A 2x2 matrix/table of counts, or a data.frame with exactly two columns representing the two binary variables.

probs

Lower and upper probabilities, by default c(0.025, 0.975).

Value

An object of class "cint", see ci_mean() for details.

See Also

oddsratio().

Examples

x <- cbind(c(10, 5), c(4, 4))
ci_oddsratio(x)

confintr documentation built on June 7, 2023, 6:24 p.m.