R/ormidp.test.R

Defines functions ormidp.test

Documented in ormidp.test

ormidp.test <- function(a1, a0, b1, b0, or = 1){
  x <- matrix(c(a1,a0,b1,b0),2,2, byrow=TRUE)
  lteqtoa1 <- fisher.test(x,or=or,alternative="l")$p.val
  gteqtoa1 <- fisher.test(x,or=or,alternative="g")$p.val
  pval1 <- 0.5*(lteqtoa1-gteqtoa1+1)
  one.sided <- min(pval1, 1-pval1)
  two.sided <- 2*one.sided
  data.frame(one.sided=one.sided, two.sided=two.sided)
}

Try the epitools package in your browser

Any scripts or data that you put into this service are public.

epitools documentation built on March 26, 2020, 9:14 p.m.