Login     Register

        Contact Us     Search

XLeratorDB/statistics Documentation

SQL Server CONFIDENCE.T function


CONFIDENCE_T

Updated: 31 July 2015


Use CONFIDENCE_T to calculate a confidence interval when you don't know the population standard deviation and are using the sample standard deviation instead.
Syntax
SELECT [wct].[CONFIDENCE_T](
  <@Alpha, float,>
 ,<@Standard_dev, float,>
 ,<@Size, float,>)
Arguments
@Alpha
The significance level used to calculate the confidence interval. @Alpha must be of a type float or of type that intrinsically converts to float
@Standard_dev
The sample standard deviation. @Standard_dev must be of a type float or of a type that intrinsically converts to float.
@Size
The sample size. @Size must be of a type float or of a type the intrinsically converts to float.
Return Type
float
Remarks
·         0 < @Alpha < 1
·         0 < Standard_dev
·         0 < @Size
Examples
Given a sample standard deviation of 14.67, calculate the 95% confidence interval for a sample size of 50.
SELECT
       wct.CONFIDENCE_T(
               .05          --@Alpha
              ,14.67        --@Standard_dev
              ,50           --@Size
              ) as CI

This produces the following result
 
The CONFIDENCE_T function is closely related to the T_INV function.
SELECT
        wct.CONFIDENCE_T(alpha,mu,sigma) as CI
       ,wct.T_INV(1-alpha*0.5,sigma-1)*mu/SQRT(sigma) as CI
FROM (VALUES(0.05,14.67,50))n(alpha,mu,sigma)

This produces the following result.

 

See Also

 



Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service