diagnosed_placeholder | R Documentation |
These convenience functions perform a combination of self-reported diagnosis lookups, ICD10 lookups, medication lookups, and lab/measurement value lookups in order to return a boolean vector indicating whether a diagnosis has been made within the provided instance ranges. The actual algorithm for each disease diagnosis (e.g. hypertension) is somewhat arbitrary, and (for example) is based on a selected list of medications, blood pressure measurements, ICD10 codes, etc. Users should construct their own algorithms to fit specific use-case scenarios.
diagnosed_chf( data, after_instance = default_after_inst(), up_to_instance = default_up_to_inst(), diagnosis_col = f.20002.0.0.Non_cancer_illness_code_self_reported ) diagnosed_htn( data, after_instance = default_after_inst(), up_to_instance = default_up_to_inst(), diagnosis_col = f.20002.0.0.Non_cancer_illness_code_self_reported, min_sbp = 140, min_dbp = 90 ) diagnosed_hld( data, after_instance = default_after_inst(), up_to_instance = default_up_to_inst(), diagnosis_col = f.20002.0.0.Non_cancer_illness_code_self_reported ) diagnosed_copd( data, after_instance = default_after_inst(), up_to_instance = default_up_to_inst(), diagnosis_col = f.20002.0.0.Non_cancer_illness_code_self_reported ) diagnosed_pHTN( data, after_instance = default_after_inst(), up_to_instance = default_up_to_inst(), diagnosis_col = f.20002.0.0.Non_cancer_illness_code_self_reported ) diagnosed_pulm_embolism( data, after_instance = default_after_inst(), up_to_instance = default_up_to_inst(), diagnosis_col = f.20002.0.0.Non_cancer_illness_code_self_reported ) diagnosed_diabetes( data, after_instance = default_after_inst(), up_to_instance = default_up_to_inst(), diagnosis_col = f.20002.0.0.Non_cancer_illness_code_self_reported )
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.). |
after_instance |
An integer specifying an instance number, or the name of the column (using < |
up_to_instance |
An integer specifying an instance number, or the name of the column (using < |
diagnosis_col |
Template column name for self-reported diagnosis codes. |
min_sbp |
Minimum SBP for HTN diagnosis |
min_dbp |
Minimum DBP for HTN diagnosis |
The UK Biobank records visits as separate "instances." As of this writing, there are 4 instances labeled 0 through 3. At each instance, various information can be recorded or re-recorded. For example, blood pressure is typically recorded at most in-person evaluations. Therefore, there may be 4 separate columns for blood pressure recordings (actually, there could be more because the blood pressure may be recorded multiple times at each instance). Almost all of the functions in this package will utilize instance numbers to specify from which time pointsdata should be retrieved. For example, we may want to know the state of ICD10 diagnoses before instance 2. In this case, we would specify up_to_instance = 1
(search up to instance 1, inclusive) in functions that take this as an argument.
Arguments like up_to_instance
and after_instance
can take a constant instance number as their value. But they can also take the name of a column that contains an instance number, so that different instance limits can be used for each participant. For example, some participants undergo MRI at instance 2, and others at instance 3. If we want to know the state of a diagnosis up to and including the time of MRI, we would want to assign up_to_instance
to the name of the column that specifies which instance the MRI occurred at. This column typically has to be generated by the user and attached to thedata frame beforehand.
Most functions in this package will take column names (*_col
) as optional arguments (otherwise a default column names are used) which are then used as templates to find all other columns with the same field number, but different instance and array numbers. These functions will automatically find all matching instances (and arrays within each instance) within the specified parameters. Internally, a set of expand_instance_*()
helper functions, which themselves rely on the column_expansion_helper()
function, perform the work of searching for matching columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.