# Learn About Calculating the Skew

This tutorial describes how to calculate the skew

## Calculating the Skew

In data statistics, skewness can be thought of as a lack of symmetry in the data. When analyzing data, mathematical properties about that data can be useful in understanding it. Two rather useful metrics are skew and, in the next section, kurtosis. We measure skew as a number, positive or negative, which references whether the data set is shifted in one direction or the other. A skew of 0 means that the data is symmetrical around the mean. A positive skew, or right skew, indicates the tail of the data is longer above the mean. A negative skew, or left skew, is the opposite. For calculating skew, we use an equation that is common in statistical packages, called the "Fisher-Pearson Standardized Moment Coefficient."

$\text{Skew=}\frac{n}{\left(n-1\right)\left(n-2\right)}\sum _{i=1}^{n}{\left(\frac{{x}_{i}-\overline{x}}{s}\right)}^{3}$

The skew is calculated using the helper action Skew() which is within the DataFrame's class. To do this, we will use our 'frame' object and call the function Skew(). In this case we will be calculating the skew of the area of dry bean classifications. Here is a brief description on how Skew() works.

Skew Function
FunctionDescriptionUsage
dataFrameObject:Skew() This action takes the column that you have passed and calculates the skew of that column. Note that it can only calculate the skew of one column at a time.frame:Skew()

Here is some code on how to calculate the skew:

//We need the DataFrame class to load in files for Data Science operations.
use Libraries.Compute.Statistics.DataFrame

//Create a DataFrame, which is essentially a table that understands
//Using the default loader is enough for our purposes
DataFrame frame

//Tell the frame we want the first column selected