假设检验R中的偏度和/或峰度 [英] Hypothesis Testing Skewness and/or Kurtosis in R

查看:436
本文介绍了假设检验R中的偏度和/或峰度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在假设检验中,如何具体检验变量的偏度和/或峰度的原假设和替代假设?我必须在t.test中使用公式吗?

How do I specifically test the null and alternative hypothesis of the skewness and/or Kurtosis of a variable in hypothesis testing? Would I have to use a formula in t.test?

    t.test(data$variable, y = Null)

感谢您的帮助.谢谢!

推荐答案

您有很多选择.使用momentse1071软件包测试偏斜度和峰度的两种最佳方法:

You have many options. Two of the best ways to test skewness and kurtosis using the moments or e1071 package:

duration <- data$variable # I'm going to call it duration

library(moments)
kurtosis(duration)
skewness(duration)

library(e1071)                    
skewness(duration)  
kurtosis(duration) 

我应该提到,偏斜和峰度几乎总是存在(只有在绝对完美的正态分布中才不会出现),它们被解释为更多是梯度的.较小的值大约是正常值,较大的值表示它来自其他分布,例如Weibull等.

I should mention that skewness and kurtosis are almost always present (only in an absolutely perfectly normal distribution would it not be) and they are interpreted as more of a gradient. Small values are approximately normal and larger values mean it's from some other distribution like Weibull, etc, etc.

因此,通常在获得p值的意义上,您无需对其进行测试",就像测量"并解释系数以查看其最接近地代表哪种分布一样.话虽如此,如果您想可以使用高尔顿的度量标准而不是皮尔逊的度量标准进行测试,然后测试从零开始的显着差异.但是我认为这并不是真的有帮助,因为几乎所有经验数据都会有一些明显的偏斜和峰度,因此,实际上只是多少一个问题(即足以使数据看起来更像其他分布,或者数据仍然最接近正态分布.

So, you normally don't "test" for it in the sense of getting a p-value, so much as you "measure" it and interpret the coefficients to see which distribution it most closely represents. Having said that, if you wanted to you could test for it by using Galton's measures instead of Pearson's, then testing for siginficant difference from zero. But I don't think that would be really helpful as almost all empirical data would have some significant skewness and kurtosis, thus it's really just a matter of how much (i.e. is it enough to make the data look more like another distribution or is the data still closest to the normal distribution).

如果您想使用高尔顿的方法,您可以找到一个预打包的实现,我相信moments提供了它,或者可以执行以下自定义功能:

In case you want to use Galton's measures you can either find a prepacked implementation, I believe moments provides it, or do a custom function like this:

galtonskew.proc <- function(x){
  #
  #  Compute Galton's skewness measure for x
  #  NOTE: this procedure assumes no x values are missing
  #
  quarts <- as.numeric(quantile(x, probs = c(0.25, 0.5, 0.75)))
  num <- quarts[1] + quarts[3] - 2*quarts[2]
  denom <- quarts[3] - quarts[1]
  gskew <- num/denom
  gskew
}

这篇关于假设检验R中的偏度和/或峰度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆