m_test_statistic {robnptests}R Documentation

Test statistics for the M-tests

Description

m_test_statistic calculates the test statistics for tests based on M-estimators.

Usage

m_test_statistic(x, y, psi, k = robustbase::.Mpsi.tuning.default(psi), ...)

Arguments

x

a (non-empty) numeric vector of data values.

y

a (non-empty) numeric vector of data values.

psi

kernel used for optimization. Must be one of "bisquare", "hampel" and "huber". The default is "huber".

k

tuning parameter(s) for the respective kernel function, defaults to parameters implemented in .Mpsi.tuning.default(psi) in the package robustbase.

...

additional arguments c1 and c2 that can be passed to the function scaleTau2(), which is used internally for estimating the within-sample dispersion, in order to account for non-normal distributions; see Maronna and Zamar (2002).

Details

For details on how the test statistic is constructed, we refer to the vignette vignette("m_tests")

Value

A named list containing the following components:

statistic

standardized test statistic.

estimates

M-estimates of location for both x and y.

Examples

# Generate random samples
set.seed(108)
x <- rnorm(20); y <- rnorm(20)

# Compute Huber-M-statistic
m_test_statistic(x, y, psi = "huber")


[Package robnptests version 1.1.0 Index]