【问题标题】:Is it normal to have a 0.0 P-value when I ran a pearson's correlation test in python当我在 python 中运行 pearson 相关性测试时,P 值为 0.0 是否正常
【发布时间】:2021-04-10 15:37:54
【问题描述】:

我有一个由三个变量组成的数据集。我运行了 Pearson 相关系数检验来查看结果,但它显示 p 值为 0.0。我不确定我是否犯了错误或 0.0 p 值是可能的。谁能告诉我是我弄错了还是正常的?

这是我的代码:

new_death = df['New deaths'].values
cases = df['New cases'].values
vaccinations = df['New vaccinations'].values
list_of_vars = [new_death,cases,vaccinations]
results = [scipy.stats.pearsonr(*pair) for pair in combinations(list_of_vars, 2)]

这是这段代码的结果。

[(0.9591135831040322, 0.0),
 (0.5663918183925666, 0.0),
 (0.6125207790335854, 0.0)]

【问题讨论】:

  • 数组的长度是多少?可以显示数据吗?

标签: python scipy statistics data-analysis pearson-correlation


【解决方案1】:

如果您有足够的样本以使相关性非常精确,您可以获得 0 的 p 值,正如您在 documentation on pearson 中看到的那样。

除了发布您的数据之外,您还可以尝试使用不同的数据集运行测试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-27
    • 1970-01-01
    • 2012-11-19
    • 2019-04-22
    • 2021-10-30
    • 2011-04-26
    • 2020-02-06
    相关资源
    最近更新 更多