R/diffpropci.mp.R

Defines functions diffpropci.mp

Documented in diffpropci.mp

diffpropci.mp <-
function(b,c,n,conf.level)
{
  z  <- qnorm(1-(1-conf.level)/2)
  diff <- (c-b)/(n+2)
  sd <- sqrt((b+c+1)-(c-b)^2/(n+2))/(n+2)
  ll <- diff - z*sd
  ul <- diff + z*sd
  if(ll < -1) ll = -1
  if(ul > 1) ul = 1
  cint <- c(ll, ul)
  attr(cint, "conf.level") <- conf.level
  rval <- list(conf.int = cint, estimate = diff)
  class(rval) <- "htest"
  return(rval)
}

Try the PropCIs package in your browser

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

PropCIs documentation built on May 2, 2019, 5:49 a.m.