R/termsInt.R

Defines functions termsInt

Documented in termsInt

termsInt <-
function(aa, c.joint, pi.samples=0.4) {
  # prob z.joint > c.joint  givnen z.1 = aa  under null hypothesis
  mu.joint <- aa*sqrt(pi.samples)
  var.joint <- 1 - pi.samples
  sd.joint <- sqrt(var.joint)
  term.1 <- pnorm(c.joint, mean=mu.joint, sd=sd.joint, lower.tail=F)

  # prob z.joint < -c.joint  givnen z.1 = aa
  term.2 <- pnorm(-c.joint, mean=mu.joint, sd=sd.joint, lower.tail=T)
  
  result <- term.1 + term.2
  result2 <- list(term.1=term.1, term.2=term.2, result=result)
  result2
  }

Try the twoStageGwasPower package in your browser

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

twoStageGwasPower documentation built on May 29, 2017, 12:11 p.m.