age_at_instance | R Documentation |
Age, in years, at the time of the specified instance.
age_at_instance
uses the coded fields that contain the age (rounded to the nearest year) at each instance visit.
age_at_instance_computed
calculates a slightly more precise age based on the partipants year and month of birth.
age_at_instance( data, instance_num, age_at_instance_col = f.21003.0.0.Age_when_attended_assessment_centre ) age_at_instance_computed( data, instance_num, date_of_instance_col = f.53.0.0.Date_of_attending_assessment_centre, year_of_birth_col = f.34.0.0.Year_of_birth, month_of_birth_col = f.52.0.0.Month_of_birth )
data |
The primarydata frame. Thisdata frame includes all necessary columns required to perform look-ups (e.g. ICD10 code columns, medication code columns, age, sex, etc.). |
instance_num |
An integer specifying the instance number, or the name of the column (using < |
age_at_instance_col |
Template column name for age at instance. |
date_of_instance_col |
Template column name for date of each instance. |
year_of_birth_col |
Template column name for year of birth. |
month_of_birth_col |
Template column name for month of birth. |
Most functions in this package will take column names (*_col
) as optional arguments (otherwise a default column names are used) which are then used as templates to find all other columns with the same field number, but different instance and array numbers. These functions will automatically find all matching instances (and arrays within each instance) within the specified parameters. Internally, a set of expand_instance_*()
helper functions, which themselves rely on the column_expansion_helper()
function, perform the work of searching for matching columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.