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 mm-out-of-nn 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). NAs 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 (side = "both", default), left skewness (side = "left"), or right skewness (side = "right").

boot

logical value indicates whether mm-out-of-nn bootstrap will be used to obtain critical values (default), or asymptotic distribution of the chosen statistic.

B

number of bootstrap replications to perform (default is 1000).

q

scalar from 0 to 1 to define a set of possible mm for the mm-out-of-nn bootstrap. Default q = 8/9. Possible mm are then set as the values unique(round(n*(q^j)) greater than 4, where n = length(x) and j = c(0:20).

Details

If the bootstrap option is used (boot = TRUE), a bootstrap distribution is obtained for each candidate subsample size mm. Then, a heuristic method (Bickel et al. 1997; Bickel and Sakov 2008) is used for the choice of optimal mm. Specifically, we use the Wasserstein metric (Ruschendorf 2001) to calculate distances between different bootstrap distributions and select mm, 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

pp-value of the test.

alternative

alternative hypothesis.

estimate

bootstrap optimal mm (given in the output only if bootstrap was used, i.e., boot = TRUE).

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 nn observations: gains, losses, and remedies for losses.” Statistica Sinica, 7, 1–31.

Bickel PJ, Sakov A (2008). “On the choice of mm in the mm out of nn 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 mm-out-of-nn 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)


[Package lawstat version 3.6 Index]