side
). NAs from the data are omitted.symmetry.test(x, option=c("MGG", "CM", "M"), side=c("both", "left", "right"), boot=TRUE, B=1000, q=8/9)
side="both"
, default), left skewness (side="left"
), or right skewness (side="right"
).q=8/9
. Possible $m$ are then set as the values unique(round(n*(q^j))
greater than 4, where n=length(x)
, j = seq(from=0, to=20, by=1)
.boot=TRUE
).boot=TRUE
), a bootstrap distribution is obtained for each candidate subsample size $m$. Then, a heuristic method (Bickel et al., 1997; Bickel and Sakov, 2008) is used for the choice of optimal $m$. Particularly, we use Wasserstein metric (Ruschendorf, 2001) to calculate distances between different bootstrap distributions and select $m$, which corresponds to the minimal distance.Bickel, P. J. and Sakov, A. (2008) On the choice of m in the m out of n bootstrap and its application to confdence bounds for extreme percentiles. Statistica Sinica, 18, 967-985.
Cabilio, P. and Masaro, J. (1996) A simple test of symmetry about an unknown median. The Canadian Journal of Statistics, 24, 349-361.
Miao, W., Gel, Y. R., and Gastwirth, J. L. (2006) A New Test of Symmetry about an Unknown Median. Random Walk, Sequential Analysis and Related Topics - A Festschrift in Honor of Yuan-Shih Chow. Eds.: Agnes Hsiung, Cun-Hui Zhang, and Zhiliang Ying, World Scientific Publisher, Singapore.
Mira, A. (1999) Distribution-free test for symmetry based on Bonferroni's measure. Journal of Applied Statistics, 26, 959-972.
Ruschendorf, L. (2001) Wasserstein metric. In Encyclopedia of Mathematics (ed. M. Hazewinkel). Berlin: Springer.
data(zuni)
symmetry.test(zuni[,"Revenue"], boot=FALSE)
## Symmetry test by Miao, Gel, and Gastwirth (2006)
##
## data: zuni[, "Revenue"]
## Test statistic = 5.0321, p-value = 4.851e-07
## alternative hypothesis: the distribution is asymmetric.
Run the code above in your browser using DataLab