The Hajek mean \(\sum w y / \sum w\) and the Taylor-linearisation SE under the design
(strata, clusters, finite-population correction), as survey::svymean computes them. A
missing value in the variable gives NA, as there.
Arguments
- design
A design from
morie_survey_design(). Asurvey::svydesignobject is accepted too and read into the same native form (one-stage designs).- variable
Character; column name of the outcome variable in the
designobject (morie_survey_mean).
Examples
set.seed(1)
df <- data.frame(y = rnorm(40), w = runif(40, 0.5, 2))
d <- morie_survey_design(df, "w")
str(morie_survey_mean(d, "y"), max.level = 1)
#> List of 2
#> $ mean: num 0.0735
#> $ se : num 0.168
