I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 0.40
sub units 0.50
+
0

Skewness

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

Dependents

Info

Interface

C++

Skewness

 
template<class T> doubleskewnessintn
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 x_1, x_2, ..., x_N, the formula for skewness is: where \inline \overline{x} is the aritmetic mean, \inline \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

nthe size of the population
datathe 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.