Learn R Programming

confintr (version 1.0.0)

ci_oddsratio: 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))

Value

An object of class "cint" containing these components:

  • parameter: Parameter specification.

  • interval: CI for the parameter.

  • estimate: Parameter estimate.

  • probs: Lower and upper probabilities.

  • type: Type of interval.

  • info: Additional description.

Arguments

x

A 2x2 table/matrix of frequencies, or a data.frame with exactly two columns.

probs

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

See Also

oddsratio.

Examples

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

Run the code above in your browser using DataLab