getCases: Creates an initial incidence cohort.

Description Usage Arguments Value Author(s) Examples

View source: R/getCases.R

Description

This function does most of the tedious work for creating an incidence cohort. It will pull all the required datasets, define the incidence cases based on verified cancers + deaths (but NOT self-reported only cancers). Cases are censored at diagnosis date, date of other cancer diagnosis, date of death, date of last survey, or reported cancer of interest (if not verified). The final returned dataset will include both men and women, and can be merged with other data.

Usage

1
getCases(outcome, cpsCode, icd9Code, icd10Code, rep_code, inccanv = NULL, sitec = NULL, initialPath = file.path("s:/cps"))

Arguments

outcome

1L character vector describing your outcome. All of the incident cancer variables will be named with this variable, example: "BREAST_FINAL", "BREAST_DIED", etc.

cpsCode

1982 CPS death codes for the cancer of interest - typically unnecessary for a nutrition cohort analysis, but including it anyways.

icd9Code

Character vector: ICD9 death codes for the cancer of interest

icd10Code

Character vector: ICD10 death codes for the cancer of interest

rep_code

Character vector: Codes to pull reported cases from the reported file, corresponds to the (INCCAN97, INCCAN99, etc) variables

inccanv

Character vector: Codes to pull from the verified INCCANV variable.

sitec

Character vector: Codes to pull from the SITEC verified variable.

initialPath

Initial path - points to S:/CPS as default, but I can change it if I want to run locally.

Value

Only a selection of variables will be returned from the original data. I've chosen to drop most of the variables from the survey files, and just include things that can be merged with the rest of an analytic cohort.

ALL the variables included in the verified file will be returned because all cases will need further processing for histology/subtypes/etc.

Also returned:

ID

14-digit CPS2 ID

DXDATE

Diagnosis date from verified file (pre-censoring)

SEX

Sex ("MEN" or "WOMEN")

CODE1

Code1 from Mortality file

CODE2

Code2 from Mortality file

CODE3

Code3 from Mortality file

DEAD

Vital status

DTHDATE

Date of death

LOSTFU

Lost to followup

ANYCANCER

Death from any cancer

DATEFT

Final end of followup variable (post censoring)

PREV82

Prevalent cancer in 1982

PREV92

Prevalent cancer in 1992

PREVCANCER

Prevalent cancer including 1982 and 1992

DTINT92

Date of interview 1992

outcome_FINAL

Final incident cancer variable (post censoring)

outcome_DEATH

Death from cancer of interest (post censoring)

outcome_DIED

Death-only case (post censoring)

outcome_SELF

Self reported cancer of interest (post censoring)

outcome_VERIFIED

Verified cancer of interest (post censoring)

Author(s)

Brian Carter

Examples

1
2
3
4
5
6
7
breast.cases <- getCases(outcome="BREAST",
                         cpsCode="74",
                         icd9Code=c("174",paste0("174",0:9),"175",paste0("175",0:9)),
                         icd10Code=c("C50",paste0("C50",0:9)),
                         rep_code="C50",
                         inccanv="C50",
                         sitec=NULL)

buddha2490/MargotFun documentation built on Nov. 4, 2019, 8:16 a.m.