2 Replies Latest reply: Mar 13, 2017 10:30 AM by Denis V RSS

    Skew() in Qlik vs skewness() in R

    Denis V

      Hello,
      Maybe someone know why value of skewness computed by Qlik Sense different from value computed by R-studio for same data

      sample.

      Here is evidence :

       

      In Qlik Sense:

       

      RangeSkew( 35,40,12,15,21,14,46,10,28,48,16,30,32,48,31,22,12,39,19,25) gives  0.3263

      RangeKurtosis( 35,40,12,15,21,14,46,10,28,48,16,30,32,48,31,22,12,39,19,25)  gives  -1.1149

       

      In R-studio:

       

      x <- c(35,40,12,15,21,14,46,10,28,48,16,30,32,48,31,22,12,39,19,25)

      > skewness(x)

      [1] 0.3012561

      > kurtosis(x)

      [1] 1.859267

       

      I Wrote formulas  of skewness and kurtosis in R.

      b1 <- ( ( 1 / n ) * ( sum( ( x - mean ( x ) ) ^ 3 )) ) /

      ( ( 1 / n ) * sum ( ( x - mean ( x ) )^2 ) ) ^ (3/2)  ##

      > b1

      [1] 0.3012561

       

      b2 <- ( ( 1 / n ) * ( sum( ( x - mean ( x ) ) ^ 4 )) ) /

      ( ( 1 / n ) * sum ( ( x - mean ( x ) )^2 ) ) ^ (2)

      > b2

      [1] 1.859267

       

      Is it really bug in Qlik Sense or i just don't know something? 

      Hope for exhaustive explanation.