symmetry.test {lawstat} | R Documentation |
Test of Symmetry
Description
Perform test for symmetry about an unknown median. Users can choose among the
Cabilio–Masaro test (Cabilio and Masaro 1996),
the Mira test (Mira 1999),
or the MGG test (Miao et al. 2006);
and between using asymptotic distribution of the respective statistics or
a distribution from m
-out-of-n
bootstrap
(Lyubchich et al. 2016).
Additionally to the general distribution asymmetry, the function allows to test
for negative or positive skeweness (see the argument side
).
NA
s from the data are omitted.
Usage
symmetry.test(
x,
option = c("MGG", "CM", "M"),
side = c("both", "left", "right"),
boot = TRUE,
B = 1000,
q = 8/9
)
Arguments
x |
data to be tested for symmetry. |
option |
test statistic to be applied. The options include statistic by Miao et al. (2006) (default), Cabilio and Masaro (1996), and Mira (1999). |
side |
choice from the three possible alternative hypotheses:
general distribution asymmetry ( |
boot |
logical value indicates whether |
B |
number of bootstrap replications to perform (default is 1000). |
q |
scalar from 0 to 1 to define a set of possible |
Details
If the bootstrap option is used (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
. Specifically, we use the Wasserstein metric
(Ruschendorf 2001) to calculate distances between different
bootstrap distributions and select m
, which corresponds to the minimal distance.
See Lyubchich et al. (2016) for more details.
Value
A list of class "htest"
with the following components:
method |
name of the method. |
data.name |
name of the data. |
statistic |
value of the test statistic. |
p.value |
|
alternative |
alternative hypothesis. |
estimate |
bootstrap optimal |
Author(s)
Joseph L. Gastwirth, Yulia R. Gel, Wallace Hui, Vyacheslav Lyubchich, Weiwen Miao, Xingyu Wang (in alphabetical order)
References
Bickel PJ, Gotze F, van Zwet WR (1997).
“Resampling fewer than n
observations: gains, losses, and remedies for losses.”
Statistica Sinica, 7, 1–31.
Bickel PJ, Sakov A (2008).
“On the choice of m
in the m
out of n
bootstrap and confidence bounds for extrema.”
Statistica Sinica, 18(3), 967–985.
Cabilio P, Masaro J (1996).
“A simple test of symmetry about an unknown median.”
Canadian Journal of Statistics, 24(3), 349–361.
doi:10.2307/3315744.
Lyubchich V, Wang X, Heyes A, Gel YR (2016).
“A distribution-free m
-out-of-n
bootstrap approach to testing symmetry about an unknown median.”
Computational Statistics & Data Analysis, 104, 1–9.
doi:10.1016/j.csda.2016.05.004.
Miao W, Gel YR, Gastwirth JL (2006).
“A new test of symmetry about an unknown median.”
In Hsiung A, Zhang C, Ying Z (eds.), Random Walk, Sequential Analysis and Related Topics – A Festschrift in Honor of Yuan-Shih Chow, 199–214.
World Scientific Publisher, Singapore.
doi:10.1142/9789812772558_0013.
Mira A (1999).
“Distribution-free test for symmetry based on Bonferroni's measure.”
Journal of Applied Statistics, 26(8), 959–972.
doi:10.1080/02664769921963.
Ruschendorf L (2001).
“Wasserstein metric.”
In Hazewinkel M (ed.), Encyclopaedia of Mathematics.
Springer, Berlin.
Examples
data(zuni) #run ?zuni to see the data description
symmetry.test(zuni[,"Revenue"], boot = FALSE)