weightedMean | R Documentation |
Compute the weighted mean.
weightedMean(x, weights = NULL, na.rm = FALSE)
x |
a numeric vector. |
weights |
an optional numeric vector giving the sample weights. |
na.rm |
a logical indicating whether missing values in |
This is a simple wrapper function calling weighted.mean
if sample weights are supplied and mean
otherwise.
The weighted mean of values in x
is returned.
Andreas Alfons
incMean
data(eusilc)
weightedMean(eusilc$eqIncome, eusilc$rb050)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.