• https://me.yahoo.com
COST (GBP)
0.40
0.50
0

# Skewness

Calculates the skewness of a given set of data.
Controller: CodeCogs
Contents

C++

## Skewness

 template doubleskewness( int n T* data )
Skewness is a measure of symmetry, or more precisely, the lack of symmetry. A distribution, or data set, is symmetric if it looks the same to the left and right of the center point. For univariate data $\inline&space;x_1,&space;x_2,&space;...,&space;x_N$, the formula for skewness is:
$skewness=&space;\frac{1}{(N-1)&space;\sigma^3}&space;\sum_{i=1}^N&space;(x_i&space;-&space;\overline{x})^3$
where $\inline&space;\overline{x}$ is the aritmetic mean, $\inline&space;\sigma$ is the standard deviation, and N is the number of data points.

The skewness for a normal distribution is zero, and any symmetric data should have a skewness near zero. Negative values for the skewness indicate data that are skewed left and positive values for the skewness indicate data that are skewed right.

### Example 1

#include <codecogs/statistics/moments/skewness.h>
#include <iostream>
int main()
{
float x[5] = {3.4 , 7.1 , 1.5 , 8.6 , 4.9};
double skew = Stats::Moments::skewness<float>(5, x);
std::cout << "The population skewness is: " << skew << std::endl;
return 0;
}
Output:
The population skewness is:-0.0107687

### Parameters

 n the size of the population data the actual population data given as an array

### Returns

the skewness of the given set of data

### Authors

Anca Filibiu (August 2005)
##### Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.