Set up survey data

Functions for specifying a survey’s structure

as_survey()

Create a tbl_svy from a data.frame

as_survey_design()

Create a tbl_svy survey object using sampling design

as_survey_rep()

Create a tbl_svy survey object using replicate weights

as_survey_twophase()

Create a tbl_svy survey object using two phase design

Calculate summary statistics of survey data

Functions for calculating summary measures taking into account complex survey design

cascade()

Summarise multiple values into cascading groups

group_by

Group a (survey) dataset by one or more variables.

interact()

Create interaction terms to group by when summarizing

summarise

Summarise multiple values to a single value.

summarise_all

Manipulate multiple columns.

survey_mean() survey_prop()

Calculate mean/proportion and its variation using survey methods

survey_total()

Calculate the total and its variation using survey methods

survey_quantile() survey_median()

Calculate the quantile and its variation using survey methods

survey_ratio()

Calculate the ratio and its variation using survey methods

survey_tally() survey_count()

Count/tally survey weighted observations by group

survey_var() survey_sd()

Calculate the population variance and its variation using survey methods

unweighted()

Calculate the an unweighted summary statistic from a survey

svychisq

Chisquared tests of association for survey data.

cur_svy_wts()

Get the full-sample weights for the current context

survey_old_quantile() survey_old_median()

Calculate the quantile and its variation using survey methods

Other supported dplyr functions

Other functions from dplyr that work on srvyr’s survey objects

as_tibble

Coerce survey variables to a data frame (tibble)

group_trim

Single table verbs from dplyr and tidyr

groups

Get/set the grouping variables for tbl.

tbl_vars

List variables produced by a tbl.

group_map_dfr() group_map(<tbl_svy>) group_map_dfr()

Apply a function to each group

dplyr_filter_joins

Filtering joins from dplyr

collect

Force computation of a database query

(Primarily for package authors) Extend srvyr

Functions useful for package authors to extend srvyr

cur_svy() cur_svy_full() current_svy()

Get the survey data for the current context

get_var_est()

Get the variance estimates for a survey estimate

set_survey_vars()

Set the variables for the current survey variable

uninteract() is.interaction()

Break interaction vectors back into component columns

srvyr_interaction

srvyr interaction column