def confidence_interval(rho, N):
"""
Give a 95% confidence interval for a Spearman correlation score, given
the correlation and the number of cases.
"""
z = np.arctanh(rho)
interval = 1.96 / np.sqrt(N - 3)
low = z - interval
high = z + interval
return pd.Series(
[rho, np.tanh(low), np.tanh(high)],
index=['acc', 'low', 'high']
)
评论列表
文章目录