如何在MS Access 2013中获得Skewness和/或Kurtosis?

时间:2015-06-09 16:49:58

标签: sql ms-access

如何在MS Access 2013中获得偏斜和峰度?

我的tblFirst250有GM列,可以是Null,数据范围大约是-5到5.IU中的每个值都是1或NULL。

当IU = 1的记录时,我试图得到表格中GM列的偏斜和峰度。

(我在这里找不到歪斜和峰度所以我将它添加到下一个需要它的人那里。)

1 个答案:

答案 0 :(得分:2)

以下是你如何得到它们:

SELECT t1.IU, 
    (Sum((t1.GM-z.TheAvg)^3)/Count(t1.GM))/(Sum((t1.GM-z.TheAvg)^2)/Count(t1.GM))^1.5 AS Skewness, 
    (Sum((t1.GM-z.TheAvg)^4)/Count(t1.GM))/(Sum((t1.GM-z.TheAvg)^2)/Count(t1.GM))^2 AS Kurtosis
FROM tblFirst250 AS t1 INNER JOIN 
    [SELECT t1.IU, Avg(t1.GM) AS TheAvg
    FROM tblFirst250 t1 GROUP BY t1.IU]. AS z ON t1.IU = z.IU
GROUP BY t1.IU
HAVING Count(t1.GM) > 0;

改编自: http://www.experts-exchange.com/articles/2529/Median-Mode-Skewness-and-Kurtosis-in-MS-Access.html