get_cases: Get case for a phenotype

get_casesR Documentation

Get case for a phenotype

Description

Given a phenotype, a list of episode data and reference dates per individual, identify cases /exclude cases fulfilling exclusion criteria and compute the time to event data for these individuals. If no reference date is given then the date of first available event will be taken as reference date for each individual.

Usage

get_cases(
  definitions,
  lst.data,
  df.data.settings,
  df_reference_dt = NULL,
  include_secondary_recurrence = FALSE,
  verbose = TRUE,
  window_fu_days_mask = 0,
  ...
)

Arguments

definitions

phenotype/trait specified in definition table (a row in the table)

lst.data

list of data table with all episode data

df.data.settings

data frame containing data settings

window_fu_days_mask

number of days that future events should not be counted. e.g. you could only count events after 10 days from the reference visit to avoid events related to the reference date.

reference_date

reference dates for each individuals in the whole cohort as a named vector

Value

a list of 2 data tables : all events for valid cases and an event summary containing time to event information for these individuals.

Examples

get_cases(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="Nicm"), lst.data,df.data.settings, reference_date=setNames(as.Date(as.character(dfukb$f.53.0.0),format="%Y-%m-%d"),dfukb$identifier))

niekverw/ukbpheno documentation built on Oct. 30, 2023, 9:17 p.m.