Learn R Programming

confintr (version 0.2.0)

ci_oddsratio: Confidence Interval for the Odds Ratio

Description

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

Usage

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

Value

A list with class cint containing these components:

  • parameter: The parameter in question.

  • interval: The confidence interval for the parameter.

  • estimate: The estimate for the parameter.

  • probs: A vector of error probabilities.

  • type: The type of the interval.

  • info: An additional description text for the interval.

Arguments

x

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

probs

Error probabilites. The default c(0.025, 0.975) gives a symmetric 95% confidence interval.

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