m_test_statistic: Test statistics for the M-tests

View source: R/testStatistics.R

m_test_statisticR 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 \insertCiteMarZam02robu;textualrobnptests.

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")


robnptests documentation built on Feb. 16, 2023, 7:10 p.m.