R/QH_CI.R

QH_CI <-
function(x,alpha)  {
  k <- length(x); n <- sum(x)
  QH_lcl <- (1/(2*(sum(x)+qchisq(1-alpha/k,k-1))))*{qchisq(1-alpha/k,k-1)+2*x-sqrt( qchisq(1-alpha/k,k-1)*(qchisq(1-alpha/k,k-1)+ 4*x*(sum(x)-x)/sum(x))) }
  QH_ucl <- (1/(2*(sum(x)+qchisq(1-alpha/k,k-1))))*{qchisq(1-alpha/k,k-1)+2*x+sqrt( qchisq(1-alpha/k,k-1)*(qchisq(1-alpha/k,k-1)+ 4*x*(sum(x)-x)/sum(x))) }  
  return(cbind(QH_lcl,QH_ucl))
}

Try the ACSWR package in your browser

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

ACSWR documentation built on May 2, 2019, 6:53 a.m.