Calculates the one-sided probability given a t-value and the degrees of freedom.
function cdft_p ( t : numeric, df : numeric ) return_val : numeric
A scalar or array containing t-values.df
A scalar or array of the same size as t containing the number of degrees of freedom.
A array of the same size as t. Double if any of the input arguments are double, float otherwise.
Using the cumulative distribution function for the T distribution, calculate the one-sided probability associated with one or more t-values and degrees of freedom. Technically, this is the integral from -infinity to t of the t-density distribution.
The source code is from source routine "CDFT" from DCDFLIB (Double precision Cumulative Distribution Function LIBrary).
t = 2.12 df = 16 P = cdft_p(-t, df) ; P = 0.025 P = cdft_p( t, df) ; P = 0.975Note: the following could be used to calculate the two-sided significance given t and df:
prob = betainc( df/(df+t^2), df/2.0, 0.5) ; prob=0.05 [PROB=1-prob=0.95]