---
title: skewness_y() | skewness_x() | Tiger Data Docs
description: Calculate the skewness from a two-dimensional statistical aggregate for the dimension specified
---

Since [1.3.0](https://github.com/timescale/timescaledb-toolkit/releases/tag/1.3.0)

Calculate the skewness from a two-dimensional statistical aggregate for the given dimension. For example, `skewness_y()` calculates the skewness for all the values of the `y` variable, independent of values of the `x` variable. The skewness is the third statistical moment. It is a measure of asymmetry in a data distribution.

## Samples

Calculate the skewness of a sample containing the integers from 0 to 100:

```
SELECT skewness_x(stats_agg(data, data))
  FROM generate_series(0, 100) data;
```

```
skewness_x
----------
0
```

## Arguments

The syntax is:

```
skewness_y(
  summary StatsSummary2D,
  [ method TEXT ]
) RETURNS DOUBLE PRECISION
```

```
skewness_x(
  summary StatsSummary2D,
  [ method TEXT ]
) RETURNS DOUBLE PRECISION
```

| Name    | Type           | Default  | Required | Description                                                                                                                              |
| ------- | -------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| summary | StatsSummary2D | -        | ✔        | The statistical aggregate produced by a `stats_agg` call                                                                                 |
| method  | TEXT           | `sample` | -        | The method used for calculating the skewness. The two options are `population` and `sample`, which can be abbreviated to `pop` or `samp` |

## Returns

| Column      | Type        | Description      |
| ----------- | ----------- | ---------------- |
| skewness\_y | skewness\_x | DOUBLE PRECISION |
