Re: [R] skewness, kurtosis

About this list Date view Thread view Subject view Author view

Andreas Weingessel (Andreas.Weingessel@ci.tuwien.ac.at)
Wed, 28 Jul 1999 11:32:55 +0200 (CEST)



>>>>> On Wed, 28 Jul 1999 10:57:25 CET (+0100),
>>>>> Wolfgang Koller (WK) wrote:

WK> Dear R-Users and Developpers,
WK> Currently R does not include functions to compute the skewness and
WK> kurtosis. I programmed it myself in the following way, but probably
WK> *real* programmers/statisticians can do that better:

The package e1071 (available at CRAN) contains some statistical
functions we find useful, including our versions of skewness and
kurtosis. (They are more or less the same as your functions, besides
an additional na.rm-flag).

WK> mykurtosis <- function(x) {
WK> m4 <- mean((x-mean(x))^4)
WK> kurt <- m4/(sd(x)^4)-3
WK> kurt
WK> }

WK> myskewness <- function(x) {
WK> m3 <- mean((x-mean(x))^3)
WK> skew <- m3/(sd(x)^3)
WK> skew
WK> }

-aw

************************************************************************
* Andreas Weingessel *
************************************************************************
* Institut für Statistik * Tel: (+43 1) 58801 10716 *
* Technische Universität Wien * Fax: (+43 1) 58801 10798 *
* Wiedner Hauptstr. 8-10/1071 * Andreas.Weingessel@ci.tuwien.ac.at *
* A-1040 Wien, Austria * http://www.ci.tuwien.ac.at/~weingessel *
************************************************************************

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b3 on Tue 04 Jan 2000 - 13:33:56 EST