Description Usage Arguments Details Value See Also Examples
Compute the median of x
weighted by weights
.
1 | wtd_median(x, weights = NULL)
|
x |
a numerical vector. |
weights |
a numerical vector of weights the same length as |
If weights
is NULL
, all elements of x
receive the
same weight. Observations with zero weights are omitted from the
computation. Missing values are not handled specially and
produce a missing value as the result.
The weighted median of x
.
Other weighted statistics:
wtd_mean()
,
wtd_quantile()
1 | wtd_median(1:5, weights = 5:1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.