
Forgive me as I have no clue what I am doing.... I am neither a computer programmer nor a statistician! I just dabble in both!
I have a tstat in some VB code. I want to translate that into a p value (similar to excel 2007 function tdist, where I can supply the t stat, the degrees of freedom, and the number of tails (in my case 1).
I referenced meta numerics add in, but now I am lost. I just need to feed it those three variables and return the p value (probability).
Thanks in advance for any help!


Coordinator
Mar 12, 2014 at 5:37 PM

Here is the code you want:
public static double StudentRightTailProbability (double degreesOfFreedom, double tValue) {
StudentDistribution distribution = new StudentDistribution(degreesOfFreedom);
double rightTailProbability = distribution.RightProbability(tValue);
return(rightTailProbability);
}
For example, StudentRightTailProbability(3, 2.0) returns 0.06966298... The Student distribution (and a lot of other distributions) are classes in the Meta.Numerics.Statistics.Distibutions namespace. For any distribution, you can find its right tail probability
using the RightProbability method. For a symmetric distribution such as Student's t, the twotailed probability will just be twice as big.



Thank you! I will give that a try!

