Description Usage Arguments Details Value Note Author(s) References See Also Examples
Compute the sample coefficient of skewness.
1 2 
x 
numeric vector of observations. 
na.rm 
logical scalar indicating whether to remove missing values from 
method 
character string specifying what method to use to compute the sample coefficient
of skewness. The possible values are

l.moment.method 
character string specifying what method to use to compute the
Lmoments when 
plot.pos.cons 
numeric vector of length 2 specifying the constants used in the formula for
the plotting positions when 
Let \underline{x} denote a random sample of n observations from some distribution with mean μ and standard deviation σ.
Product Moment Coefficient of Skewness (method="moment"
or method="fisher"
)
The coefficient of skewness of a distribution is the third
standardized moment about the mean:
η_3 = √{β_1} = \frac{μ_3}{σ^3} \;\;\;\;\;\; (1)
where
η_r = E[(\frac{Xμ}{σ})^r] = \frac{1}{σ^r} E[(Xμ)^r] = \frac{μ_r}{σ^r} \;\;\;\;\;\; (2)
and
μ_r = E[(Xμ)^r] \;\;\;\;\;\; (3)
denotes the r'th moment about the mean (central moment). That is, the coefficient of skewness is the third central moment divided by the cube of the standard deviation. The coefficient of skewness is 0 for a symmetric distribution. Distributions with positive skew have heavy righthand tails, and distributions with negative skew have heavy lefthand tails.
When method="moment"
, the coefficient of skewness is estimated using the
method of moments estimator for the third central moment and and the method of
moments estimator for the variance:
\hat{η}_3 = \frac{\hat{μ}_3}{σ^3} = \frac{\frac{1}{n} ∑_{i=1}^n (x_i  \bar{x})^3}{[\frac{1}{n} ∑_{i=1}^n (x_i  \bar{x})^2]^{3/2}} \;\;\;\;\; (5)
where
\hat{σ}^2_m = s^2_m = \frac{1}{n} ∑_{i=1}^n (x_i  \bar{x})^2 \;\;\;\;\;\; (6)
This form of estimation should be used when resampling (bootstrap or jackknife).
When method="fisher"
, the coefficient of skewness is estimated using the
unbiased estimator for the third central moment
(Serfling, 1980, p.73; Chen, 1995, p.769) and the unbiased estimator for the
variance.
\hat{η}_3 = \frac{\frac{n}{(n1)(n2)} ∑_{i=1}^n (x_i  \bar{x})^3}{s^3} \;\;\;\;\;\; (7)
where
\hat{σ}^2 = s^2 = \frac{1}{n1} ∑_{i=1}^n (x_i  \bar{x})^2 \;\;\;\;\;\; (8)
(Note that Serfling, 1980, p.73 contains a typographical error in the numerator for
the unbiased estimator of the third central moment.)
LMoment Coefficient of skewness (method="l.moments"
)
Hosking (1990) defines the Lmoment analog of the coefficient of skewness as:
τ_3 = \frac{λ_3}{λ_2} \;\;\;\;\;\; (9)
that is, the third Lmoment divided by the second Lmoment. He shows that this quantity lies in the interval (1, 1).
When l.moment.method="unbiased"
, the Lskewness is estimated by:
t_3 = \frac{l_3}{l_2} \;\;\;\;\;\; (10)
that is, the unbiased estimator of the third Lmoment divided by the unbiased estimator of the second Lmoment.
When l.moment.method="plotting.position"
, the Lskewness is estimated by:
\tilde{τ}_3 = \frac{\tilde{λ}_3}{\tilde{λ}_2} \;\;\;\;\;\; (11)
that is, the plottingposition estimator of the third Lmoment divided by the plottingposition estimator of the second Lmoment.
See the help file for lMoment
for more information on
estimating Lmoments.
A numeric scalar – the sample coefficient of skewness.
Traditionally, the coefficient of skewness has been estimated using product
moment estimators. Sometimes an estimate of skewness is used in a
goodnessoffit test for normality (e.g., set
test="skew"
in the call to gofTest
).
Hosking (1990) introduced the idea of Lmoments and Lskewness.
Vogel and Fennessey (1993) argue that Lmoment ratios should replace product moment ratios because of their superior performance (they are nearly unbiased and better for discriminating between distributions). They compare product moment diagrams with Lmoment diagrams.
Hosking and Wallis (1995) recommend using unbiased estimators of Lmoments (vs. plottingposition estimators) for almost all applications.
Steven P. Millard (EnvStats@ProbStatInfo.com)
Berthouex, P.M., and L.C. Brown. (2002). Statistics for Environmental Engineers, Second Edition. Lewis Publishers, Boca Raton, FL.
Chen, L. (1995). Testing the Mean of Skewed Distributions. Journal of the American Statistical Association 90(430), 767–772.
Helsel, D.R., and R.M. Hirsch. (1992). Statistical Methods in Water Resources Research. Elsevier, New York, NY.
Ott, W.R. (1995). Environmental Statistics and Data Analysis. Lewis Publishers, Boca Raton, FL.
Serfling, R.J. (1980). Approximation Theorems of Mathematical Statistics. John Wiley and Sons, New York, p.73.
Taylor, J.K. (1990). Statistical Techniques for Data Analysis. Lewis Publishers, Boca Raton, FL.
Vogel, R.M., and N.M. Fennessey. (1993). L Moment Diagrams Should Replace Product Moment Diagrams. Water Resources Research 29(6), 1745–1752.
Zar, J.H. (2010). Biostatistical Analysis. Fifth Edition. PrenticeHall, Upper Saddle River, NJ.
var
, sd
, cv
,
kurtosis
, summaryFull
,
Summary Statistics.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  # Generate 20 observations from a lognormal distribution with parameters
# mean=10 and cv=1, and estimate the coefficient of skewness.
# (Note: the call to set.seed simply allows you to reproduce this example.)
set.seed(250)
dat < rlnormAlt(20, mean = 10, cv = 1)
skewness(dat)
#[1] 0.9876632
skewness(dat, method = "moment")
#[1] 0.9119889
skewness(dat, meth = "l.moment")
#[1] 0.2656674
#
# Clean up
rm(dat)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs in the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.