>>>>> 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 at 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 at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear R-Users and Developpers, Currently R does not include functions to compute the skewness and kurtosis. I programmed it myself in the following way, but probably *real* programmers/statisticians can do that better: mykurtosis <- function(x) { m4 <- mean((x-mean(x))^4) kurt <- m4/(sd(x)^4)-3 kurt } myskewness <- function(x) { m3 <- mean((x-mean(x))^3) skew <- m3/(sd(x)^3) skew } I would also suggest to include the quartile-coefficient of skewness (sorry if this translation from German is not correct). This measure is confined to the interval [0,1] and much easier to interpret. My try: myqcskewness <- function(x) { x25 <- as.double(quantile(x,prob=0.25)) x75 <- as.double(quantile(x,prob=0.75)) qcsk <- (x25+x75-2*mean(x))/(x75-x25) qcsk } Finally a question which actually is not R-related (please excuse this misuse of the list): Is there something like a "quantile-coefficient of kurtosis"?? Maybe: k = (2b-a)/a with a = x_{p} - x_{1-p}, b = x_{q} - x_{1-q}, x_{} are quantiles, and p and q are chosen so that k=0 for the normal distribution. Thanks for help!! WK ---------------------------------------------------------- Wolfgang Koller, koller2 at fgr.wu-wien.ac.at Research Institute for European Affairs Vienna University of Economics and Business Administration Althanstrasse 39-45, 1090 Vienna, Austria -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Seemingly Similar Threads
- Generating series of distributions with the same skewness and different kurtosis or with same kurtosis and different skewness?
- alternative option in skewness and kurtosis tests?
- moments, skewness, kurtosis
- Computing skewness and kurtosis with the moments package
- notation for skewness and kurtosis