View source: R/svyciprop_adjusted.R
| svyciprop_adjusted | R Documentation |
A version of survey::svyciprop( method = "beta" ) that adjusts for the degrees of freedom.
svyciprop_adjusted(
formula,
design,
level = 0.95,
adj = "none",
aa_vr = NULL,
aa_pop = NULL,
...
)
formula |
see |
design |
see |
level |
see |
adj |
adjustment to the Korn and Graubard confidence intervals: |
aa_vr |
used to produce age-adjusted confidence intervals only. The name of a
categorical age variable located in |
aa_pop |
used to produce age-adjusted confidence intervals only. A |
... |
see |
adj specifies the adjustment to the Korn and Graubard confidence intervals.
"none": No adjustment is performed. Produces standard Korn and Graubard confidence intervals,
same as survey::svyciprop( method = "beta" ).
"NCHS": Adjustment that might be required by some (though not all) NCHS data systems. With
this adjustment, the degrees of freedom is set to degf(design). Consult the documentation
for the data system that you are analyzing to determine if this is the appropriate
adjustment.
"NHIS": Adjustment that might be required by NHIS. With this adjustment, the degrees
of freedom is set to nrow(design) - 1. Consult the documentation
for the data system that you are analyzing to determine if this is the appropriate
adjustment.
To use these adjustments in surveytable tabulations, call set_survey() or set_opts() with the
appropriate mode or adj argument. Age-adjustment can be turned on with set_survey(). But if
adj = "none", no age-adjustment is performed.
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 confidence intervals when they
describe the same standard population distribution.
Originally written by Makram Talih (2019). Age-adjusted calculation based on Natalie Young (2026).
The point estimate of the proportion, with the confidence interval as an attribute.
set_survey(namcs2019sv)
set_opts(adj = "NCHS")
tab("AGER")
set_opts(adj = "none")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.