View source: R/process_event_tables.r
get_incidence_prevalence | R Documentation |
Given a data.table with all events for a phenotype and reference dates per individual, compute the time to event data for each individual. If no reference date is given then the date of first available event will be taken as reference date for each individual. ...
get_incidence_prevalence(
all_event_dt,
df.data.settings,
df_reference_date = NULL,
include_secondary_recurrence = FALSE,
window_ref_days_include = 0,
window_fu_days_mask = 0,
verbose = TRUE
)
all_event_dt |
data table containing all events |
df.data.settings |
data frame containing data settings |
window_ref_days_include |
number of days around the reference date (visit) that should be used to indicates if individuals had the event on the reference date. Relevant if you want to know if participant took medication on the visit |
window_fu_days_mask |
number of days that future events should not be counted |
reference_date |
reference dates for each individuals in the whole cohort as a named vector |
a data table with individual with time to event information
all_event_dt <- get_all_events(dfDefinitions_processed_expanded[1,],lst.data,df.data.settings)
get_incidence_prevalence(all_event_dt,df.data.settings, reference_date = setNames(as.Date(as.character(dfukb$f.53.0.0),format="%Y-%m-%d"),dfukb$identifier))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.