Skip to contents

The TDSC participant register stores four covariates as German free text. This function holds the maps that fold that text onto controlled vocabularies as data, so extending the package for a spelling it has not seen is one argument rather than a code change: whatever you pass is utils::modifyList()-merged, recursively, onto the shipped default.

Usage

sdt_participant_dictionary(
  funktion = NULL,
  titel = NULL,
  fachbereich = NULL,
  anrede = NULL
)

Arguments

funktion, titel, fachbereich, anrede

Optional named lists merged onto the corresponding shipped slot. Each slot has a map (normalised key to level), and, depending on the covariate, patterns, levels, score and group. Adding one spelling means passing funktion = list(map = list("leitender oberarzt" = "consultant")).

Value

An S3 object of class sdt_participant_dictionary: a list of four slots, with print() and format() methods.

Details

The four vocabularies are:

  • funktion — an ordered seniority ladder, resident < specialist < consultant < chief (Assistenzarzt, Facharzt, Oberarzt, Chefarzt), scored 1–4. other ("Andere") is a real answer that sits off the ladder and scores NA; not_stated ("Nichts angegeben") is a declared non-answer and is treated as missing, not as a sixth grade.

  • titel — the academic ladder none < doctorate < habilitation < professor, scored 0–3. Matching is exact on a punctuation- and case-insensitive key first, then falls back to patterns, where every rung is tested and the highest match wins. An empty title box is filled with none when blank_is_none is TRUE — and every filled row is flagged, see sdt_read_participants().

  • fachbereich — a controlled specialty list plus a surgical / non-surgical group. Multi-specialty free text ("Chirurgie, Unfallchirurgie") is collapsed by the stated rule the primary specialty is the one mentioned first: the pattern whose match starts earliest in the string wins.

  • anrede — salutation to sex. This is a proxy: it records how a person was addressed on a registration form, not a gender identity.

See also

sdt_read_participants(), which applies it.

Examples

d <- sdt_participant_dictionary()
d
#> <sdt_participant_dictionary>
#> funktion    6 spellings -> resident < specialist < consultant < chief
#> titel       22 spellings + 3 patterns -> none < doctorate < habilitation < professor
#> fachbereich 14 spellings -> 11 specialties (6 surgical)
#> anrede      female / male (a salutation proxy, not gender identity)
d$funktion$score
#>   resident specialist consultant      chief 
#>          1          2          3          4 

# One new spelling, no package patch.
d2 <- sdt_participant_dictionary(
  funktion = list(map = list("leitender oberarzt" = "consultant"))
)
d2$funktion$map[["leitender oberarzt"]]
#> [1] "consultant"