wgtmeantotal: Weighted total and mean (Horvitz-Thompson and Hajek...

Description Usage Arguments Details Value Note Examples

Description

Weighted total and mean (Horvitz-Thompson and Hajek estimators)

Usage

1
2
3
weighted_total(x, w, na.rm = FALSE)

weighted_mean(x, w, na.rm = FALSE)

Arguments

x

a numeric vector

w

a numeric vector of weights

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Details

-

Value

Estimate (scalar)

Note

wgtmeantotal is a generic name for the functions documented.

Examples

1
2
3
4
x <- c(0.1, 0.35, 0.05, 0.1, 0.15, 0.05, 0.2)
weighted_total(x, x)
x <- c(0.1, 0.35, 0.05, 0.1, 0.15, 0.05, 0.2)
weighted_mean(x, x)

martinSter/robsurvey documentation built on Oct. 11, 2019, 4:45 p.m.