Skip to contents

Add HRI variables to an SLF Individual File

Usage

add_hri_variables(
  data,
  chi_variable = "chi",
  slf_pc_lookup = read_file(get_slf_postcode_path(), col_select = "postcode")
)

Arguments

data

An SLF individual file.

chi_variable

string, claiming chi or anon_chi.

slf_pc_lookup

The Source postcode lookup, defaults to get_slf_postcode_path() read using read_file().

Value

The individual file with HRI variables matched on

Details

Filters the dataset to only include Scottish residents, then creates a lookup where HRIs are calculated at Scotland, Health Board, and LCA level. Then joins on this lookup by chi/anon_chi.