
Lexis expansion of data by age-at-risk
expand_age_at_risk.RdLexis expansion of data by age-at-risk
Arguments
- data
A data frame
- col.id
Name of column containing unique participant IDs
- col.dob
Name of column containing date of birth (Must be of class
Date)- col.entry_date
Name of column containing entry date (Must be of class
Date)- col.exit_date
Name of column containing exit date (Must be of class
Date)- col.status
Name of column containing status
- col.keep
Names of additional columns to include in the result (e.g. exposure and covariate variables)
- ages
Vector of ages (years) to create age-at-risk strata. Any participant follow-up outside these ages is dropped. (Must be a numeric vector with distinct, increasing values. Default: c(0, 100))
- age.labels
Vector of name for age-at-risk strata (Default:
paste0(ages[-length(ages)], "-", ages[-1]))- null.status
Value to use in status column for intervals before the final interval (Default: 0)