| set_survey | R Documentation |
You must specify a survey before the other functions, such as tab(),
will work. To convert a data.frame or similar to a survey object, see survey::svydesign()
or survey::svrepdesign().
set_survey(design, aa_vr = NULL, aa_pop = NULL, ...)
design |
a survey object, created with |
aa_vr |
used to produce age-adjusted estimates only. The name of a
categorical age variable located in |
aa_pop |
used to produce age-adjusted estimates only. A |
... |
arguments to |
Optionally, the survey can have an attribute called label, which is the
long name of the survey. Optionally, each variable in the survey can have an
attribute called label, which is the variable's long name.
For age-adjustment, aa_pop$Population can contain either population counts
or proportions/weights for each level. Values are normalized internally, so
counts and proportions produce the same age-adjusted estimates when they
describe the same standard population distribution.
info about the survey
Other options:
set_opts(),
show_options(),
surveytable-options
set_survey(namcs2019sv)
set_survey(namcs2019sv, mode = "NCHS")
## Age-adjusted estimation
set_survey(nhis2024a, aa_vr = "age_group_std", aa_pop = uspop_example$age_group_std)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.