P-value from Chi sq test statistic in Python

Quick refresher here:

Probability Density Function: think of it as a point value; how dense is the probability at a given point?

Cumulative Distribution Function: this is the mass of probability of the function up to a given point; what percentage of the distribution lies on one side of this point?

In your case, you took the PDF, for which you got the correct answer. If you try 1 – CDF:

>>> 1 - stats.chi2.cdf(3.84, 1)
0.050043521248705147

PDF
CDF

Leave a Comment

tech