hodges_lehmann_2sample: Two-sample Hodges-Lehmann estimator

View source: R/locationEstimators.R

hodges_lehmann_2sampleR Documentation

Two-sample Hodges-Lehmann estimator

Description

hodges_lehmann_2sample calculates the two-sample Hodges-Lehmann estimator for the location difference of two samples x and y.

Usage

hodges_lehmann_2sample(x, y, na.rm = FALSE)

Arguments

x

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

y

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

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 two-sample Hodges-Lehmann estimator for two samples x and y of sizes m and n is defined as

med(|x_i - y_j|, 1 ≤ i ≤ m, 1 ≤ j ≤ n).

Value

The two-sample Hodges-Lehmann estimator.

References

\insertRef

HodLeh63estirobnptests

Examples

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

# Compute two-sample Hodges-Lehmann estimator
hodges_lehmann_2sample(x, y)


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