odds: Odds Ratio

Description Usage Arguments Value Examples

View source: R/218OddsRatio.R

Description

Calculates the odds ratios for an inputted 2 x 2 table

Usage

1
odds(tab, conf.level = 0.95)

Arguments

tab

A 2 x 2 contingency table passed through table().

conf.level

The confidence level you are testing at. Defaults to 95%

Value

Returns the odds ratio test statistic, theta, the confidence level of the interval, and the confidence interval itself.

Examples

1
2
3
4
5
6
# create some 2x2 contingency table 
table <- matrix(c(766,110,702,89), nrow=2, ncol=2, byrow=TRUE)
# pass it through odds at default confidence level of 0.95
odds(table)
# change confidence level to reflect desired
odds(table, conf.level=.90)

ESunRoc/STT218 documentation built on Jan. 14, 2020, 2:39 a.m.