How do I obtain critical T values?
Using apache stat I can't seem to get the values?
For instance
Tdistribution t= new Tdistribution(10);
t.CumulativeProbabilty(0.05);//alpha=0.O5
if you look in table values are different.
How do I obtain critical T values?
Using apache stat I can't seem to get the values?
For instance
Tdistribution t= new Tdistribution(10);
t.CumulativeProbabilty(0.05);//alpha=0.O5
if you look in table values are different.
My guess is that you might be interpreting the values of the t-table incorrectly.
Take for example the exercise proposed here:
A t-value of 2.35, from a t-distribution with 14 degrees of freedom, has an upper-tail (“greater than”) probability between which two values on the t-table? Answer: 0.025 and 0.01 Using the t-table, locate the row with 14 degrees of freedom and look for 2.35. However, this exact value doesn’t lie in this row, so look for the values on either side of it: 2.14479 and 2.62449. [...]
If you try to solve this with apache-commons-math
you get the following,
TDistribution t = new TDistribution(14);
System.out.println(1- t.cumulativeProbability(2.35));
0.016981716091246768
which is ok with the results, however more accurate. 0.016 is indeed between 0.025 and 0.01.
If you want to get straight a value of the t-table, like for example probability with 10 degrees of freedom and a t-value of 1.812461, the answer is
t = new TDistribution(10);
System.out.println(1- t.cumulativeProbability(1.812461));
0.050000010018874885
while the probability value in the table is 0.5
EDIT after comments:
In order to calculate the quantile, you have to use inverseCumulativeProbability
. This is in the abstract class AbstractRealDistribution
.
System.out.println(t.inverseCumulativeProbability(0.95));
1.8124611228157772