Search code examples
rhypothesis-test

Testing the null hypothesis of zero skew


I need to test the null hypothesis that my steady returns have a zero skewness with a confidence level of 95%. Do you have any ideas which formula I can take for this kind of test ? I tried the Agostino test for skewness, but think it's not the best way, because I can't set a confidence level.

library(moments)
?agostino.test

Solution

  • If I understand your question correctly, all you have to do is compare the p-value from agostino.test() (which can be extracted from the returned object) with a specified alpha, i.e.

    library(moments)
    set.seed(1234)
    x <- rnorm(1000)
    a <- agostino.test(x)
    a$p.value < 0.05  ## FALSE, fail to reject
    

    (In case it's not clear, the 0.05 here is 1-(your confidence level)=1-0.95.) Or to simulate a case where the null hypothesis is false:

    y <- rexp(1000,1)
    agostino.test(y)$p.value < 0.05 ## TRUE, reject