Skip to contents

Survey proportion

Usage

svy_proportion(
  design,
  vars,
  group = NULL,
  group_key_sep = " -/- ",
  na_rm = TRUE,
  vartype = "ci",
  level = 0.95,
  ak = TRUE,
  ak_overall_sep = " @/@ ",
  ak_main_sep = " -/- ",
  ak_var_to_value_sep = " %/% ",
  ...
)

Arguments

design

A srvyr::design object.

vars

A quoted vector of variables to calculate proportion from.

group

A quoted vector of columns to group by. Default to NULL for no group.

group_key_sep

A character string to separate grouping column names in a fancy 'group_key' column.

na_rm

Should NAs from var be removed? Default to TRUE.

vartype

Report variability as one or more of: standard error ("se", default), confidence interval ("ci"), variance ("var") or coefficient of variation ("cv").

level

(For vartype = "ci" only) A single number or vector of numbers indicating the confidence level

ak

Boolean. Add the analysis key?

ak_overall_sep

The overall separator between items, e.g. between the type of analysis and the variables information.

ak_main_sep

The main separator between variables, e.g. between the two grouping columns.

ak_var_to_value_sep

The separator between the variable and its value.

...

Other parameters to pass to srvyr::survey_prop().

Value

A survey-summarized-proportion data frame

See also

Other survey analysis functions: auto_svy_analysis(), svy_analysis(), svy_interact(), svy_mean(), svy_median(), svy_quantile(), svy_ratio()