P-value from Chi sq test statistic in Python

后端 未结 7 1728
借酒劲吻你
借酒劲吻你 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

    To calculate probability of null hypothesis given chisquared sum, and degrees of freedom you can also call chisqprob:

    >>> from scipy.stats import chisqprob
    >>> chisqprob(3.84, 1)
    0.050043521248705189
    

    Notice:

    chisqprob is deprecated! stats.chisqprob is deprecated in scipy 0.17.0; use stats.distributions.chi2.sf instead

提交回复
热议问题