I need to write some code that, given a probability (eg 80%), and a number of degrees of freedom (eg 9) returns the t-distribution, as in the chart at the bottom of this page: http://en.wikipedia.org/wiki/T-distribution
. (eg, for p=80%, df=9, the code would therefore return 0.883.)
I don't follow how they're getting that chart based on the derivation there. I tried finding some existing code and came up with the following links, but since I'm not familiar with OOP, I'm finding it hard to understand the code. Any help would be greatly appreciated.
Links to the t-distribution PHP code I found:
(this one is an archive of a bunch of different probability classes, including one for t-distribution)
All I really need is a function that will return a t-value given a probability and number of degrees of freedom.