Walsh Averages

Share:

Description

Given a list of n numbers, the Walsh averages are the n(n+1)/2 pairwise averages.

Usage

1
walsh(x)

Arguments

x

A numeric vector

Value

The Walsh averages.

Author(s)

John Kloke kloke@biostat.wisc.edu

References

Hettmansperger, T.P. and McKean J.W. (2011), Robust Nonparametric Statistical Methods, 2nd ed., New York: Chapman-Hall.

Hollander, M. and Wolfe, D.A. (1999), Nonparametric Statistical Methods, New York: Wiley.

See Also

signedrank

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
median(walsh(rnorm(100)))  # Hodges-Lehmann estimate of location

## The function is currently defined as
function (x) 
{
    n <- length(x)
    w <- vector(n * (n + 1)/2, mode = "numeric")
    ind <- 0
    for (i in 1:n) {
        for (j in i:n) {
            ind <- ind + 1
            w[ind] <- 0.5 * (x[i] + x[j])
        }
    }
    return(w)
  }

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.