Skip to contents

Kobo survey analysis

Usage

kobo_analysis(
  design,
  analysis,
  vars,
  survey,
  choices = NULL,
  group = NULL,
  group_key_sep = " -/- ",
  auto_group_remove = TRUE,
  label_survey = TRUE,
  label_choices = TRUE,
  na_rm = TRUE,
  vartype = "ci",
  level = 0.95,
  ratio_key_sep = " -/- ",
  choices_sep = "/"
)

Arguments

design

A srvyr::design object.

analysis

Analysis type. See details for more, well, details.

vars

A variable to calculate from.

survey

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

choices

The choices sheet from Kobo.

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.

auto_group_remove

If TRUE, the analysis won't be run for vars that are in group. Default to TRUE.

label_survey

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

label_choices

Boolean. Retrieve choices label from the choices sheet? Default to TRUE.

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

ratio_key_sep

A separator for the ratio key.

choices_sep

Select multiples choices separator.

Value

A survey-summarized-median data frame

Specificity per type of analysis

The possible analysis type are: mean for kobo_mean(), median for kobo_median(), select_one for kobo_select_one(), select_multiple for kobo_select_multiple(), or ratio for kobo_ratio().

  • If analysis is "ratio": vars takes a named vector. Names will be passed to nums in svy_ratio() and values to denoms.

  • If choices not NULL, the function tries to retrieve labels for select_one, while it is mandatory for select_multiple, and not used for mean, median, and ratio.