def rz_ci(r, n, conf_level = 0.95): zr_se = pow(1/(n - 3), .5) moe = norm.ppf(1 - (1 - conf_level)/float(2)) * zr_se zu = atanh(r) + moe zl = atanh(r) - moe return tanh((zl, zu))