Using python, Is it possible to calculate the critical value on F distribution with x and y degrees of freedom? In other words, I need to calculate the critical value given a x degrees of freedom and a confidence level 5%, but i do not see the table from statistical books, is it posible to get it with any function from python?
For example, I want to find the critical value for a F distribution with 3 an 39 degrees of freedom for 5% of confidence level. The answer should be: 2.85
IIUC, you can use scipy.stats.f.ppf
, which gives the inverse of the cdf:
>>> import scipy.stats
>>> scipy.stats.f.ppf(q=1-0.05, dfn=3, dfd=39)
2.8450678052793514
>>> crit = _
>>> scipy.stats.f.cdf(crit, dfn=3, dfd=39)
0.95000000000000007
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With