weighted.median {limma}R Documentation

Weighted Median

Description

Compute a weighted median of a numeric vector.

Usage

weighted.median(x, w, na.rm = FALSE)

Arguments

x a numeric vector containing the values whose mean is to be computed.
w a vector of weights the same length as x giving the weights to use for each element of x.
na.rm a logical value indicating whether NA values in x should be stripped before the computation proceeds.

Details

If w is missing then all elements of x are given the same weight.

Missing values in w are not handled.

The weighted median is the median of the discrete distribution with values given by x and probabilities given by w/sum(w).

Value

numeric value giving the weighted median

See Also

median, weighted.mean


[Package limma version 2.4.7 Index]