Calculate confidence interval and standard deviation