【发布时间】:2015-08-04 02:37:15
【问题描述】:
有没有办法在 Python 中找到 r 置信区间?
在 R 中,我可以这样做:
cor.test(m, h)
Pearson's product-moment correlation
data: m and h
t = 0.8974, df = 4, p-value = 0.4202
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.6022868 0.9164582
sample estimates:
cor
0.4093729
在 Python 中,我可以使用以下方法计算 r (cor):
r,p = scipy.stats.pearsonr(df.age, df.pets)
但这不会返回 r 置信区间。
【问题讨论】:
标签: numpy statistics scipy statsmodels