Learn R Programming

utilities (version 0.4.0)

skewness: Sample Skewness

Description

skewness returns the sample skewness of a data vector/matrix

Usage

skewness(x, skew.type = NULL, na.rm = FALSE)

Arguments

x

A data vector/matrix

skew.type

The type of skewness statistic used ('Moment', 'Fisher Pearson' or 'Adjusted Fisher Pearson')

na.rm

Logical value; if TRUE the function removes NA values

Value

The sample skewness of the data vector/matrix

Details

This function computes the sample skewness for a data vector or matrix. For a vector input the function returns a single value for the sample skewness of the data. For a matrix input the function treats each column as a data vector and returns a vector of values for the sample skewness of each of these datasets. The function can compute different types of skewness statistics using the skew.type input.

Examples

Run this code
# NOT RUN {
skewness(rnorm(1000))
skewness(rexp(1000))

# }

Run the code above in your browser using DataLab