Learn R Programming

litteR (version 1.0.0)

trimean: Tukey's Trimean

Description

Robust centrality measure estimated as the weighted average of the three quartiles: \((Q_1 + 2Q_2 + Q_3) / 4\), where \(Q_1, Q_2\) and \(Q_3\) are the first, second and third quartiles respectively.

Usage

trimean(x, ...)

# S3 method for default trimean(x, ...)

Value

trimean (numeric value of length 1).

Arguments

x

numeric vector

...

further arguments passed to or from other methods.

Methods (by class)

  • trimean(default): Tukey's trimean

References

https://en.wikipedia.org/wiki/Trimean

Examples

Run this code
stopifnot(trimean(0:100) == mean(0:100))
stopifnot(trimean(0:100) == median(0:100))

Run the code above in your browser using DataLab