Calculates weighted means with 95% confidence intervals for a continuous variable, optionally stratified by a grouping variable.
svymn(formula, design, by = NULL, na.rm = TRUE)A formula (e.g., ~age).
A survey design object (from setup_survey_design()).
Optional formula for stratification (e.g., ~sex).
Logical; if TRUE (default), omit NA values.
A data frame with columns:
estimate: estimated mean
lower: 95% CI lower bound
upper: 95% CI upper bound
se: standard error
If by is specified: grouping column(s) prepended