## `stats::obliquity` -- obliquity (skewness)

#### Introduction

`stats::obliquity``(data)` returns the obliquity (skewness) of the data.

#### Call(s)

`stats::obliquity(x1, x2, ..)`
`stats::obliquity([x1, x2, ..])`
`stats::obliquity(s <, c>)`

#### Parameters

`x1, x2, ..` | - | the statistical data: arithmetical expressions.
`s` | - | a sample of domain type `stats::sample`.
`c` | - | an integer representing a column index of the sample `s`. This column provides the data `x1`, `x2` etc.

#### Returns

an arithmetical expression. `FAIL` is returned, if the obliquity does not exist.

#### Related Functions

`stats::kurtosis`

#### Details

- The obliquity of n values x[1],..,x[n] is

      (1/n*((x[1] - X)^3 + .. +(x[n] - X)^3)) /
                     (1/n*((x[1] - X)^2 + .. +(x[n] - X)^2))^(3/2) ,

  where X is the mean value of the x[i]. The obliquity is a measure for the symmetry of a distribution. It is zero, if the distribution of the data is symmetric around the mean. Positive values indicate that the distribution function has a ``longer tail'' to the right of the mean than to the left. Negative values indicate a ``longer tail'' to the left.
- The column index `c` is optional, if the data are given by a `stats::sample` object containing only one non-string column. Cf. example 3.

#### Example 1

We calculate the obliquity of a data sequence:

    >> float(stats::obliquity(0, 7, 7, 6, 6, 6, 5, 5, 4, 1))

                                   -1.041368312

Alternatively, the data may be passed as a list:

    >> stats::obliquity([2, 2, 4, 6, 8, 10, 10])

                                         0

#### Example 2

We create a sample:

    >> stats::sample([[a, 5, 8], [b, 3, 7], [c, d, 0]])

                                     a  5  8
                                     b  3  7
                                     c  d  0

The obliquity of the second column is:

    >> stats::obliquity(%, 2)

                1/2 / /       d \3   /       d \3   / 2 d       \3 \
               3    | | 1/3 - - |  + | 7/3 - - |  + | --- - 8/3 |  |
                    \ \       3 /    \       3 /    \  3        /  /
               -----------------------------------------------------
                / /       d \2   /       d \2   / 2 d       \2 \3/2
                | | 1/3 - - |  + | 7/3 - - |  + | --- - 8/3 |  |
                \ \       3 /    \       3 /    \  3        /  /

#### Example 3

We create a sample consisting of one string column and one non-string column:

    >> stats::sample([["1996", 1242], ["1997", 1353], ["1998", 1142]])

                                  "1996"  1242
                                  "1997"  1353
                                  "1998"  1142

We compute the obliquity of the second column. In this case this column does not have to be specified, since it is the only non-string column:

    >> float(stats::obliquity(%))

                                   0.06374333648

#### Changes

- new function

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000