DBILITY

왜도,첨도 계산해 보기 본문

statistics/SPC

왜도,첨도 계산해 보기

DBILITY 2018. 11. 13. 17:29
반응형

 

간만에 MS워드 수식도 입력해 보고 이것참...

 

 

 

WITH T1 (ACTVALUE) AS (
    SELECT 0.529  FROM DUAL UNION ALL
    SELECT 0.55  FROM DUAL UNION ALL
    SELECT 0.555  FROM DUAL UNION ALL
    SELECT 0.541  FROM DUAL UNION ALL
    SELECT 0.559  FROM DUAL UNION ALL
    SELECT 0.543  FROM DUAL UNION ALL
    SELECT 0.557  FROM DUAL UNION ALL
    SELECT 0.559  FROM DUAL UNION ALL
    SELECT 0.581  FROM DUAL UNION ALL
    SELECT 0.551  FROM DUAL UNION ALL
    SELECT 0.493  FROM DUAL UNION ALL
    SELECT 0.534  FROM DUAL UNION ALL
    SELECT 0.527  FROM DUAL UNION ALL
    SELECT 0.511  FROM DUAL UNION ALL
    SELECT 0.565  FROM DUAL UNION ALL
    SELECT 0.559  FROM DUAL UNION ALL
    SELECT 0.519  FROM DUAL UNION ALL
    SELECT 0.562  FROM DUAL UNION ALL
    SELECT 0.551  FROM DUAL UNION ALL
    SELECT 0.53  FROM DUAL UNION ALL
    SELECT 0.545  FROM DUAL UNION ALL
    SELECT 0.588  FROM DUAL UNION ALL
    SELECT 0.544  FROM DUAL UNION ALL
    SELECT 0.561  FROM DUAL UNION ALL
    SELECT 0.573  FROM DUAL UNION ALL
    SELECT 0.607  FROM DUAL UNION ALL
    SELECT 0.532  FROM DUAL UNION ALL
    SELECT 0.562  FROM DUAL UNION ALL
    SELECT 0.542  FROM DUAL UNION ALL
    SELECT 0.549  FROM DUAL UNION ALL
    SELECT 0.577  FROM DUAL UNION ALL
    SELECT 0.526  FROM DUAL UNION ALL
    SELECT 0.546  FROM DUAL UNION ALL
    SELECT 0.557  FROM DUAL UNION ALL
    SELECT 0.548  FROM DUAL UNION ALL
    SELECT 0.546  FROM DUAL UNION ALL
    SELECT 0.56  FROM DUAL UNION ALL
    SELECT 0.53  FROM DUAL UNION ALL
    SELECT 0.564  FROM DUAL UNION ALL
    SELECT 0.514  FROM DUAL UNION ALL
    SELECT 0.527  FROM DUAL UNION ALL
    SELECT 0.545  FROM DUAL UNION ALL
    SELECT 0.513  FROM DUAL UNION ALL
    SELECT 0.557  FROM DUAL UNION ALL
    SELECT 0.525  FROM DUAL UNION ALL
    SELECT 0.557  FROM DUAL UNION ALL
    SELECT 0.559  FROM DUAL UNION ALL
    SELECT 0.529  FROM DUAL UNION ALL
    SELECT 0.539  FROM DUAL UNION ALL
    SELECT 0.591  FROM DUAL UNION ALL
    SELECT 0.538  FROM DUAL UNION ALL
    SELECT 0.557  FROM DUAL UNION ALL
    SELECT 0.517  FROM DUAL UNION ALL
    SELECT 0.521  FROM DUAL UNION ALL
    SELECT 0.568  FROM DUAL UNION ALL
    SELECT 0.544  FROM DUAL UNION ALL
    SELECT 0.55  FROM DUAL UNION ALL
    SELECT 0.562  FROM DUAL UNION ALL
    SELECT 0.54  FROM DUAL UNION ALL
    SELECT 0.537  FROM DUAL UNION ALL
    SELECT 0.558  FROM DUAL UNION ALL
    SELECT 0.548  FROM DUAL UNION ALL
    SELECT 0.532  FROM DUAL UNION ALL
    SELECT 0.57  FROM DUAL UNION ALL
    SELECT 0.567  FROM DUAL UNION ALL
    SELECT 0.56  FROM DUAL UNION ALL
    SELECT 0.533  FROM DUAL UNION ALL
    SELECT 0.538  FROM DUAL UNION ALL
    SELECT 0.567  FROM DUAL UNION ALL
    SELECT 0.557  FROM DUAL UNION ALL
    SELECT 0.541  FROM DUAL UNION ALL
    SELECT 0.534  FROM DUAL UNION ALL
    SELECT 0.544  FROM DUAL UNION ALL
    SELECT 0.537  FROM DUAL UNION ALL
    SELECT 0.574  FROM DUAL UNION ALL
    SELECT 0.572  FROM DUAL UNION ALL
    SELECT 0.556  FROM DUAL UNION ALL
    SELECT 0.56  FROM DUAL UNION ALL
    SELECT 0.52  FROM DUAL UNION ALL
    SELECT 0.578  FROM DUAL UNION ALL
    SELECT 0.543  FROM DUAL UNION ALL
    SELECT 0.544  FROM DUAL UNION ALL
    SELECT 0.541  FROM DUAL UNION ALL
    SELECT 0.526  FROM DUAL UNION ALL
    SELECT 0.518  FROM DUAL UNION ALL
    SELECT 0.521  FROM DUAL UNION ALL
    SELECT 0.532  FROM DUAL UNION ALL
    SELECT 0.524  FROM DUAL UNION ALL
    SELECT 0.544  FROM DUAL UNION ALL
    SELECT 0.523  FROM DUAL UNION ALL
    SELECT 0.55  FROM DUAL UNION ALL
    SELECT 0.544  FROM DUAL UNION ALL
    SELECT 0.545  FROM DUAL UNION ALL
    SELECT 0.571  FROM DUAL UNION ALL
    SELECT 0.527  FROM DUAL UNION ALL
    SELECT 0.536  FROM DUAL UNION ALL
    SELECT 0.554  FROM DUAL UNION ALL
    SELECT 0.569  FROM DUAL UNION ALL
    SELECT 0.531  FROM DUAL UNION ALL
    SELECT 0.534  FROM DUAL
), T2 (X,Y, COEF_VAR,MSSD) AS (
    SELECT
        AVG(ACTVALUE)
        , STDDEV_SAMP(ACTVALUE)
        , (100*STDDEV_SAMP(ACTVALUE))/AVG(ACTVALUE)
        ,SUM(C)/(2*(COUNT(*)-1))
    FROM
    (SELECT
        ACTVALUE,                  
        POWER(LAG(ACTVALUE) OVER(ORDER BY 0 )-ACTVALUE,2) C        
     FROM T1 ) AA
)
SELECT
    (SUM(POWER(ACTVALUE-T2.X,3))/COUNT(*)) / POWER((SUM(POWER(ACTVALUE-T2.X,2))/COUNT(*)),3/2) SAMP_SKEW   
  , (SUM(POWER(ACTVALUE-T2.X,3))/COUNT(*)) / POWER(SQRT(SUM(POWER(ACTVALUE-T2.X,2))/COUNT(*)),3) SAMP_SKEW2 
  , (SQRT(COUNT(*)*(COUNT(*)-1))/(COUNT(*)-2)) * ((SUM(POWER(ACTVALUE-T2.X,3))/COUNT(*))/POWER((SUM(POWER(ACTVALUE-T2.X,2))/COUNT(*)),3/2)) POPU_SKEW
  , (COUNT(*)/((COUNT(*)-1)*(COUNT(*)-2))) * SUM(POWER((ACTVALUE-T2.X)/T2.Y,3)) MINITAB_SKEW
  , ((SUM(POWER(ACTVALUE-T2.X,4))/COUNT(*)) / POWER(SUM(POWER(ACTVALUE-T2.X,2))/COUNT(*),2))-3 SAMP_KURT
  , (COUNT(*)-1)/((COUNT(*)-2)*(COUNT(*)-3))*
    ( (COUNT(*)+1)*(((SUM(POWER(ACTVALUE-T2.X,4))/COUNT(*)) / POWER(SUM(POWER(ACTVALUE-T2.X,2))/COUNT(*),2))-3)+6) POPU_KURT  
  , ((COUNT(*)*(COUNT(*)+1)/((COUNT(*)-1)*(COUNT(*)-2)*(COUNT(*)-3)))*SUM(POWER((ACTVALUE-T2.X)/T2.Y,4))) 
    -((3*POWER(COUNT(*)-1,2))/((COUNT(*)-2)*(COUNT(*)-3))) MINITAB_KURT
  , T2.COEF_VAR
  , T2.MSSD
FROM T1,T2 GROUP BY 0,T2.COEF_VAR, T2.MSSD

왜도_첨도_계산_오라클.sql
0.01MB

반응형
Comments