A certain set of SES variables are repetitively requested by research protocols & grant, therefore, it would be helpful to write function & documentation to make research efficient for users of different experience levels.
Variables to add
Priorities
income: before, after tax; provincial, national (tbd)
visible minority
ethnic concentration, deprivation score, dependency, residential instability (quintiles from ON Marg Index; 2016 & 2021)
immigrant status
post-secondary degree
urban vs rural status (encounter or hospital location)
Function skeleton outline
Merge all relevant tables: users just provide a cohort input and dbcon input and then the function loads and merges the relevant tables
Add warnings about missingness: 1) no entry in locality vars table due to invalid/missing postal code/residence in area not covered by census (no linkage), 2) missingness in census data itself due to low/no response rate etc., which is reflected in the % of 9/9999999 values)
Input arguments: db_con, cohort (must have genc_id), census_year (2016/2021; dauid16 or dauid21: linkage from Stats Can 2016 or 2021
Output: return a data.table with genc_id (user's cohort) with all the above variables to add
Documentation skeleton outline
Quick intro about data sources: Stats Can, ON Marg Index, PCCF+
Briefly explain methodology for how those variables are collected/calculated, rationale of variables
For ON Marg, have a section to explain difference between 2016 and 2021 versions
Rationale for choosing linkage from Stats Can 2016 or 2021
Emphasis: all neighbourhood-level variables (not patient-level)
Motivation
A certain set of SES variables are repetitively requested by research protocols & grant, therefore, it would be helpful to write function & documentation to make research efficient for users of different experience levels.
Variables to add
Priorities
Function skeleton outline
Documentation skeleton outline