shandou
5/30/2018 - 6:01 AM

pearson_r_CI2

pearson_r_CI2

import numpy as np

r = - 0.654 # Pearson's r from sampled data
z_prime = 0.5 * np.log((1 + r) / (1 - r))

n = 34 # Sample size
se = 1 / np.sqrt(n - 3) # Sample standard error

CI_lower = z_prime - z_critical * se
CI_upper = z_prime + z_critical * se