skewness {e1071} | R Documentation |
Skewness
Description
Computes the skewness.
Usage
skewness(x, na.rm = FALSE, type = 3)
Arguments
x |
a numeric vector containing the values whose skewness is to be computed. |
na.rm |
a logical value indicating whether |
type |
an integer between 1 and 3 selecting one of the algorithms for computing skewness detailed below. |
Details
If x
contains missings and these are not removed, the skewness
is NA
.
Otherwise, write for the non-missing elements of
x
,
for their number,
for their mean,
for
their standard deviation, and
for the sample moments of order
.
Joanes and Gill (1998) discuss three methods for estimating skewness:
- Type 1:
-
. This is the typical definition used in many older textbooks.
- Type 2:
-
. Used in SAS and SPSS.
- Type 3:
-
. Used in MINITAB and BMDP.
All three skewness measures are unbiased under normality.
Value
The estimated skewness of x
.
References
D. N. Joanes and C. A. Gill (1998), Comparing measures of sample skewness and kurtosis. The Statistician, 47, 183–189.
Examples
x <- rnorm(100)
skewness(x)