Learn R Programming

metagear (version 0.1)

random_OR: Random generation of odds ratio (OR) effect sizes.

Description

Generates random odds ratios, logged odds ratios, and their variances (Cornfield 1951).

Usage

random_OR(K, p_A, N_A, p_B, N_B, continuity = 0.5, logged = TRUE)

Arguments

K
Number of effect sizes to generate.
p_A
The odds of the event of interest for Group A. A probability ranging from zero to one.
N_A
The total number of samples of Group A.
p_B
The odds of the event of interest for Group B. A probability ranging from zero to one.
N_B
The total number of samples of Group B.
continuity
Odds ratios with zero events cannot be computed. Following, Cox (1970), a continuity correction can be added to each cell of the 2 by 2 table to help improve this problem of zero events within the table. The default value added is 0.5.
logged
When "FALSE", returns non-logged transformed odds ratios and appropriate variances. Default is TRUE.

Value

  • A data table with columns of random effect sizes (OR) and their variances.

References

Cornfield, J. 1951. A method for estimating comparative rates from Clinical Data. Applications to cancer of the lung, breast, and cervix. Journal of the National Cancer Institute 11: 1269-1275. Cox, D.R. 1970. The continuity correction. Biometrika 57: 217-219.

Examples

Run this code
random_OR(K = 5, p_A = 0.3, N_A = 100, p_B = 0.1, N_B = 60)

Run the code above in your browser using DataLab