Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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.

2 Replies
sunny_talwar

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?

Not applicable
Author

Working on it

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