prop_summary.Rd
Uses the 'survey' package to estimate the percentages with uncertainty that accounts for survey sampling error and survey design.
prop_summary(data, var_name, levels_1, levels_0, strat_vars = NULL)
Data table of individual characteristics.
Character - the name of the variable to be summarised.
Character vector - the levels that should be assigned 1 in the binary variable
Character vector - the levels that should be assigned 0 in the binary variable
Character vector - the variables by which to stratify the estimates
Returns the estimate and standard error.