ard_dichotomous.survey.design {cardx} | R Documentation |
ARD Dichotomous Survey Statistics
Description
Compute Analysis Results Data (ARD) for dichotomous summary statistics.
Usage
## S3 method for class 'survey.design'
ard_dichotomous(
data,
variables,
by = NULL,
value = cards::maximum_variable_value(data$variables[variables]),
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 %"),
...
)
Arguments
data |
(survey.design )
a design object often created with survey::svydesign() .
|
variables |
(tidy-select )
columns to include in summaries.
|
by |
(tidy-select )
results are calculated for all combinations of the column specified
and the variables. A single column may be specified.
|
value |
(named list )
named list of dichotomous values to tabulate.
Default is cards::maximum_variable_value(data$variables) ,
which returns the largest/last value after a sort.
|
statistic |
(formula-list-selector )
a named list, a list of formulas,
or a single formula where the list element is a character vector of
statistic names to include. See default value for options.
|
denominator |
(string )
a string indicating the type proportions to calculate. Must be one of
"column" (the default), "row" , and "cell" .
|
fmt_fn |
(formula-list-selector )
a named list, a list of formulas,
or a single formula where the list element is a named list of functions
(or the RHS of a formula),
e.g. list(mpg = list(mean = \(x) round(x, digits = 2) |> as.character)) .
|
stat_label |
(formula-list-selector )
a named list, a list of formulas, or a single formula where
the list element is either a named list or a list of formulas defining the
statistic labels, e.g. everything() ~ list(mean = "Mean", sd = "SD") or
everything() ~ list(mean ~ "Mean", sd ~ "SD") .
|
... |
These dots are for future extensions and must be empty.
|
Value
an ARD data frame of class 'card'
Examples
survey::svydesign(ids = ~1, data = mtcars, weights = ~1) |>
ard_dichotomous(by = vs, variables = c(cyl, am), value = list(cyl = 4))
[Package
cardx version 0.2.0
Index]