add_phq4_totals: Add PHQ-4 totals

add_phq4_totalsR Documentation

Add PHQ-4 totals

Description

add_phq4_totals() is an Add function that updates an object by adding new values to new or empty fields. Specifically, this function implements an algorithm to add phq-4 totals. The function returns Object (an output object of multiple potential types).

Usage

add_phq4_totals(
  ds_tb,
  ctg_var_nm_1L_chr = "phq4_ctg_fct",
  dict_ctg_1L_chr = "PHQ-4",
  dictionary_r3 = ready4use::ready4use_dictionary(),
  domains_ls = list(anxiety = 1:2, depression = 3:4),
  domains_prefix_1L_chr = "phq4_",
  items_prefix_1L_chr = "phq_gad_",
  total_var_nm_1L_chr = "phq4_total_int",
  what_1L_chr = "ds",
  ...
)

Arguments

ds_tb

Dataset (a tibble)

ctg_var_nm_1L_chr

Category variable name (a character vector of length one), Default: 'phq4_ctg_fct'

dict_ctg_1L_chr

Dictionary category (a character vector of length one), Default: 'PHQ-4'

dictionary_r3

Dictionary (a ready4 submodule), Default: ready4use::ready4use_dictionary()

domains_ls

Domains (a list), Default: list(anxiety = 1:2, depression = 3:4)

domains_prefix_1L_chr

Domains prefix (a character vector of length one), Default: 'phq4_'

items_prefix_1L_chr

Items prefix (a character vector of length one), Default: 'phq_gad_'

total_var_nm_1L_chr

Total variable name (a character vector of length one), Default: 'phq4_total_int'

what_1L_chr

What (a character vector of length one), Default: 'ds'

...

Additional arguments

Value

Object (an output object of multiple potential types)


ready4-dev/scorz documentation built on June 1, 2025, 2:07 p.m.