dx_self_report_lookup: Self-reported diagnosis lookup

View source: R/diagnoses.R

dx_self_report_lookupR Documentation

Self-reported diagnosis lookup

Description

Look up whether a diagnosis has been self-reported, based on coding 6. See https://biobank.ctsu.ox.ac.uk/crystal/coding.cgi?id=6. For disease-specific diagnosis_*() functions, the function dx_self_text_to_codes() is used internally to convert the text form of the diagnosis to the code used in the UKBdata table.

Usage

dx_self_report_lookup(
  data,
  codes,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  diagnosis_col = f.20002.0.0.Non_cancer_illness_code_self_reported
)

Arguments

data

The primarydata frame.

Thisdata frame includes all necessary columns required to perform look-ups (e.g. ICD10 code columns, medication code columns, age, sex, etc.).

codes

Diagnosis codes to look up.

after_instance

An integer specifying an instance number, or the name of the column (using <data-masking> rules) containing instance numbers to use as the minimum instance (non-inclusive). Used to include alldata after but NOT including the specified instance number. Defaults to default_after_inst(), which is typically -1 (i.e., include instances 0 and later).

up_to_instance

An integer specifying an instance number, or the name of the column (using <data-masking> rules) containing instance numbers to use as the maximum instance (inclusive). Used to include alldata up to and including the specified instance number. Defaults to default_up_to_inst(), which as of this writing returns 3.

diagnosis_col

Template column name for self-reported diagnosis codes.
Default = f.20002.0.0.Non_cancer_illness_code_self_reported.


adamleejohnson/R-ukbiobank documentation built on April 25, 2022, 2:11 a.m.