 # SQL Server F.DIST function

F_DIST

Updated: 31 July 2015

Use F_DIST to calculate the probability density or the lower cumulative probability of an F-distribution for x and degrees of freedom for 2 independent random variables.
Syntax
SELECT [wct].[F_DIST](
<@x, float,>
,<@df1, float,>
,<@df2, float,>
,<@Cumulative, bit,>)
Arguments
@X
The value of interest to be evaluated. @X must be of a type float or of type that intrinsically converts to float
@df1
The number of degrees freedom for the numerator random variable. @df1 must be of a type float or of a type that intrinsically converts to float.
@df2
The number of degrees freedom for the denominator random variable. @df2 must be of a type float or of a type that intrinsically converts to float.
@Cumulative
A bit value indicating whether the probability density function ('False') or the cumulative distribution function ('True') should be returned.
Return Type
float
Remarks
·         0 < @X
·         0 < @df1
·         0 < @df2
Examples
In this example we calculate the F cumulative distribution function for x = 9 with 4 numerator degrees of freedom and 5 denominator degrees of freedom.
SELECT
wct.F_DIST(
9            --@x
,4            --@df1
,5            --@df2
,'True'       --@Cumulative
)CDF

This produces the following result

Using the same data we calculate the F probability distribution function.
SELECT
wct.F_DIST(
9            --@x
,4            --@df1
,5            --@df2
,'False'--@Cumulative
)PDF

This produces the following result.

The F distribution is closely related to the beta distribution.
SELECT
wct.F_DIST(x,df1,df2,'True') as F_DIST
,wct.BETA_DIST(df1*x/(df2+df1*x),df1/2,df2/2,'True',NULL,NULL) as BETA_DIST
FROM (
VALUES (0.95,6e-00,11e-00))n(x,df1,df2)

This produces the following result.

### Support  Copyright 2008-2021 Westclintech LLC         Privacy Policy        Terms of Service