F test with python, finding the critical value
<p>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?</p>

<p>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</p>

<p>IIUC, you can use <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.f.html" rel="nofollow"><code>scipy.stats.f.ppf</code></a>, which gives the inverse of the cdf:</p>

<pre><code>&gt;&gt;&gt; import scipy.stats
&gt;&gt;&gt; scipy.stats.f.ppf(q=1-0.05, dfn=3, dfd=39)
2.8450678052793514
&gt;&gt;&gt; crit = _
&gt;&gt;&gt; scipy.stats.f.cdf(crit, dfn=3, dfd=39)
0.95000000000000007
</code></pre>

python