klebyn
2005-Dec-01 23:22 UTC
[R] about comparison of KURTOSIS in package: moments and fBasics
Hello I do not know very much about statistics (and English language too :-( ), then I come in search of a clarification (explanation): I found two distinct results on KURTOSIS and I do not know which of them is the correct one. Any aid will be welcome! klebyn ################ CODE rnorm(1000) -> x library(moments) kurtosis(x) skewness(x) detach("package:moments") library(fBasics) kurtosis(x) skewness(x) detach("package:fBasics") R.version ################ OUTPUT > > rnorm(1000) -> x > > > library(moments) > > > kurtosis(x) [1] 3.145274 > skewness(x) [1] 0.04898635 > > > detach("package:moments") > library(fBasics) Rmetrics, (C) 1999-2005, Diethelm Wuertz, GPL fBasics: Markets, Basic Statistics, Hypothesis Testing > > > kurtosis(x) [1] 0.1389865 > skewness(x) [1] 0.04891289 > > > detach("package:fBasics") > > R.version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 2.0 year 2005 month 10 day 06 svn rev 35749 language R > >
P Ehlers
2005-Dec-02 22:28 UTC
[R] about comparison of KURTOSIS in package: moments and fBasics
(Haven't seen an anwer to this yet; maybe I missed it.) klebyn wrote:> > > Hello > > > > I do not know very much about statistics (and English language too :-( ), > then I come in search of a clarification (explanation): > > I found two distinct results on KURTOSIS and > I do not know which of them is the correct one. > Any aid will be welcome! > > > klebynThe code will show you why you get different results. fBasics: kurtosis = sum((x - mean(x))^4/var(x)^2)/length(x) - 3 moments: n <- length(x) n * sum((x - mean(x))^4)/(sum((x - mean(x))^2)^2) So pkg:moments uses the ratio of 4th sample moment to square of second sample moment, while pkg:fBasics uses the variance instead of the second moment and subtracts 3 (for reasons to do with the Normal distribution). Peter Ehlers> > > > ################ CODE > > rnorm(1000) -> x > > library(moments) > > kurtosis(x) > skewness(x) > > detach("package:moments") > library(fBasics) > > kurtosis(x) > skewness(x) > > detach("package:fBasics") > > R.version > > ################ OUTPUT > > > > > rnorm(1000) -> x > > > > > > library(moments) > > > > > > kurtosis(x) > [1] 3.145274 > > skewness(x) > [1] 0.04898635 > > > > > > detach("package:moments") > > library(fBasics) > > Rmetrics, (C) 1999-2005, Diethelm Wuertz, GPL > fBasics: Markets, Basic Statistics, Hypothesis Testing > > > > > > kurtosis(x) > [1] 0.1389865 > > skewness(x) > [1] 0.04891289 > > > > > > detach("package:fBasics") > > > > R.version > _ > platform i386-pc-mingw32 > arch i386 > os mingw32 > system i386, mingw32 > status > major 2 > minor 2.0 > year 2005 > month 10 > day 06 > svn rev 35749 > language R > > > > > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Baize, Harold
2005-Dec-05 16:32 UTC
[R] about comparison of KURTOSIS in package: moments and fBasics
Thanks to Spencer Graves for providing links to explain the various types of kurtosis reported by R packages. Spencer Graves>>(http://mathworld.wolfram.com/k-Statistic.html). Spencer also said: SG>> However, these are little used, as the estimates are known to be so SG>> highly variable. It is generally preferred to transform to normality or SG>> to use some other distribution and then use maximum likelihood. This advice is good if your interest is comparing models, but what if variation in kurtosis itself is your interest? I am wondering if someone could provide some direction for answering questions about differences between samples in kurtosis. There are tests of significance for means and variance. How would one test hypotheses of difference in kurtosis between samples? Thanks in advance. Harold Baize Youth Services Evaluator Butte County Department of Behavioral Health
Seemingly Similar Threads
- Computing skewness and kurtosis with the moments package
- Skewness and Kurtosis
- Calculation of Central Moments
- moments, skewness, kurtosis
- Generating series of distributions with the same skewness and different kurtosis or with same kurtosis and different skewness?