Learn R Programming

mrfDepth (version 1.0.17)

symtest: Test for angular symmetry around a specified center for bivariate data

Description

A test based on halfspace depth for angular symmetry of the bivariate data set x around the point z. The test is only valid when x contains no duplicates.

Usage

symtest(x, z, options=list())

Value

pval

The \(p\)-value of the hypothesis test.

Arguments

x

An \(n\) by 2 data matrix.

z

A vector of length \(2\).

options

A list of options to pass to hdepth.
See hdepth for more information.

Author

P. Segaert

Details

The following hypothesis test is performed:
\(H_0\): The data come from a continuous distribution \(P\) which is angularly symmetric about z.
The test statistic being used is the halfspace depth of z with respect to x. Under the null hypothesis the halfspace depth of z equals \(1/2\). The distribution of the teststatistic under \(H_0\) is \(F_n(k) = P(hdepth(P, z) \le k)\). The \(p\)-value of the test is \(F_n(k)\) with \(k= hdepth(\code{x},z)\).

References

Rousseeuw P.J, Struyf A. (2002). A depth test for symmetry. In: Goodness-of-Fit Tests and Model Validity, Birkhäuser Boston, pages 401--412.

Examples

Run this code
# Perform the test on a simple data example.
data(cardata90)
deepest <- hdepthmedian(cardata90)$median
symtest(x = cardata90[!duplicated(cardata90), ], z = deepest)
plot(cardata90)
points(deepest[1], deepest[2], pch=18, col="red", cex=1.2)

Run the code above in your browser using DataLab