HodgesLehmann - Maple Help

Statistics

 HodgesLehmann
 compute Hodges and Lehmann's location estimator

 Calling Sequence HodgesLehmann(A, ds_options) HodgesLehmann(X, rv_options)

Parameters

 A - X - algebraic; random variable or distribution ds_options - (optional) equation(s) of the form option=value where option is one of correction, ignore, or weights; specify options for computing Hodges and Lehmann's location statistic of a data set rv_options - (optional) equation of the form numeric=value; specifies options for computing Hodges and Lehmann's location statistic of a random variable

Description

 • The HodgesLehmann function computes a robust measure of the location of the specified data set or random variable, as introduced by Hodges and Lehmann in [2] and independently by Sen in [3]. This statistic is variously called the Hodges-Lehmann-Sen estimator, the Hodges-Lehmann estimator, the Hodges-Lehmann-Sen statistic, or the Hodges-Lehmann statistic.
 • The Hodges-Lehmann statistic, referred to as $\mathrm{HLE}$ in the remainder of this help page, is defined for a data set ${A}_{1},{A}_{2},\mathrm{...},{A}_{n}$ as:

$\mathrm{HLE}=\frac{\mathrm{Median}\left(\left[\mathrm{seq}\left(\mathrm{seq}\left({A}_{i}+{A}_{j},i=1..n\right),j=1..n\right)\right]\right)}{2}$

 • The Hodges-Lehmann statistic is a reasonably robust statistic: it has a fairly high breakdown point (the proportion of arbitrarily large observations it can handle before giving an arbitrarily large result). The breakdown point of $\mathrm{HLE}$ is $1-\frac{\sqrt{2}}{2}$ or about $0.29$.
 • The Hodges-Lehmann statistic is a measure of location: if $\mathrm{HodgesLehmann}\left(X\right)=a$, then for all real constants $\mathrm{\alpha }$ and $\mathrm{\beta }$, we have $\mathrm{HodgesLehmann}\left(\mathrm{\alpha }X+\mathrm{\beta }\right)=\mathrm{\alpha }a+\mathrm{\beta }$.
 • The first parameter can be a data set, a distribution (see Statistics[Distribution]), a random variable, or an algebraic expression involving random variables (see Statistics[RandomVariable]). For a data set $A$, HodgesLehmann computes the Hodges-Lehmann statistic as defined above. For a distribution or random variable $X$, HodgesLehmann computes the asymptotic equivalent - the value that the Hodges-Lehmann statistic converges to for ever larger samples of $X$.

Computation

 • By default, all computations involving random variables are performed symbolically (see option numeric below).
 • All computations involving data are performed in floating-point; therefore, all data provided must have type/realcons and all returned solutions are floating-point, even if the problem is specified with exact values.

Data Set Options

 • The ds_options argument can contain one or more of the options shown below. More information for some options is available in the Statistics[DescriptiveStatistics] help page.
 • ignore=truefalse -- This option controls how missing data is handled by the HodgesLehmann command. Missing items are represented by undefined or Float(undefined). So, if ignore=false and A contains missing data, the HodgesLehmann command may return undefined. If ignore=true all missing items in A will be ignored. The default value is false.
 • weights=Vector -- Data weights. The number of elements in the weights array must be equal to the number of elements in the original data sample. By default all elements in A are assigned weight $1$.

Random Variable Options

 The rv_options argument can contain one or more of the options shown below. More information for some options is available in the Statistics[RandomVariables] help page.
 • numeric=truefalse -- By default, the Hodges-Lehmann statistic is computed using exact arithmetic. To compute the Hodges-Lehmann statistic numerically, specify the numeric or numeric = true option.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$

Compute the Hodges-Lehmann statistic for a data sample.

 > $s≔⟨1,5,2,2,7,4,1,6⟩$
 ${s}{≔}\left[\begin{array}{c}{1}\\ {5}\\ {2}\\ {2}\\ {7}\\ {4}\\ {1}\\ {6}\end{array}\right]$ (1)
 > $\mathrm{HodgesLehmann}\left(s\right)$
 ${3.50000000000000}$ (2)

Let's replace two of the values with very large values.

 > $t≔\mathrm{copy}\left(s\right):$
 > $t\left[1..2\right]≔{10}^{100}:$
 > $t$
 $\left[\begin{array}{c}{10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}\\ {10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}\\ {2}\\ {2}\\ {7}\\ {4}\\ {1}\\ {6}\end{array}\right]$ (3)
 > $\mathrm{HodgesLehmann}\left(t\right)$
 ${5.75000000000000}$ (4)

The Hodges-Lehmann statistic stays bounded, because it has a high breakdown point.

Compute the Hodges-Lehmann statistic for an exponential distribution.

 > $\mathrm{HodgesLehmann}\left('\mathrm{Exponential}'\left(1\right),'\mathrm{numeric}'\right)$
 ${0.839173495008330}$ (5)

The symbolic result below evaluates to the same floating point number if the parameter is 1.

 > $\mathrm{HodgesLehmann}\left('\mathrm{Exponential}'\left(b\right)\right)$
 ${-}\frac{\left({\mathrm{LambertW}}{}\left({-1}{,}{-}\frac{{{ⅇ}}^{{-1}}}{{2}}\right){+}{1}\right){}{b}}{{2}}$ (6)
 > $\mathrm{evalf}\left(\mathrm{eval}\left(,b=1\right)\right)$
 ${0.8391734950}$ (7)

Generate a random sample of size 1000000 from the same distribution and compute the sample's Hodges-Lehmann statistic.

 > $A≔\mathrm{Sample}\left('\mathrm{Exponential}'\left(1\right),1000000\right):$
 > $\mathrm{HodgesLehmann}\left(A\right)$
 ${0.840288350205042}$ (8)

Consider the following Matrix data set.

 > $M≔\mathrm{Matrix}\left(\left[\left[3,1130,114694\right],\left[4,1527,127368\right],\left[3,907,88464\right],\left[2,878,96484\right],\left[4,995,128007\right]\right]\right)$
 ${M}{≔}\left[\begin{array}{ccc}{3}& {1130}& {114694}\\ {4}& {1527}& {127368}\\ {3}& {907}& {88464}\\ {2}& {878}& {96484}\\ {4}& {995}& {128007}\end{array}\right]$ (9)

We compute the Hodges-Lehmann statistic for each of the columns.

 > $\mathrm{HodgesLehmann}\left(M\right)$
 $\left[\begin{array}{ccc}{3.}& {1018.50000000000}& {111926.}\end{array}\right]$ (10)

References

 [1] Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.
 [2] Hodges, Joseph L.; Lehmann, Erich L. Estimation of location based on ranks. Annals of Mathematical Statistics 34 (2), 1963, pp.598-611.
 [3] Sen, Pranab K. On the estimation of relative potency in dilution(-direct) assays by distribution-free methods. Biometrics 19(4), 1963, pp.532-552.

Compatibility

 • The Statistics[HodgesLehmann] command was introduced in Maple 18.