【发布时间】:2021-11-13 20:26:10
【问题描述】:
Python 中是否有等效的 pchisq R 命令。正如in this question 所说,我使用的是 scipy 中的 chi2.ppf,但我没有得到与 R 中相同的结果。例如,以下代码:
R:
pchisq(38972.27814544528, df = 1)
Out: 1
pchisq(40569.99000034796, df = 1)
Out: 1
Python:
chi2.ppf(38972.27814544528, df = 1)
Out: NaN
chi2.ppf(40569.99000034796, df = 1)
Out: NaN
提前谢谢您的帮助。
【问题讨论】:
-
在您引用的问题中,他们使用的是
qchisq,而不是pchisq,peacewang 的回答是正确的。注意你正在测试的 chisq 值,真的很大 -
@StupidWolf 没错。谢谢你指出我
标签: python r chi-squared