Login     Register

        Contact Us     Search

XLeratorDB/statistics Documentation

SQL Server CONFIDENCE function


 
Updated: 9 August 2010

Use CONFIDENCE to calculate a value that you can use to construct a confidence interval for a population mean. Confidence intervals are used to indicate the reliability of an estimate.
 
Syntax
SELECT [wctStatistics].[wct].[CONFIDENCE] (
   <@Alpha, float,>
 ,<@Standard_dev, float,>
 ,<@Size, float,>)
Arguments
@Alpha
is the significance level use to compute the confidence interval. The confidence interval equals 1-@Alpha. @Alpha is an expression of type float or of a type that can be implicitly converted to float
@Standard_dev
is the population standard deviation for the dataset. @Standard_dev is an expression of type float or of a type that can be implicitly converted to float
@Size
is the sample size. @Size is an expression of type float or of a type that can be implicitly converted to float
 
Return Types
float
Remarks
·         If @Alpha ≤ 0 or @Alpha≥ 1, CONFIDENCE returns an error.
·         If @Standard_dev ≤ 0, CONFIDENCE returns an error
·         @Size is truncated to zero decimal places.
·         If @Size < 1, CONFIDENCE returns an error
·         CONFIDENCE = NORMSINV(1-@Alpha/2)*(@Standard_dev/SQRT(@Size))
Examples

select
wct.CONFIDENCE(.025,6.25,150)
 

This produces the following result

----------------------
1.14381103915062
 
(1 row(s) affected)
 
 
select wct.NORMSINV(.9875)*(6.25/SQRT(150))
 

This produces the following result

----------------------
1.14381103915062
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service