symmetry.test: Test of Symmetry

Description Usage Arguments Details Value Author(s) References Examples

View source: R/symmetry.test.R

Description

Perform test for symmetry about an unknown median. Users can choose among the Cabilio–Masaro test \insertCiteCabilio_Masaro_1996lawstat, the Mira test \insertCiteMira_1999lawstat, or the MGG test \insertCiteMiao_etal_2006lawstat; and between using asymptotic distribution of the respective statistics or a distribution from m-out-of-n bootstrap \insertCiteLyubchich_etal_2016_symmetrylawstat. 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

1
2
3
4
5
6
7
8
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 \insertCiteMiao_etal_2006;textuallawstat (default), \insertCiteCabilio_Masaro_1996;textuallawstat, and \insertCiteMira_1999;textuallawstat.

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 m-out-of-n 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 m for the m-out-of-n bootstrap. Default q = 8/9. Possible m 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 m. Then, a heuristic method \insertCiteBickel_etal_1997,Bickel_Sakov_2008lawstat is used for the choice of optimal m. Specifically, we use the Wasserstein metric \insertCiteRuschendorf_2001lawstat to calculate distances between different bootstrap distributions and select m, which corresponds to the minimal distance. See \insertCiteLyubchich_etal_2016_symmetry;textuallawstat 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

p-value of the test.

alternative

alternative hypothesis.

estimate

bootstrap optimal m (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

\insertAllCited

Examples

1
2
data(zuni) #run ?zuni to see the data description
symmetry.test(zuni[,"Revenue"], boot = FALSE)

gel-research-group/lawstat documentation built on Dec. 20, 2021, 9:50 a.m.