Hodges-Lehmann Estimate (One-Sample)
Introduction
The Hodges-Lehmann Estimate (Hodges & Lehmann, 1963) for a one-sample scenario, is the median of the Walsh averages. The Walsh averages (Walsh, 1949a, 1949b) are the average of each possible pair by taking one score and combining it with each of the other scores. Note that each is only counted once, so taking the second and fifth score is the same as taking the fifth and the second, so only one of these is used. It does also include self-pairs, e.g. the third score and third score.
It is in the one-sample case therefor a measure of central tendancy and sometimes referred to as the pseudo median.
A separate page is available for the independent-samples version of the Hodges-Lehmann Estimate
Obtaining the Measure
(click below on program of interest to expand)
with Excel
Excel file: ME - Hodges-Lehmann Estimate (One-Sample) (E).xlsm
with stikpetE add-in
without stikpetE add-in
with Python
Jupyter Notebook: ME - Hodges-Lehmann Estimate (One-Sample) (P).ipynb
with stikpetP library
without stikpetP library
with R (Studio)
Jupyter Notebook: ES - Common Language (One-Sample) (R).ipynb
with stikpetR library
without stikpetR library
with SPSS (not possible?)
Unfortunately, I'm not aware on how to do this with SPSS using the GUI.
with Formulas
The formula for the Hodges-Lehmann estimator for one-sample (Hodges & Lehmann, 1963, p. 599):
\(HL = \text{median}\left(\frac{x_i + y_j}{2} | 1 \leq i \leq j, i \leq j \leq n\right)\)
Symbols used:
- \(x_i\), the i-th score
- \(x_j\), the j-th score
- \(n\), the number of scores
There might be a faster method to actually determine this. Algorithm 616 (Monahan, 1984), but couldn't translate the Fortran code to R or Python.
Worked out Example
Lets say we have the scores 1, 3, 7, 8
We then need to determine the Walsh averages for each possible pair:
\(\frac{x_i + x_j}{2}\) | \(x_j\) | |||
---|---|---|---|---|
\(x_i\) | 1 | 3 | 7 | 8 |
1 | (1 + 1)/2 = 1 | (1 + 3)/2 = 2 | (1 + 7)/2 = 4 | (1 + 8)/2 = 4.5 |
3 | (3 + 1)/2 = 2 | (3 + 3)/2 = 3 | (3 + 7)/2 = 5 | |
7 | (7 + 1)/2 = 4 | (7 + 3)/2 = 5 | ||
8 | (8 + 1)/2 = 4.5 |
The list of all differences between every possible pair is then:
\(1,2,4,4.5,2,3,5,4,5,4.5\)
We can sort this list to get:
\(1,2,2,3,4,4,4.5,4.5,5,5\)
Next we need to determine the median of all these differences. There are 10 Walsh averages in total ( \(\frac{4\times\left(4+1\right)}{2}\) ), so the median will be the \(\frac{10+1}{2} = 5.5\)-th score.
The 5th score is 4 and also the 5th, so the 5.5 will also be 4 (otherwise we would have averaged the two).
The Hodges-Lehmann is therefore 4.
Google adds