skewness(x, na.rm=F, method="fisher", weights=NULL, freq=NULL) kurtosis(x, na.rm=F, method="fisher", weights=NULL, freq=NULL)
(NA)
are allowed.
na.rm=TRUE
, missing
values are removed from
x
before doing
the computations.
If
na.rm=FALSE
and
x
contains missing values,
then the return value is
NA
.
"fisher"
for Fisher's g1 (skewness)
and g2 (kurtosis) versions, and
"moment"
for the functional forms of the statistics.
Only the first character of the string needs to be supplied.
x
; if supplied then skewness or
kurtosis for a weighted distribution is calculated, and
method="moments"
is used.
x
, giving frequencies.
If supplied then results are equivalent
to supplying
rep(x, freq)
instead of
x
.
If
y = x - mean(x)
, then
the
"moment"
method computes the skewness
as
mean(y^3)/mean(y^2)^1.5
and
the kurtosis
as
mean(y^4)/mean(y^2)^2 - 3
.
To see the
"fisher"
calculations,
print out the default methods
skewness.default
or
kurtosis.default
.
The
"moment"
forms are based on the
definitions of skewness and kurtosis for distributions;
these forms should be used when resampling (bootstrap or jackknife).
The
"fisher"
forms correspond to
the usual "unbiased" definition of sample variance,
though in the case of skewness and kurtosis exact
unbiasedness is not possible.
freq
affects the Fisher adjustment but
weights
does not.
x <- runif(30) skewness(x) skewness(x, method="moment") skewness(x, weights = 1:30) skewness(x, freq = 1:30) kurtosis(x) kurtosis(x, method="moment")