> On Fri, Aug 26, 2011 at 10:20 AM, Benjamin Polidore <polid...@gmail.com> 
> wrote:
>> I have two distributions.  Is there a statistical approach to determine
>> if the skew of distribution 1 is similar to the skew of distribution 2?

On Aug 26, 2011, at 10:07 PM, Joshua Wiley wrote:

> par(mfrow = c(2, 1))
> plot(density(rnorm(100)^2))
> plot(density(rnorm(100)^2))



The density graph will show what your density looks like.

If you need an empirical test of their similarity, Jorge Ivan Velez kindly 
wrote this in response to my similar question a month ago...

# kurtosis
kurd <- function(x, y, B = 1000){
        kx <- replicate(B, kurtosi(sample(x, replace = TRUE)))
        ky <- replicate(B, kurtosi(sample(y, replace = TRUE)))
        kx - ky 
}


# skew
skewd <- function(x, y, B = 1000){
        sx <- replicate(B, skew(sample(x, replace = TRUE)))
        sy <- replicate(B, skew(sample(y, replace = TRUE)))
        sx - sy 
}


# -----------
#   example
# -----------

# data
x <- rnorm(100, 25, 4)
y <- rexp(50, 1/25)

# kurtosis distribution
require(psych)
res1 <- kurd(x, y, B = 10000)
mean(res1 > 0)
hist(res1, breaks = 50)

# skew distribution
res2 <- skewd(x, y, B = 10000)
mean(res2 > 0)
hist(res2, breaks = 50)


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to