1 | odds(disease, population, conf.level = 0.95)
|
disease |
|
population |
|
conf.level |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (disease, population, conf.level = 0.95)
{
N. <- 1 - ((1 - conf.level)/2)
if ((length(disease)>1) & (length(population)==1)) {population<-rep(population,length(disease))}
b<-(population-disease)
logit<-log(disease/b)
se<-sqrt(1/disease+1/b)
ul<-exp(logit+qnorm(N.)*se)
ll<-exp(logit-qnorm(N.)*se)
data.frame.a <- data.frame(disease = disease, population = population,
odds = disease/b, se = se, ll = ll, ul = ul)
names(data.frame.a)[5] <- paste("exact.lower", 100 * conf.level, "ci", sep = "")
names(data.frame.a)[6] <- paste("exact.upper", 100 * conf.level, "ci", sep = "")
if (nrow(data.frame.a) == 1) {
rownames(data.frame.a) <- ""
}
data.frame.a
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.