13 lines
263 B
R
13 lines
263 B
R
mychisq_or = function(dst_numeric, mut_numeric){
|
|
tab = as.matrix(table(dst_numeric, mut_numeric))
|
|
a = tab[2,2]
|
|
if (a==0){ a<-0.5}
|
|
b = tab[2,1]
|
|
if (b==0){ b<-0.5}
|
|
c = tab[1,2]
|
|
if (c==0){ c<-0.5}
|
|
d = tab[1,1]
|
|
if (d==0){ d<-0.5}
|
|
(a/b)/(c/d)
|
|
|
|
}
|