The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



CalcAndTestSkewness


Unit:SDL_statis
Class: none
Declaration: function CalcAndTestSkewness (Data: TDoubleArray; OneSided: boolean; var m3, Gamma, zStatistic: double): double;

The function CalcAndTestSkewness calculates the third moment and the skewness. Additionally it performs a test for the significance of the skewness. The array Data contains the data, the parameter OneSided controls whether the test is conducted one-sided or two-sided. The variable parameters m3 and Gamma return the third moment and the skewness, respectively. The variable zStatistic returns the value of the normally distributed statistic for the test.

The function value is the probability of the test. The null hypothesis has to be rejected if the probability is less than the level of significance. Depending on the parameter OneSided the following null hypotheses are assumed:
OneSided Null Hypothesis
TRUE H0: the distribution is skewed to the left
FALSE H0: the distribution is symmetric

Returned error codes:

≥0 ... everything is OK, the returned value represents the p-value
-1 ... the number of data points is less than 8
-2 ... standard deviation must not be zero

Hint: If you want to test for a right-skewed distribution you have to set the OneSided parameter to TRUE and substract the resulting probability from 1.0



Last Update: 2023-Feb-06