P-value from Chi sq test statistic in Python

后端 未结 7 1727
借酒劲吻你
借酒劲吻你 2020-12-24 01:36

I have computed a test statistic that is distributed as a chi square with 1 degree of freedom, and want to find out what P-value this corresponds to using python.

I

相关标签:
7条回答
  • 2020-12-24 02:08

    Some of the other solutions are deprecated. Use scipy.stats.chi2 Survival Function. Which is the same as 1 - cdf(chi_statistic, df)

    Example:

    from scipy.stats import chi2
    p_value = chi2.sf(chi_statistic, df)
    
    0 讨论(0)
提交回复
热议问题