Confidence Interval

Once in a blue moon I need to compute a classic confidence interval and every time I search the internet for a tool to which I can just give a series of data and ask for a CI and come back disappointed.

Here is a snipped I am likely going to come back again to:

events <- read.csv("events.csv")
data <- events$rate
mean <- mean(data)
sd <- sd(data)
se <- sd /sqrt(length(data))
ci <- se * qt((1-0.05)/2 + .5, length(data)-1)
print(c(mean, ci))

Posted On

Category:

Tags: / /