To calculate a confidence interval for an odds (risk, rate, smr) use the function epi.conf in epiR. Here we use the two-by-two table data from the documentation for function epi.2by2:
tab <- matrix(c(13,2163,5,3349), nrow = 2, byrow = TRUE)
rownames(tab) <- c("DF+", "DF-"); colnames(dat) <- c("FUS+", "FUS-"); tab
epi.2by2(dat = as.table(tab), method = "case.control",
conf.level = 0.95, units = 100, outcome = "as.columns")
Calculate the confidence interval for the odds of disease in the exposed:
pos <- 13; neg <- 2163
epi.conf(dat = as.matrix(cbind(pos, neg)), ctype = "odds", N = 1000,
design = 1, conf.level = 0.95)