Learn R Programming

umx (version 4.9.0)

oddsratio: 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)

Value

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

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]

References

See Also

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

Examples

Run this code
# NOT RUN {
oddsratio(grp1 = c(1, 10), grp2 = c(3, 10))
oddsratio(grp1 = c(3, 10), grp2 = c(1, 10))
oddsratio(grp1 = c(3, 10), grp2 = c(1, 10), alpha = .01)

# }

Run the code above in your browser using DataLab