weightedMean | R Documentation |
Computes the weighted estimator for the mean of a column
weightedMean(var, weights, popTot = NULL)
var |
column of variable of interest |
weights |
column of weights matching the variable of interest |
popTot |
population size, used in Horvitz-Thompson-like estimation. If no value is given for popTot, default value is the sum of weights. In the context of survey sampling, this is equivalent to using an Hajek estimate. |
Estimated mean
HTmean
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.