basic_surv_prop_table: A workhourse function to construct survey crosstabs

Description Usage Arguments Value Examples

View source: R/prop_tables.R

Description

A workhourse function to construct survey crosstabs

Usage

1
basic_surv_prop_table(s, ..., binary = F)

Arguments

s

A tbl_svy object created using the srvyr package.

...

Names columns to be used in as grouping variables followed by the column to be used as the outcome variable

binary

A logical indicating whether the outcome variable is binary and hence only one column should be displayed

Value

A long format tibble. Each of the initial character columns is named for a grouping variable and list combination of grouping categories for that row The later numeric columns are named for the outcome categories and list the percentages falling into each. Rows should sum to 100, unless outcome is binary in which case only the column for "TRUE" is displayed to avoid redudancy.

Examples

1
2
data(ca_school_tbl_svy)
ca_school_tbl_svy %>% basic_surv_prop_table("sch.wide.imp.goal", "comparative.imp.goal", "school.level")

mattysimonson/exploratorium documentation built on Dec. 21, 2021, 3:49 p.m.