How to calculate critical value of Chi square distribution in python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hassanhabib145
    New Member
    • Jun 2015
    • 1

    How to calculate critical value of Chi square distribution in python

    By using Chi square distribution table it is easy to get chi square distribution value corresponding to degrees of freedom and probability for left side of curve . If we have degrees of freedom=4 and probability=0.8 0, How to calculate the corresponding value of Chi square distribution to these values in python.In the FOLLOWING example probability is found with python when chi squared sum and degrees of freedom are given.
    Code:
    >>> from scipy.stats import chisqprob
    >>> chisqprob(3.84, 1)
    0.050043521248705189
  • AndySM
    New Member
    • Feb 2016
    • 1

    #2
    Code:
    >>> from scipy.stats import chi2
    >>> chi = chi2.isf(q=0.05, df=1)
    >>> chi
    3.8414588206941245

    Comment

    Working...