oddsratio: Compute odds ratio (OR)

View source: R/misc_and_utility.R

oddsratioR Documentation

Compute odds ratio (OR)

Description

Returns the odds in each group, and the odds ratio. Takes the cases (n) and total N as a list of two numbers for each of two groups.

Usage

oddsratio(grp1 = c(n = 3, N = 10), grp2 = c(n = 1, N = 10), alpha = 0.05)

Arguments

grp1

either odds for group 1, or cases and total N , e.g c(n=3, N=10)

grp2

either odds for group 2, or cases and total N , e.g c(n=1, N=20)

alpha

for CI (default = 0.05)

Details

Returns a list of odds1, odds2, and OR + CI. Has a pretty-printing method so displays as:

Group 1 odds = 0.43
Group 2 odds = 0.11
          OR = 3.86 CI95[0.160, 3.64]

Value

  • List of odds in group 1 and group2, and the resulting OR and CI

References

See Also

  • umx_r_test()

Other Miscellaneous Stats Functions: FishersMethod(), SE_from_p(), geometric_mean(), harmonic_mean(), reliability(), umxCov2cor(), umxHetCor(), umxParan(), umxWeightedAIC(), umx_apply(), umx_cor(), umx_means(), umx_r_test(), umx_round(), umx_scale(), umx_var(), umx

Examples

oddsratio(grp1 = c(1, 10), grp2 = c(3, 10))
oddsratio(grp1 = 0.111, grp2 = 0.429)
oddsratio(grp1 = c(3, 10), grp2 = c(1, 10))
oddsratio(grp1 = c(3, 10), grp2 = c(1, 10), alpha = .01)


umx documentation built on Sept. 21, 2022, 9:07 a.m.