View source: R/strandBiasLib.R
oddRatio | R Documentation |
This function computes the odd ratio of observed vs expected events. The odd ratio (OR) is computed as (observedTrue/observedFalse) x (expectedFalse/expectedTrue), while the confidence interval (CI) is computed as exp(log(or) + c(-1,1) x 1.96 x sqrt(1/observedTrue + 1/observedFalse + 1/expectedTrue + 1/expectedFalse)). If any of the four input values is 0, then a modified Haldane-Anscombe (mHA) correction is applied, adding 0.5 to all values. The result of the fisher.test R function is also reported, which uses the Conditional Maximum Likelihood Estimate (CMLE) and can report slightly different OR and CI
oddRatio(observedTrue, observedFalse, expectedTrue, expectedFalse)
observedTrue |
count of observed true cases |
observedFalse |
count of observed false cases |
expectedTrue |
count of expected true cases |
expectedFalse |
count of expected false cases |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.