weighted_mean {robsurvey} | R Documentation |
Weighted Total and Mean (Horvitz-Thompson and Hajek Estimators)
Description
Weighted total and mean (Horvitz-Thompson and Hajek estimators)
Usage
weighted_mean(x, w, na.rm = FALSE)
weighted_total(x, w, na.rm = FALSE)
Arguments
x |
|
w |
|
na.rm |
|
Details
weighted_total
and weighted_mean
compute, respectively,
the Horvitz-Thompson estimator of the population total and the Hajek
estimator of the population mean.
Value
Estimated population mean or total
See Also
Overview (of all implemented functions)
Examples
head(workplace)
# Horvitz-Thompson estimator of the total
weighted_total(workplace$employment, workplace$weight)
# Hajek estimator of the mean
weighted_mean(workplace$employment, workplace$weight)
[Package robsurvey version 0.6 Index]