Skip to content
Prev 239 / 585 Next

Frequencies like Epiinfo

Inside the function twoby2 from the Epi-package you will find a small locally defined function that gives you confidence intervals for proportions that are better than those you compute, which occasionally will give limits outside (0,1). 
This one is based on the logit approximation, and is what you get if you used a logistic regression to estimate the proportions:

bin.ci <- 
function(x, n) 
{
  ef <- exp(qnorm(1 - alpha/2)/sqrt(x * (n - x)/n))
  p <- x/n
  c( p, p/(p + (1 - p) * ef), p/(p + (1 - p)/ef))
}

Best regards,
Bendix Carstensen
je)/sum(Frecue
je)/sum(Frecue