added function copied from the Rmisc package to calculate conf int on a vector