odds.ratio: Odds ratio and relative risk

View source: R/odds.ratio.R

Odds ratio and relative riskR Documentation

Odds ratio and relative risk

Description

Odds ratio and relative risk.

Usage

odds.ratio(x, a = 0.05, logged = FALSE)
rel.risk(x, a = 0.05, logged = FALSE)

Arguments

x

A 2 x 2 matrix or a vector with 4 elements. In the case of the vector make sure it corresponds to the correct table.

a

The significance level, set to 0.05 by default.

logged

Should the p-values be returned (FALSE) or their logarithm (TRUE)?

Details

The odds ratio and the confidence interval are calculated.

Value

A list including:

res

The estimated odds ratio and the p-value for the null hypothesis test that it is equal to 1.

ci

The (1-a)% confidence interval for the true value of the odds ratio.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr>.

References

Mosteller Frederick (1968). Association and Estimation in Contingency Tables. Journal of the American Statistical Association. 63(321):1-28.

Edwards A.W.F. (1963). The measure of association in a 2x2 table. Journal of the Royal Statistical Society, Series A. 126(1):109-114.

See Also

odds, g2Test

Examples

x <- rpois(4, 30)+2
res<-odds.ratio(x)
res<-odds.ratio( matrix(x, ncol = 2) )

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.