Logo

TINV

Updated 2024-03-13 14:09:17.190000

Syntax

SELECT [westclintech].[wct].[TINV] (
  <@Probability, float,>
 ,<@Degrees_freedom, float,>)

Description

Use the scalar function TINV to calculate the t -value of the Student's t-distribution as a function of the probability and the degrees of freedom. The cumulative distribution function which is given by the incomplete beta function:

F(t) = \int_{-\infty}^t\ f(u)\ \operatorname{d}u ~=~ 1 - \frac{1}{2} I_{x(t)}\!\left( \frac{\ \nu\ }{ 2 },\ \frac{\ 1\ }{ 2 } \right)\

Where

x(t) = \frac{ \nu }{\ t^2+\nu\ }

Arguments

@Probability

is the probability associated with the two-tailed Student's t -distribution. @Probability is an expression of type float or of a type that can be implicitly converted to float.

@Degrees_freedom

is a number specifying the degrees of freedom. @Degrees_freedom is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

If @Degrees_freedom  < 1, TINV returns an error.

@Degrees_freedom is truncated to zero decimal places.

If @Probability < 0 or @Probability > 1, TINV returns an error.

TINV uses root-finding algorithms and iteration to solve for TDIST(TINV(@Probability, @Degrees_freedom), @Degrees_freedom, 2) - @Probability = 0 to eight decimal places

Examples

Select wct.tinv(0.0546449297129976, 60);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1.9600000001966"}]}
Select Round(wct.TDIST(wct.tinv(0.0546449297129976, 60), 60, 2) - 0.0546449297129976,

          9);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0"}]}