小编Com*_*ent的帖子

相当于Python中的cor.test的R'

有没有办法在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
Run Code Online (Sandbox Code Playgroud)

在Python中我可以使用以下公式计算r(cor):

r,p = scipy.stats.pearsonr(df.age, df.pets)
Run Code Online (Sandbox Code Playgroud)

但这不会返回r置信区间.

statistics numpy scipy statsmodels

7
推荐指数
1
解决办法
3349
查看次数

标签 统计

numpy ×1

scipy ×1

statistics ×1

statsmodels ×1