1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/skewness.R
\name{skewness}
\alias{skewness}
\title{Skewness}
\usage{
skewness(x, na.rm = FALSE, method = c("moment", "fisher", "bickel"), M, ...)
}
\arguments{
\item{x}{numeric. Vector of observations.}
\item{na.rm}{logical. Should missing values be removed?}
\item{method}{character. Specifies the method of computation.
These are either \code{"moment"}, \code{"fisher"} or \code{"bickel"}.
The \code{"moment"} method is based on the definition of
skewness for distributions; this form should
be used when resampling (bootstrap or jackknife). The
\code{"fisher"} method corresponds to the usual "unbiased"
definition of sample variance, although in the case of skewness
exact unbiasedness is not possible.}
\item{M}{numeric. (An estimate of) the mode of the observations \code{x}.
Default value is \code{\link[modeest]{shorth}(x)}.}
\item{...}{Additional arguments.}
}
\value{
\code{skewness} returns a numeric value.
An attribute reports the method used.
}
\description{
This function encodes different methods
to calculate the skewness from a vector of
observations.
}
\examples{
## Skewness = 0
x <- rnorm(1000)
skewness(x, method = "bickel", M = shorth(x))
## Skewness > 0 (left skewed case)
x <- rbeta(1000, 2, 5)
skewness(x, method = "bickel", M = betaMode(2, 5))
## Skewness < 0 (right skewed case)
x <- rbeta(1000, 7, 2)
skewness(x, method = "bickel", M = hsm(x, bw = 1/3))
}
\references{
\itemize{
\item Bickel D.R. (2002).
Robust estimators of the mode and skewness of continuous data.
\emph{Computational Statistics and Data Analysis}, \bold{39}:153-163.
\item Bickel D.R. et Fruehwirth R. (2006).
On a Fast, Robust Estimator of the Mode: Comparisons to Other Robust Estimators with Applications.
\emph{Computational Statistics and Data Analysis}, \bold{50}(12):3500-3530.
}
}
\seealso{
\code{\link[modeest]{mlv}} for general mode estimation;
\code{\link[modeest]{shorth}} for the shorth estimate of the mode
}
\author{
Diethelm Wuertz and contributors for the original \code{skewness} function
from package \pkg{fBasics}.
}
|