#setwd("D:/Lectures/2WS05")




# example of how to make your own functions in R
# the example
normalBI <- function(dataset,conf=0.95)
{
print(c("confidence level = ",conf),quote=FALSE)
n<-length(dataset)
print("lower limit of confidence interval = ",quote=FALSE)
print(mean(dataset)-qt((1-conf)/2,df=n-1,lower.tail=FALSE)*sd(dataset)/sqrt(n),digits=3,quote=FALSE)
print("upper limit of confidence interval = ",quote=FALSE)
print(mean(dataset)+qt((1-conf)/2,df=n-1,lower.tail=FALSE)*sd(dataset)/sqrt(n),digits=3,quote=FALSE)
}



