
Summarise the percentages of people with certain levels of a variable
prop_summary.RdUses the 'survey' package to estimate the percentages with uncertainty that accounts for survey sampling error and survey design.
Arguments
- data
Data table of individual characteristics.
- var_name
Character - the name of the variable to be summarised.
- levels_1
Character vector - the levels that should be assigned 1 in the binary variable
- levels_0
Character vector - the levels that should be assigned 0 in the binary variable
- strat_vars
Character vector - the variables by which to stratify the estimates