KURT_q
Updated: 6 August 2010
Use KURT_q to calculate the kurtosis of a dataset. Kurtosis measures the peakedness of a distribution. Kurtosis is computed by taking the fourth moment of a distribution. A high kurtosis has a sharper peak and fatter tails, while a low kurtosis has a more rounded peak and shorter thinner tails. The equation for kurtosis is:
Syntax
SELECT [wctStatistics].[wct].[KURT_q] (
<@K_RangeQuery, nvarchar(4000),>)
Arguments
@K_RangeQuery
the select statement, as text, used to determine the values to be used in the KURT_q calculation.
Return Types
float
Remarks
· If there are fewer than four data points or if the standard deviation of the sample equal zero, KURT_q returns an error.
· No GROUP BY is required for this function even though it produces aggregated results.
Examples
CREATE TABLE #k1(
[num] [float] NOT NULL
)
INSERT INTO #k1 VALUES (91.3698)
INSERT INTO #k1 VALUES (76.3382)
INSERT INTO #k1 VALUES (74.5692)
INSERT INTO #k1 VALUES (85.2957)
INSERT INTO #k1 VALUES (99.0112)
INSERT INTO #k1 VALUES (86.99)
INSERT INTO #k1 VALUES (70.7837)
INSERT INTO #k1 VALUES (72.834)
INSERT INTO #k1 VALUES (78.1644)
INSERT INTO #k1 VALUES (77.7472)
INSERT INTO #k1 VALUES (66.0627)
INSERT INTO #k1 VALUES (59.781)
INSERT INTO #k1 VALUES (68.4793)
INSERT INTO #k1 VALUES (78.6103)
INSERT INTO #k1 VALUES (59.8621)
select wct.KURT_q('select num from #k1')
This produces the following result
----------------------
-0.0704978735822985
(1 row(s) affected)