Convert Z-score (Z-value, standard score) to p-value for normal distribution in Python

后端 未结 7 1819
野趣味
野趣味 2020-12-12 18:19

How does one convert a Z-score from the Z-distribution (standard normal distribution, Gaussian distribution) to a p-value? I have yet to find the magical function in Scipy\'

7条回答
  •  离开以前
    2020-12-12 18:37

    I think the cumulative distribution function (cdf) is preferred to the survivor function. The survivor function is defined as 1-cdf, and may communicate improperly the assumptions the language model uses for directional percentiles. Also, the percentage point function (ppf) is the inverse of the cdf, which is very convenient.

    >>> import scipy.stats as st
    >>> st.norm.ppf(.95)
    1.6448536269514722
    >>> st.norm.cdf(1.64)
    0.94949741652589625
    

提交回复
热议问题