Skip to contents

add_loop_wgq_ss prepares dummy variables for each WG-SS component (vision, hearing, mobility, cognition, self-care, communication) and their levels (no difficulty, some difficulty, a lot of difficulty, cannot do at all) and combines them into the sum of domains coded for each level (e.g, wgq_cannot_do_n), and disability binary cut-offs variables (wgq_dis_1, wgq_dis_2, wgq_dis_3, wgq_dis_4).

Usage

add_loop_wgq_ss(
  loop,
  ind_age = "ind_age",
  vision = "wgq_vision",
  hearing = "wgq_hearing",
  mobility = "wgq_mobility",
  cognition = "wgq_cognition",
  self_care = "wgq_self_care",
  communication = "wgq_communication",
  no_difficulty = "no_difficulty",
  some_difficulty = "some_difficulty",
  lot_of_difficulty = "lot_of_difficulty",
  cannot_do = "cannot_do",
  undefined = c("dnk", "pnta")
)

add_loop_wgq_ss_to_main(
  main,
  loop,
  wgq_dis_4 = "wgq_dis_4",
  wgq_dis_3 = "wgq_dis_3",
  wgq_dis_2 = "wgq_dis_2",
  wgq_dis_1 = "wgq_dis_1",
  ind_age_above_5 = "ind_age_above_5",
  id_col_main = "uuid",
  id_col_loop = "uuid"
)

Arguments

loop

A data frame of individual-level data.

ind_age

The individual age column.

vision

Vision component column.

hearing

Hearing component column.

mobility

Mobility component column.

cognition

Cognition component column.

self_care

Self-care component column.

communication

Communication component column.

no_difficulty

Level for no difficulty.

some_difficulty

Level for some difficulty.

lot_of_difficulty

Level for a lot of difficulty.

cannot_do

Level for cannot do at all.

undefined

Vector of undefined responses, such as Prefer not to answer and Don't know.

main

A data frame of household-level data.

wgq_dis_4

Column name for the disability 4 cut-offs binary.

wgq_dis_3

Column name for the disability 3 cut-offs binary.

wgq_dis_2

Column name for the disability 2 cut-offs binary.

wgq_dis_1

Column name for the disability 1 cut-offs binary.

ind_age_above_5

Column name for the age above 5 dummy in the individual-level dataset.

id_col_main

Column name for the unique identifier in the main dataset.

id_col_loop

Column name for the unique identifier in the loop dataset.