oddRatio: Odd Ratio

View source: R/strandBiasLib.R

oddRatioR Documentation

Odd Ratio

Description

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

Usage

oddRatio(observedTrue, observedFalse, expectedTrue, expectedFalse)

Arguments

observedTrue

count of observed true cases

observedFalse

count of observed false cases

expectedTrue

count of expected true cases

expectedFalse

count of expected false cases


Nik-Zainal-Group/signature.tools.lib documentation built on April 13, 2025, 5:50 p.m.