oddsratio: Odds Ratio

Description Usage Arguments Value Examples

View source: R/oddsratio.R

Description

This function calculates the odds ratio in a 2x2 table/matrix or a data frame with two columns. The numerator equals the ratio of the top left entry and the bottom left entry, while the denonimator equals the ratio of the top right entry and the bottom right entry. This is usually slightly different from the calculation by stats::fisher.test which is based on the ML estimate of the odds ratio.

Usage

1

Arguments

x

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

Value

A numeric vector of length one.

Examples

1
2
tab <- cbind(c(10, 5), c(4, 4))
oddsratio(tab)

confintr documentation built on July 2, 2020, 1:51 a.m.