Non-statistician here trying to replicate some code in Python.
R has the function qchisq
.
qchisq(c(0.5, 0.1, 0.99), df=1, lower.tail=F)
# [1] 0.4549364231 2.7055434541 0.0001570879
It can be replicated in Python like so:
from scipy.special import chdtri
import pandas as pd
chdtri(1, pd.Series([0.5, 0.1, 0.99]))
# Out[57]:
# 0 0.454936
# 1 2.705543
# 2 0.000157
However, Rs qchisq
can also has the flag log.p
, which allows me to do:
qchisq(-c(0.5, 0.1, 0.99) * log(10), df=1, lower.tail=F, log.p=T)
# [1] 1.00448472 0.06796154 2.66885996
I cannot find any way to do this in Python. How do I achieve the same thing?