Skip to contents

Survey-weighted mean (delegates to survey::svymean when available).

Usage

morie_survey_mean(design, variable)

Arguments

design

A survey::svydesign object (when interfacing with the survey package directly).

variable

Character; column name of the outcome variable in the design object (morie_survey_mean).

Value

A named list (see Details).

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