CONFIDENCE
Updated 2023-11-02 21:18:54.500000
Syntax
SELECT [westclintech].[wct].[CONFIDENCE] (
<@Alpha, float,>
,<@Standard_dev, float,>
,<@Size, float,>)
Description
Use the scalar function 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.
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.
@Size
is the sample size. @Size 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.
Return Type
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.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1.14381103915062"}]}
select wct.NORMSINV(.9875) * (6.25 / SQRT(150));
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1.14381103915062"}]}