rob_perm_statistic {robnptests}R Documentation

Robust test statistics based on robust location estimators

Description

rob_perm_statistic calculates test statistics for robust permutation/randomization tests based on the sample median, the one-sample Hodges-Lehmann estimator, or the two-sample Hodges-Lehmann estimator.

Usage

rob_perm_statistic(
  x,
  y,
  type = c("HL11", "HL12", "HL21", "HL22", "MED1", "MED2"),
  na.rm = FALSE
)

Arguments

x

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

y

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

type

a character string specifying the desired test statistic. It must be one of "HL11" (default), "HL12", "HL21", "HL22", "MED1", and "MED2", where "HL1", "HL2" and "MED" specify the location estimator and the numbers 1 and 2 the scale estimator, see the vignette vignette("robnptests") for more information.

na.rm

a logical value indicating whether NA values in x and y should be stripped before the computation proceeds. The default is na.rm = FALSE.

Details

The test statistics returned by rob_perm_statistic are of the form

D_i/S_j

where the D_i, i = 1,...,3, are different estimators of location and the S_j, j = 1,...,4, are estimates for the mutual sample scale. See Fried and Dehling (2011) or the vignette vignette("robnptests") for details.

Value

A named list containing the following components:

statistic

the selected test statistic.

estimates

estimate of location for each sample if available.

References

Fried R, Dehling H (2011). “Robust nonparametric tests for the two-sample location problem.” Statistical Methods & Applications, 20(4), 409–422. doi:10.1007/s10260-011-0164-1.

Examples

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

# Compute HL21-statistic
rob_perm_statistic(x, y, type = "HL21")


[Package robnptests version 1.1.0 Index]