View source: R/ard_categorical.survey.design.R
ard_categorical.survey.design | R Documentation |
Compute tabulations on survey-weighted data.
The counts and proportion ("N"
, "n"
, "p"
) are calculated using survey::svytable()
,
and the standard errors and design effect ("p.std.error"
, "deff"
) are
calculated using survey::svymean()
.
The unweighted statistics are calculated with cards::ard_categorical.data.frame()
.
## S3 method for class 'survey.design'
ard_categorical(
data,
variables,
by = NULL,
statistic = everything() ~ c("n", "N", "p", "p.std.error", "deff", "n_unweighted",
"N_unweighted", "p_unweighted"),
denominator = c("column", "row", "cell"),
fmt_fn = NULL,
stat_label = everything() ~ list(p = "%", p.std.error = "SE(%)", deff =
"Design Effect", n_unweighted = "Unweighted n", N_unweighted = "Unweighted N",
p_unweighted = "Unweighted %"),
...
)
data |
( |
variables |
( |
by |
( |
statistic |
( |
denominator |
( |
fmt_fn |
( |
stat_label |
( |
... |
These dots are for future extensions and must be empty. |
an ARD data frame of class 'card'
svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq)
ard_categorical(svy_titanic, variables = c(Class, Age), by = Survived)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.