Learn R Programming

robnptests (version 1.1.0)

hodges_lehmann: One-sample Hodges-Lehmann estimator

Description

hodges_lehmann calculates the one-sample Hodges-Lehmann estimator of a sample.

Usage

hodges_lehmann(x, na.rm = FALSE)

Value

The one-sample Hodges-Lehmann estimator.

Arguments

x

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 one-sample Hodges-Lehmann estimator for a sample of size n is defined as

$$med(\frac{X_i + X_j}{2}, 1 \le i < j \le m).$$

References

HodLeh63estirobnptests

Examples

Run this code
# Generate random sample
set.seed(108)
x <- rnorm(10)

# Compute one-sample Hodges-Lehmann estimator
hodges_lehmann(x)

Run the code above in your browser using DataLab