I've been doing some research on statistical significance, and I've learned a lot but seem to have hit a wall when it comes to calculating P values.
I feel like I'm about 95% of the way there; it's just that everything I read on calculating P values references a table rather than offering a programmatic solution.
It seems that Excel's TDIST
function does what I want (I already have the T statistic, which I can pass to TDIST
along with N - 2 as degrees of freedom where N is my sample size); but I am unclear on how this function works. Mathematically speaking, I believing it is finding the area under a normal distribution curve beyond the specified value; but what might the code look like?
Any clear, readable implementation of this kind of function would be fine: C, Java, Python, pseudocode, whatever.