TSA (version 1.3)

skewness: Skewness

Description

Computes the skewness of the data

Usage

skewness(x, na.rm = FALSE)

Arguments

x

data

na.rm

logical variable, if true, missing values are excluded from analysis

Value

The function returns the skewness of the data.

Details

Given data \(x_1,x_2,\ldots, x_n\), the sample skewness is defined by the formula: $$\frac{\sum_{i=1}^n (x_i-\bar{x})^3/n}{(\sum_{i=1}^n (x_i-\bar{x})^2/n)^{3/2}}.$$

Examples

Run this code
# NOT RUN {
data(CREF)
r.cref=diff(log(CREF))*100
skewness(r.cref)
# }

Run the code above in your browser using DataCamp Workspace