Description Usage Arguments Value Examples
Uses the 'survey' package to estimate the percentages with uncertainty that accounts for survey sampling error and survey design.
1 | prop_summary(data, var_name, levels_1, levels_0, strat_vars = NULL)
|
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 |
Returns the estimate and standard error.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
prop_smokers <- prop_summary(
data = data,
var_name = "cig_smoker_status",
levels_1 = "current",
levels_0 = c("former", "never"),
strat_vars = c("sex", "imd_quintile")
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.