Learn R Programming

srvyr (version 1.3.0)

cur_svy_wts: Get the full-sample weights for the current context

Description

This is a helper to allow srvyr's syntactic style. This function allows quick access to the full-sample weights for the current group, using cur_svy_wts(), See vignette("extending-srvyr") for more details.

Usage

cur_svy_wts()

Arguments

Value

a numeric vector containing full-sample weights

Examples

Run this code

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