Calculating confidence intervals in surveys