truemedian: Calculate true median for data with ties.

View source: R/fmsb.R

truemedianR Documentation

Calculate true median for data with ties.

Description

Usually median for data with ties, tied values are treated as exactly same. For example, median of {3, 3, 4, 4, 4} will be 4. However, the measured values are usually rounded, so that we can assume evenly distributed true values for tied values. For example, the previous data can be treated as rounded values of {2.75, 3.25, 11/3, 4, 13/3}. From this viewpoint, true median of {3, 3, 4, 4, 4} could be 11/3 (=3.66...). This function calculates this.

Usage

 truemedian(X, h) 

Arguments

X

A numeric vector. Usually integer.

h

Width of measurement unit. Default is 1.

Value

A numeric vector of length 1, giving "true" median estimate.

Author(s)

Minato Nakazawa minatonakazawa@gmail.com https://minato.sip21c.org/

References

Grimm LG (1993) Statistical Applications for the Behavioral Sciences. John Wiley and Sons.

Examples

 median(c(3, 3, 4, 4, 4))
 truemedian(c(3, 3, 4, 4, 4))

fmsb documentation built on May 29, 2024, 2:02 a.m.

Related to truemedian in fmsb...