HodgesLehmann: Hodges-Lehmann Estimator of Location

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/StatsAndCIs.r

Description

Function to compute the Hodges-Lehmann estimator of location in the one sample case.
Simple wrapper to extract the value from the result of wilcox.test.

Usage

1
HodgesLehmann(x, y = NULL, conf.level = NA, na.rm = FALSE)

Arguments

x

a numeric vector.

y

an optional numeric vector of data values: as with x non-finite values will be omitted.

conf.level

confidence level of.

na.rm

logical. Should missing values be removed? Defaults to FALSE.

Details

The Hodges-Lehmann estimator is the median of the combined data points and Walsh averages. It is the same as the Pseudo Median returned as a by-product of the function wilcox.test.
Note that in the two-sample case the estimator for the difference in location parameters does not estimate the difference in medians (a common misconception) but rather the median of the difference between a sample from x and a sample from y. The confidence interval for the "pseudo median" is extracted from wilcox.test (conf.int = TRUE).

Value

the Hodges-Lehmann estimator of location as a single numeric value if no confidence intervals are requested,
and otherwise a numeric vector with 3 elements for the estimate, the lower and the upper confidence interval

Author(s)

Andri Signorell <[email protected]>

References

Hodges, J.L., and Lehmann, E.L. (1963), Estimates of location based on rank tests. The Annals of Mathematical Statistics, 34, 598–611.

See Also

wilcox.test, median, MedianCI

Examples

1
2
3
4
5
6
set.seed(1)
x <- rt(100, df = 3)
HodgesLehmann(x)

# same as
wilcox.test(x,  conf.int = TRUE)$estimate

DescTools documentation built on Sept. 13, 2017, 9:04 a.m.