multiple_diagnoses: Multiple cancer diagnoses

View source: R/descriptive_stats.R

multiple_diagnosesR Documentation

Multiple cancer diagnoses

Description

retrieve individuals with multiple occurences in the cancer registry (presumably corresponding to multiple cancer diagnoses), including for each cancer occurence: the date of diagnosis, the icd10 or icd9 code, the date of death, primary causes of death and secondary causes of death. The function retrieves a single example for each occurence of multiple diagnoses. The idea is to create examples where an individual occurs in the cancer registry multiple times so as to understand the data better.

Usage

multiple_diagnoses(dat = NULL, cancer_name = NULL, occurences = NULL)

Arguments

dat

the cancer dataset

cancer_name

the name of the field/column in dat corresponding to case-control status for the cancer of interest. The field must take on values of 1 (control) or 2 (cases).

occurences

the number of cancer diagnoses. Can be a single value or range of values, e.g. 2:5 will extract individuals with 2 to 5 cancer diagnoses. If set to 5, the function will retrieve one individual with at least 5 occurences in the cancer registry. If 2:5. then will retrieve one individual with 2, 3, 4 and 5 occurences in the cancer registry.

Value

data frame


mightyphil2000/UkbCancerMortality documentation built on Oct. 12, 2023, 4:40 a.m.