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

# Skew() in Qlik vs skewness() in R

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.

• ###### Re: Skew() in Qlik vs skewness() in R

I am not sure about Skewness, but I have noticed that QlikView has it own different way to calculate Fractile (or percentile). My guess is that it might have its own way to calculate Skewness also. Have you tried to replicate your expression in QlikSense to see if the calculation (rather than the function) gives the right output?

• ###### Re: Skew() in Qlik vs skewness() in R

Working on it

Problem that easiest way doesn't work. By the way I need kurtosis and skewness for Jarque bera test.