oddsRatio: Odds Ratio for Multiple Contigency Tables

Description Usage Arguments Details Value Examples

View source: R/enrichment.R

Description

Computes a vector of odds ratios given a set of contingency tables.

Usage

1
oddsRatio(a, b, c, d)

Arguments

a

A vector of values where a_i corresponds to t_i

b

A vector of values where b_i corresponds to t_i

c

A vector of values where c_i corresponds to t_i

d

A vector of values where d_i corresponds to t_i

Details

Given a set of contingency tables T, where T = {t_1,t_2,...,t_n-1,t_n}, with each t_i of the form:

setA ¬setA
setB a b | a + b
¬setB c d | c + d
a + c b + d | a + b + c + d

return a vector of odds ratios R=r_1, r_2,...,r_n-1,r_n where r_i corresponds to the odds ratio of t_i.

Value

A vector of odds ratios R=r_1, r_2,...,r_n-1,r_n where r_i corresponds to the odds ratio of t_i.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Given three contingency tables:
     setA  ¬setA          setA  ¬setA         setB  ¬setB
setB  3     100        setC  5     6        setD  20     45
¬setB  123   500       ¬setC  10    100     ¬setD  60     1000



a=c(3, 5, 20)
b=c(100, 6, 45)
c=c(123, 10, 60)
d=c(500, 100, 1000)
or = oddsRatio(a,b,c,d)

MaayanLab/genesetr documentation built on Aug. 14, 2019, 12:20 p.m.