survey_detect_qtypes: Detect question types

Description Usage Arguments Details Value Examples

View source: R/survey_detect_qtypes.R

Description

Looks at the possible answers in a column, and determines which type of question is most likely. This is based on rules of thumb and can be tuned for different uses using the calculation criteria.

Usage

1
2
3
4
5
6
7
survey_detect_qtypes(
  response_col,
  unique_vals = 20,
  split_perc = 0.5,
  prop_total = 0.55,
  prop_common = 0.05
)

Arguments

response_col

column from response dataframe

unique_vals

integer

split_perc

float

prop_total

float

prop_common

float

Details

Calculation criteria can be set by the user: unique_vals: what's the maximum number of unique values a column can have, to always consider it categorical? split_perc: determines which questions are deemed multi-choice: if the answers are split by comma, how much fewer unique values should that column have than before splitting? Helps distinguish between free-text and multi-choice. prop_total: if the 5 most common values account for this proportion of the total number of answers, consider it categorical prop_common: if the most common response is at most this proportion of the total, consider it free text

Value

a string value

Examples

1

DataS-DHSC/consultations documentation built on Jan. 28, 2022, 1:56 a.m.