# NOT RUN {
wtd_sd(rnorm(n = 100, mean = 3),
runif(n = 100))
data(efc)
wtd_sd(efc[, 1:3], runif(n = nrow(efc)))
wtd_se(efc[, 1:3], runif(n = nrow(efc)))
# median for variables from weighted survey designs
library(survey)
data(nhanes_sample)
des <- svydesign(
id = ~SDMVPSU,
strat = ~SDMVSTRA,
weights = ~WTINT2YR,
nest = TRUE,
data = nhanes_sample
)
svy_md(total, des)
svy_md("total", des)
# }
Run the code above in your browser using DataLab