StatsCalculators.com

Skewness

Created:September 23, 2024
Last Updated:April 25, 2025

This calculator helps you measure the asymmetry of your data distribution. It calculates the skewness coefficient, standard error, and statistical significance, helping you understand whether your data leans more towards one side. It also provides the test statistic and p-value for the skewness test. The calculator also generates a histogram with density histogram with density estimation to visualize the distribution of your data.

Quick Calculator

Need a quick calculation? Enter your numbers below:

Calculator

1. Load Your Data

Note: Column names will be converted to snake_case (e.g., "Product ID" → "product_id") for processing.

2. Select Columns & Options

Related Calculators

Learn More

Understanding Skewness

Definition

Skewness is a measure of asymmetry in a probability distribution. It quantifies how much a distribution deviates from perfect symmetry, where data is evenly distributed around the mean.

Formulas

Pearson's First Coefficient of Skewness (Moment Coefficient):

g1=1ni=1n(xixˉ)3(1ni=1n(xixˉ)2)3/2g_1 = \frac{\frac{1}{n}\sum_{i=1}^n (x_i - \bar{x})^3}{(\frac{1}{n}\sum_{i=1}^n (x_i - \bar{x})^2)^{3/2}}

Based on the third standardized moment of the distribution. More sensitive to extreme values.

Pearson's Second Coefficient of Skewness (Median Skewness):

SK2=3(xˉmedian)sSK_2 = \frac{3(\bar{x} - \text{median})}{s}

Based on the relationship between mean, median, and standard deviation. More robust to outliers.

Where:

  • nn = sample size
  • xix_i = individual values
  • xˉ\bar{x} = sample mean
  • ss = sample standard deviation
  • median\text{median} = middle value when data is ordered

Note: While both coefficients measure skewness, they can give slightly different results. The First Coefficient is more commonly used in statistical software but can be more sensitive to outliers. The Second Coefficient is simpler to interpret and more robust to extreme values.

Interpretation Guidelines

g10.5 | g_1 |\leq 0.5: Approximately symmetric
0.5<g1<1.00.5 <| g_1 |< 1.0: moderately skewed
g11.0| g_1 |\geq 1.0: Highly skewed

Important Considerations

  • Sensitive to outliers due to the cubic term in numerator
  • Requires at least 3 observations to be calculated
  • Should be used alongside visualization for complete understanding

Visual Examples of Skewness

The following examples illustrate how skewness affects the shape of a distribution and the relationships between mean, median, and mode. Hover over the charts to explore the data points.

Approximately Symmetric Distribution

Skewness ≈ 0

Relationship: Mean ≈ Median ≈ Mode

The distribution is balanced around the mean, with similar tails on both sides.

Moderate Positive Skewness

0.5 < Skewness ≤ 1.0

Relationship: Mean > Median > Mode

The distribution has a moderate tail extending to the right.

High Positive Skewness

Skewness > 1.0

Relationship: Mean >> Median > Mode

The distribution has a long tail extending far to the right.

Moderate Negative Skewness

-1.0 ≤ Skewness < -0.5

Relationship: Mean < Median < Mode

The distribution has a moderate tail extending to the left.

High Negative Skewness

Skewness < -1.0

Relationship: Mode > Median >> Mean

The distribution has a long tail extending far to the left.

Key Takeaways

  • The mean is pulled in the direction of the skewness (tail)
  • The median is affected less by extreme values than the mean
  • The mode typically occurs at the peak of the distribution

Skewness vs Kurtosis: Understanding the Difference

While skewness measures the asymmetry of a distribution, kurtosis measures its "tailedness" or the heaviness of the tails relative to a normal distribution.

Skewness

  • Measures asymmetry (left/right imbalance)
  • Can be positive or negative
  • Affects the relationship between mean, median, and mode

Kurtosis

  • Measures "peakedness" and tail extremity
  • High kurtosis = heavier tails, more outliers
  • Affects the shape of the central peak

Combined Analysis

When analyzed together, skewness and kurtosis provide a more complete picture of your distribution's shape. For example, a distribution can be both positively skewed (asymmetric to the right) and leptokurtic (heavy-tailed with many outliers).

How to Calculate Skewness in R

Use the skewness() function from the moments package to calculate skewness.

R
library(tidyverse)
library(moments)

tips <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/tips.csv")
skewness(tips$tip) # 1.456427

# histogram with density 
ggplot(tips, aes(x = tip)) +
  geom_histogram(aes(y = after_stat(density)), binwidth = 0.5, fill = "darkblue", alpha = 0.7) +
  geom_density(adjust=1.5, color = "red", linewidth = 1) + # the adjust parameter controls the smoothness of the density curve
  geom_vline(aes(xintercept = mean(tip)), 
         linetype = "dashed", 
         color = "blue", 
         size = 1) +
  geom_vline(aes(xintercept = median(tip)), 
         linetype = "dotted", 
         color = "green", 
         size = 1) +
  labs(title = "Histogram and Density of Tip Amounts",
       x = "Tip Amount ($)",
       y = "Density") +
  theme_minimal()

How to Calculate Skewness in Python

Python offers multiple libraries for calculating skewness, with SciPy and Pandas being the most common.

Python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as stats
import seaborn as sns

# Create some sample data
data = np.random.lognormal(0, 0.8, 1000)  # Log-normal distribution (positive skew)

# Method 1: Using scipy.stats
skewness_scipy = stats.skew(data)
print(f"Skewness (SciPy): {skewness_scipy:.4f}")

# Method 2: Using pandas
df = pd.DataFrame({'values': data})
skewness_pandas = df['values'].skew()
print(f"Skewness (Pandas): {skewness_pandas:.4f}")

# Visualize with histogram and density plot
plt.figure(figsize=(10, 6))
sns.histplot(data, kde=True, stat="density")
plt.axvline(np.mean(data), color='red', linestyle='dashed', linewidth=2, label=f'Mean: {np.mean(data):.2f}')
plt.axvline(np.median(data), color='green', linestyle='dotted', linewidth=2, label=f'Median: {np.median(data):.2f}')
plt.title(f'Positively Skewed Distribution (Skewness: {skewness_scipy:.4f})')
plt.legend()
plt.show()

How to Calculate Skewness in Excel

There are two ways to calculate skewness in Excel:

Method 1: Using the SKEW Function

The SKEW function calculates the skewness of a distribution based on a sample.

Excel
=SKEW(A2:A100)

Method 2: Using the Data Analysis ToolPak

  1. Enable the Data Analysis ToolPak in Excel (File > Options > Add-ins)
  2. Go to Data tab > Data Analysis
  3. Select "Descriptive Statistics" and click OK
  4. Select your input range and check "Summary statistics"
  5. Click OK to view skewness along with other statistics