Skip to contents

Get the ratio for numeric variables.

Usage

kobo_ratio(
  design,
  nums,
  denoms,
  ratio_key_sep = " -/- ",
  survey,
  group = NULL,
  group_key_sep = " -/- ",
  label_survey = TRUE,
  na_rm = TRUE,
  vartype = "ci",
  level = 0.95
)

Arguments

design

A srvyr::design object.

nums

The numerator variables.

denoms

The denominator variables.

ratio_key_sep

A separator for the ratio key.

survey

The survey sheet from Kobo (with column "type" split). See split_survey().

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.

label_survey

Boolean. Retrieve var's label from the survey sheet? Default to TRUE.

na_rm

Boolean. Remove any line that as an NA in num or denom 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

A single number or vector of numbers indicating the confidence level

Value

A character vector of select_one questions.

Details

survey should have a split type column with types of variables such as "select_one", "select_multiple", etc.