skewness {datawizard}R Documentation

Compute Skewness and (Excess) Kurtosis

Description

Compute Skewness and (Excess) Kurtosis

Usage

skewness(x, ...)

## S3 method for class 'numeric'
skewness(
  x,
  remove_na = TRUE,
  type = "2",
  iterations = NULL,
  verbose = TRUE,
  na.rm = TRUE,
  ...
)

kurtosis(x, ...)

## S3 method for class 'numeric'
kurtosis(
  x,
  remove_na = TRUE,
  type = "2",
  iterations = NULL,
  verbose = TRUE,
  na.rm = TRUE,
  ...
)

## S3 method for class 'parameters_kurtosis'
print(x, digits = 3, test = FALSE, ...)

## S3 method for class 'parameters_skewness'
print(x, digits = 3, test = FALSE, ...)

## S3 method for class 'parameters_skewness'
summary(object, test = FALSE, ...)

## S3 method for class 'parameters_kurtosis'
summary(object, test = FALSE, ...)

Arguments

x

A numeric vector or data.frame.

...

Arguments passed to or from other methods.

remove_na

Logical. Should NA values be removed before computing (TRUE) or not (FALSE, default)?

type

Type of algorithm for computing skewness. May be one of 1 (or "1", "I" or "classic"), 2 (or "2", "II" or "SPSS" or "SAS") or 3 (or "3", "III" or "Minitab"). See 'Details'.

iterations

The number of bootstrap replicates for computing standard errors. If NULL (default), parametric standard errors are computed.

verbose

Toggle warnings and messages.

na.rm

Deprecated. Please use remove_na instead.

digits

Number of decimal places.

test

Logical, if TRUE, tests if skewness or kurtosis is significantly different from zero.

object

An object returned by skewness() or kurtosis().

Details

Skewness

Symmetric distributions have a skewness around zero, while a negative skewness values indicates a "left-skewed" distribution, and a positive skewness values indicates a "right-skewed" distribution. Examples for the relationship of skewness and distributions are:

(https://en.wikipedia.org/wiki/Skewness)

Types of Skewness

skewness() supports three different methods for estimating skewness, as discussed in Joanes and Gill (1988):

Kurtosis

The kurtosis is a measure of "tailedness" of a distribution. A distribution with a kurtosis values of about zero is called "mesokurtic". A kurtosis value larger than zero indicates a "leptokurtic" distribution with fatter tails. A kurtosis value below zero indicates a "platykurtic" distribution with thinner tails (https://en.wikipedia.org/wiki/Kurtosis).

Types of Kurtosis

kurtosis() supports three different methods for estimating kurtosis, as discussed in Joanes and Gill (1988):

Standard Errors

It is recommended to compute empirical (bootstrapped) standard errors (via the iterations argument) than relying on analytic standard errors (Wright & Herrington, 2011).

Value

Values of skewness or kurtosis.

References

Examples

skewness(rnorm(1000))
kurtosis(rnorm(1000))

[Package datawizard version 0.12.2 Index]