R/calc.pvalue.R

calc.pvalue <- function(x, var, test=c(upper=FALSE,lower=FALSE,twoSided=TRUE)) {
  a <- pnorm(x/sqrt(var))

  cbind(if(test['upper']) 1 - a,
        if(test['lower']) a,
        if(test['twoSided']) 2 * ifelse(a > 0.5, 1 - a, a))
}

Try the sensitivityPStrat package in your browser

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

sensitivityPStrat documentation built on May 2, 2019, 3:37 p.m.