data(api, package = 'survey')
dstrata <- apistrat %>%
as_survey_design(strata = stype, weights = pw)
dstrata %>%
summarize(sum_of_weights = sum(cur_svy_wts()),
kish_deff = var(cur_svy_wts())/(mean(cur_svy_wts())^2))
Run the code above in your browser using DataLab