Learn R Programming

lmomco (version 1.7.3)

sen.mean: Sen's Weighted Mean Statistic

Description

The Sen weighted mean statistic $\mathcal{S}_{n,k}$ is a robust estimator of the mean of a distribution.

$$\mathcal{S}_{n,k} = {n \choose 2k+1}^{-1} \sum_{i=1}^n {i - 1 \choose k} {n - i \choose k } X_{i:n}$$

where $X_{i:n}$ are the order statistics and $k$ is a weighting or trimming parameter.

Note that $\mathcal{S}_{n,0} = \mu = \overline{X}_n$ or the arithmetic mean and $\mathcal{S}_{n,k}$ is the sample median if either $n$ is even and $k = (n/2) - 1$ or $n$ is odd and $k = (n-1)/2$.

Usage

sen.mean(x,k=0)

Arguments

x
A vector of data values that will be reduced to non-missing values.
k
A weighting or trimming parameter $0 < k < (n-1)/2$.

Value

  • An R list is returned.
  • senThe sen mean $\mathcal{S}_{n,k}$
  • sourceAn attribute identifying the computational source of Sen's Weighted Mean: sen.mean.

encoding

UTF-8

References

Jurečková{Jureckova}, J., and Picek, J., 2006, Robust statistical methods with R: Boca Raton, Fla., Chapman and Hall/CRC, ISBN 1--58488--454--1, 197~p.

Sen, P.K., 1964, On some properties of the rank-weighted means: Journal Indian Society of Agricultural Statistics: vol.~16, pp.~51--61.

See Also

TLmoms, gini.mean.diff

Examples

Run this code
fake.dat <- c(123,34,4,654,37,78)
sen.mean(fake.dat); mean(fake.dat) # These should be the same values

sen.mean(fake.dat, k=(length(fake.dat)/2) - 1); median(fake.dat)
# Again, same values

# Finally, the sen.mean() is like a symmetrically trimmed TL-moment
# Let us demonstrate by computed a two sample trimming for each side
# for a Normal distribution having a mean of 100.
fake.dat <- rnorm(20, mean=100)
lmr <- TLmoms(fake.dat, trim=2)
sen <- sen.mean(fake.dat, k=2)

print(abs(lmr$lambdas[1] - sen$sen)) # zero is returned

Run the code above in your browser using DataLab